Skip to content

Using the shortcut to get to the header files the loading animation doesn't show up #14379

Closed

Description

Environment

  • OS and Version: tried on windows, rhel9, ubuntu.
  • VS Code Version: 1.115.0
  • C/C++ Extension Version: 1.31.4
  • If using SSH remote, specify OS of remote machine: experienced both ssh and local instances.

If I use the shortcut to get the header file of the cpp I'm currently exploring, the loading animation doesn't show up. Unfortunately, this process can last very long and sometimes (I think maybe because of a timer?) it expires. What's even worse is that, unlike any other vscode feature, this can't be stopped by any user interactions. As a result, if I get bored about the waiting times I keep doing something else but all of a sudden the header shows up. That happens very often in my environments.

I would love to contribute to this project by solving this by my own and opening the PR if I'm allowed to do so. Thank you in advance.

Bug Summary and Steps to Reproduce

Bug Summary:
The shortcut to get to the header files could result in unexpected behavior. You probably need to work on a big repository for this action to experience long enough waiting times.

Steps to reproduce:

  1. Go to a cpp file.
  2. Use the shortcut to get to the header file of that cpp.

Expected behavior:

  1. Loading animation won't show up.
  2. The action can't be stopped.
  3. If you keep doing something else, the header file could show up all of a sudden.

Configuration and Logs

-------- Diagnostics - 4/15/2026, 3:40:43 PM
Version: 1.31.4
Current Configuration:
{
    "name": "Linux",
    "includePath": [
        "/root/git/*******"
    ],
    "defines": [],
    "compilerPath": "/usr/bin/gcc",
    "cStandard": "c17",
    "cppStandard": "c++98",
    "intelliSenseMode": "linux-gcc-x64",
    "compilerPathInCppPropertiesJson": "/usr/bin/gcc",
    "intelliSenseModeIsExplicit": false,
    "cStandardIsExplicit": false,
    "cppStandardIsExplicit": false,
    "mergeConfigurations": false,
    "recursiveIncludes": {},
    "recursiveIncludesReduceIsExplicit": false,
    "recursiveIncludesPriorityIsExplicit": false,
    "recursiveIncludesOrderIsExplicit": false,
    "compilerPathIsExplicit": false,
    "browse": {
        "limitSymbolsToIncludedHeaders": true
    }
}
Additional Tracked Settings:
{
    "editorTabSize": 4,
    "editorInsertSpaces": true,
    "editorAutoClosingBrackets": "languageDefined",
    "filesEncoding": "utf8",
    "filesAssociations": {},
    "filesExclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/.DS_Store": true,
        "**/Thumbs.db": true
    },
    "filesAutoSaveAfterDelay": false,
    "editorInlayHintsEnabled": true,
    "editorParameterHintsEnabled": true,
    "searchExclude": {
        "**/node_modules": true,
        "**/bower_components": true,
        "**/*.code-search": true
    },
    "workbenchSettingsEditor": "ui"
}

Other Extensions

No response

Additional context

Unfortunately I can't share much of the logs because I'm on a company environment.

Activity

  1. added
    more info needed
    on Apr 15, 2026
  2. sean-mcmanus commented on Apr 15, 2026

    @sean-mcmanus
    Contributor

    Marco De Meco (@MarcoDeMeco) What does "shortcut to get to the header file" mean? Are you referring to the Switch Header/Source command or right-click option?

  3. sean-mcmanus commented on Apr 15, 2026

    @sean-mcmanus
    Contributor

    Marco De Meco (@MarcoDeMeco) I assume the answer to my last question is "yes". When you set C_Cpp.loggingLevel to "Debug" what output do you see in the C/C++ logging? Is it still tag parsing files? The switch operation might be blocked on tag parsing.

  4. MarcoDeMeco commented on Apr 16, 2026

    @MarcoDeMeco
    Author

    Hi Sean McManus (@sean-mcmanus) thank you for your prompt response, yes I meant the Switch Header/Source command (I use the default shortcut alt+o). Here's the debug level logging:

    LSP: (received) cpptools/didChangeTextEditorSelection
    LSP: $/cancelRequest (textDocument/documentHighlight, id: 1114)
    LSP: $/cancelRequest (cpptools/getCodeActions, id: 1116)
    LSP: (received) cpptools/getCodeActions: file:///c%3A/git/******.cpp (id: 1118)
    LSP: (received) cpptools/hover: file:///c%3A/git/******.cpp (id: 1119)
    LSP: $/cancelRequest (cpptools/hover, id: 1119)
    LSP: (received) cpptools/didSwitchHeaderSource (id: 1120)
    

    here the extension spent ~10 seconds. And then:

    Expanding recursive includes for: C:\GIT\******.CPP
    LSP: (invoked) cpptools/didChangeTextEditorSelection
    LSP: (invoked) cpptools/getCodeActions: file:///c%3A/git/******.cpp (id: 1118)
    LSP: (invoked) cpptools/hover: file:///c%3A/git/******.cpp (id: 1119)
    LSP: (invoked) cpptools/didSwitchHeaderSource (id: 1120)
    Done expanding recursive includes for: C:\GIT\******.CPP
    Reducing recursive includes for: C:\GIT\******.CPP
    LSP: Sending response (id: 1120)
    LSP: (received) cpptools/getFoldingRanges: file:///c%3A/git/******.cpp (id: 1121)
    LSP: (invoked) cpptools/getFoldingRanges: file:///c%3A/git/******.cpp (id: 1121)
    LSP: Sending response (id: 1121)
    LSP: (received) textDocument/didOpen: file:///c%3A/git/******.h
    LSP: (invoked) textDocument/didOpen: file:///c%3A/git/******.h
    textDocument/didOpen: file:///c%3A/git/******.h
    

    To me it's not a big deal that it takes 10 seconds (I mean if it takes more than 2 seconds I instantly find it manually). I mean I get it I'm on a big repository. It's the fact that during these 10 seconds the loading animation doesn't show up and if I perform any action it doesn't stop, so at any moment while I'm editing the cpp file the header file can popup.

    I would love to contribute to this project by trying opening a PR for it if I'm allowed to.

  5. removed
    more info needed
    on Apr 16, 2026
  6. sean-mcmanus commented on Apr 16, 2026

    @sean-mcmanus
    Contributor

    Marco De Meco (@MarcoDeMeco) It's caused by our message handler thread being stuck some other operation, mostly likely by an IntelliSense operation -- some "invoked" command before your shown logging. If the message handling thread is idle it shouldn't be blocked. Your logging indicates the recursive includes expansion might be causing the delay, so removing the recursives includes (** in the includePath) or switching to "recursiveIncludes": { "reduce": "never" } may help. That particular implementation is handled in our closed source cpptools process.

    Copilot was able to add the missing progress indicator: #14386

  7. MarcoDeMeco commented on Apr 17, 2026

    @MarcoDeMeco
    Author

    That's great, thank you very much.

  8. moved this from Pull Request to Done in cpptoolson Jun 1, 2026
  9. locked and limited conversation to collaborators on Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

Projects

  • Status
    Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions