Vscode-cpptools: Can't go to the static method of a class

Created on 14 Apr 2017  Â·  11Comments  Â·  Source: microsoft/vscode-cpptools

We can't go to the definition when view a static method of a class, such as:

MainSrvProcessor::clientAskPVEEndReqProcessor;

we can't find the definition of clientAskPVEEndReqProcessor method by press key F12.

please help me to check this and fix it. thanks.

Language Service bug fixed (release pending)

Most helpful comment

The bug still exists when the IntelliSense engine is set to "Tag Parser". You probably are using the "Default" implementation, which doesn't have the bug. So the bug isn't really fixed, but using the Default intelliSense engine setting is recommended anyway.

All 11 comments

It works for me. Can you try class MainSrvProcessor { static void clientAskPVEEndReqProcessor () {} }; int main() { MainSrvProcessor::clientAskPVEEndReqProcessor (); }

Can you give more repro details? Are other methods of the class found? Does it find the wrong symbol? Maybe something else in the class definition is causing a failure. What OS are you on?

Glad for yours response!

I just write a demo(See the attach):
test.tar.gz
My Os is Ubuntu17.04 and
vs code Version 1.11.2
cpptools Version 0.10.5

thank you.

Thanks for the repro -- namespace::class:: works but class:: alone doesn't.

yes, i meet this too, can't goto class::my_struct. (^__^) ……

In Expectation your solution,

Haha , This issue is fixed in Vscode 1.16.0

The bug still exists when the IntelliSense engine is set to "Tag Parser". You probably are using the "Default" implementation, which doesn't have the bug. So the bug isn't really fixed, but using the Default intelliSense engine setting is recommended anyway.

Hello, sean-mcmanus
I can reproduce the bug again.
I do some change of the the test code above. It maybe can help you to fix this bug.
I guess it is caused by namespace.
see the attachement.
test_failed.zip
test_OK.zip

@AbelaroJiang The bug was never fixed for the Tag Parser. Are you using the "Default" IntelliSense engine (which shouldn't have this bug) or are you able to switch to using that? If you have #include files that aren't found in the translation unit it will fall back to the Tag Parser (if the intelliSenseFallback is enabled).

Yes, I use the default IntelliSense engine.
you can download the test sample the compare them.

Go to Definition is still implemented by the Tag Parser so the bug still existed. When you said it stopped reproing, I got this issue confused with another bug that stops reproing when switching to the Default IntelliSense. I've made a change that fixes this issue, but I'm not sure if it will make the next update or not. FYI, autocomplete and signatureHelp were also broken in this scenario (whenever code was only partially scoped, with some scopes missing on the left). Thanks a lot for reporting this issue. I'm sort of shocked that this scenario has been broken for so long.

This has been fixed in 0.13.0

Was this page helpful?
0 / 5 - 0 ratings