microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.46k stars 1.53k forks source link

Newest version not find references about function and variables #12498

Open jheffersonalves opened 2 months ago

jheffersonalves commented 2 months ago

Environment

Bug Summary and Steps to Reproduce

Bug Summary:

Steps to reproduce:

  1. Go to variables or function definition
  2. Click on with "CTRL" on function or variables
  3. And isn't working

Expected behavior: Go to Declaration from function or variable

Configuration and Logs

c_cpp_properties.json:
{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c17",
            "cppStandard": "gnu++14",
            "intelliSenseMode": "linux-gcc-x64",
            "configurationProvider": "ms-vscode.cmake-tools"
        }
    ],
    "version": 4
}

C/C++: Log Diagnostics:
loggingLevel: Debug
Custom configuration provider 'CMake Tools' registered

Other Extensions

No response

Additional context

No response

otbu2 commented 2 months ago

I can also report that I am seeing some issues with IntelliSense since the latest 1.21.2 and 1.21.3 updates. It's like the db file stops growing after sometime and it misses symbols. I am on VSCode 1.91.1, installed via snap on Ubuntu 20.04 LTS. Using GCC9/C++17.

Seemingly functional work-around: Revert to previous version v1.20.5. Then it seems like all symbols are parsed and the db-file grows to include them.

sean-mcmanus commented 2 months ago

@jheffersonalves Is your issue random? Does doing a Reset IntelliSense Database command from the command palette fix the issue? If you check your database size with 1.20.5 is the database size with 1.21.3 smaller? I'm trying to determine if your issue is the same as https://github.com/microsoft/vscode-cpptools/issues/12505 (the issue @otbu2 mentioned).

sean-mcmanus commented 2 months ago

@jheffersonalves @otbu2 Can someone temporarily set the C_Cpp.logginglevel to the hidden value of "7" and see if any SQLITE error messages are being reported in the C/C++ logging pane? The database maybe in a corrupted state (resetting the database as mentioned in my prior comment would fix that, although it might get into that bad state again).

sean-mcmanus commented 2 months ago

@jheffersonalves @otbu2 Also, when you repro the issue, does adding new global variables/function not update the Outline view with symbols? (if you're seeing SQLITE error messages, then that is likely the case).

sean-mcmanus commented 2 months ago

@jheffersonalves @otbu2 Also, do you repro the issue if you do a Reset IntelliSense Database and then don't interact with the editor until the database is done populating? i.e. does the repro seem to require doing other actions such as editing files or symbol search, etc. while the database is populating?

otbu2 commented 2 months ago

@jheffersonalves Is your issue random? Does doing a Reset IntelliSense Database command from the command palette fix the issue? If you check your database size with 1.20.5 is the database size with 1.21.3 smaller? I'm trying to determine if your issue is the same as #12505 (the issue @otbu2 mentioned).

No it does not seem random. As far as I can tell, the issue started immediately when 1.21 was released a short time ago. I tried resetting the database many times to no effect. The database file grew to ~381 MiB with 1.21.2/1.21.3 (probably both) where it stayed (I was watching the file size specifically in a terminal). After revert to 1.20.5 it started rebuilding and ended up at ~444 MiB where it is now. I would imagine that this corresponds with IntelliSense at that point also including the missing symbols (type names, type/namespace aliases, etc.)

MarcelBrusius commented 1 month ago

I also experienced Intellisense issues starting about two days ago (both with version 1.21.2 and 1.21.3. Neither in WSL nor in a Docker container opened from WSL Intellisense is working. It tries to determine suggestions for an eternity before it always ends up showing no suggestions.

C/C++ (debug) output looks like this everytime I hover over a variable/function/...: LSP: (received) textDocument/hover: file:///some/path/in/wsl/docker/main.cpp (id: 26) LSP: (invoked) textDocument/hover: file:///some/path/in/wsl/docker/main.cpp (id: 26) Quick info operation failed: FE: 'Compiler exited with error - No IL available' using Tag Parser for quick info LSP: Sending response (id: 26)

On Windows however it seems to work. LSP: (received) textDocument/hover: file:///path/on/windows/main.cpp (id: 50) LSP: (invoked) textDocument/hover: file:///path/on/windows/main.cpp (id: 50) LSP: Sending response (id: 50)

As already metioned, reverting to 1.20.5 solves the issuee.

github-actions[bot] commented 4 weeks ago

Hey @sean-mcmanus, this issue might need further attention.

@jheffersonalves, you can help us out by closing this issue if the problem no longer exists, or adding more information.