Go to definition / go to declaration

Sysprogs forums Forums VisualGDB Go to definition / go to declaration

This topic contains 3 replies, has 2 voices, and was last updated by  support 1 week ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #21063

    Ophidian14
    Participant

    If there was one feature I’d like to be improved right now in VisualGDB it would be getting “Go to definition” and “Go to declaration” working reliably 100% of the time.  When I use it currently, I observe a widely varying array of behaviors, choose from any of the below:

    1.  Nothing happens at all.  Meaning, I right-click, go to definition, and I get no reaction at all from Visual Studio.  Cursor just keeps blinking right where I was.
    2.  Visual Studio hangs for 15 seconds.  At the conclusion of the 15 seconds, I sometimes get taken to the definition, sometimes I get taken to the declaration, sometimes I stay where I am.
    3.  A “Find all symbols” box appears in the lower part of my screen saying it is updating some cache.  CPU goes to 100%, and the process never concludes.  I force kill CppEngine64.exe to abort.
    4.  Rarely, I get what I want, which is that I’m actually immediately taken to the definition of the thing I’m looking for (whether it’s a struct definition, function definition, or whatever).

    At a high level would it be possible to understand what governs whether I get 1, 2, 3, or 4?  Any tips on making this working better than it does?  I’ve sometimes noticed that (for example) if I get outcome #1, and then I go into the code, type “this->”, wait for the autocomplete to come up, and then try again, I get better results… however this only works sometimes, not all the time.

    Thanks for any help/tips/pointers Support is able to provide.

    #21064

    support
    Keymaster

    Hi,

    This is likely caused by VisualGDB updating its cache. Although normally VS should not hang for 15 seconds – instead it should display a detailed progress message.

    Either way, please try opening the View->Clang IntelliSense Diagnostics Console window. It will contain detailed output explaining what exactly the Clang engine is doing. Feel free to post some snippets from it and we can explain what exactly is going on behind the scenes.

    #21131

    Ophidian14
    Participant

    Here’s an example of #2.  I right-clicked on a type name and did Go to Definition.  The type was defined in an #include that was directly included in this .cpp that I was editing.  VS2017 was completely frozen for the entire time this was happening.  Thoughts?

     

    #21138

    support
    Keymaster

    Hi,

    Yes, it looks like VisualGDB is checking for modified source/header files in your project and is trying to rebuild the preamble for the newly opened file. This results in reading many header files in a short succession, likely overloading the network connection you are using and delaying the main Visual Studio thread that is trying to access the source file.

    Unfortunately there’s not much to optimize on our side though – VisualGDB needs to read all those files in order to build the necessary caches and if the network connection cannot handle this responsively, it would delay everything else. The good news is that VisualGDB only does this once after you open the solution. Once the necessary data is cached, VisualGDB won’t need to recompute/recheck it again.

    Also storing the source code on the Windows side (or using the direct SSH access with the Advanced CMake Project Subsystem so that VisualGDB can prioritize file accesses internally) could speed this up.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.