vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Sticky scrolling doesn't work well with C++ template class/function

Open xiezhaokai opened this issue 2 years ago • 0 comments

Env: VS Code Version: 1.70.0 OS Version: Ubuntu 20.04

Steps to Reproduce:

Open a C++ file with template class/function scroll down to the template function

what we expect is the class/function name , not the " template <typename T>" declaration .

2022-08-10 17-13-31 的屏幕截图

xiezhaokai avatar Aug 10 '22 09:08 xiezhaokai

@xiezhaokai Do you have a copy-paste friendly sample that reproduces the problem? We would like to verify, but we think this might be also fixed by https://github.com/microsoft/vscode/pull/157466

alexdima avatar Aug 10 '22 13:08 alexdima

@alexdima Below is the sample code for you to verify. just copy it to an empty file and rename it with "test.h"

#include <string>

template <typename T >
class ProtocolVarField
{
public:
    typedef T internalVarType;
    size_t offsetInProtocol = 0;
    std::string description;
    std::string fieldName1;
    // several members to make the class body long enough
    // to test sticky-scrolling
    std::string fieldName2;
    std::string fieldName3;
    std::string fieldName4;
    std::string fieldName5;
    std::string fieldName6;
    std::string fieldName7;
    std::string fieldName8;
    //***
    //
};

2022-08-11 08-58-22 的屏幕截图

xiezhaokai avatar Aug 11 '22 00:08 xiezhaokai

Hi, thanks for the feedback, I just verified on the new insiders version, and I have the following behavior:

sticky-scroll-type-cpp

aiday-mar avatar Aug 11 '22 07:08 aiday-mar