microsoft / vscode-cpptools

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

VSC not seeing symbols in outline for c language (No symbols found in document eg_name.c) #12181

Closed ManPython closed 1 month ago

ManPython commented 6 months ago

Environment

Bug Summary and Steps to Reproduce

Bug Summary: https://github.com/microsoft/vscode/issues/209982 Not sure is ext problem or VSC

Steps to reproduce: Use any c code like

#include <stdio.h>
int main() {
   // printf() displays the string inside quotation
   printf("Hello, World!");
   return 0;
}

Expected behavior: I expected to see function lists and class, etc. like on python.

Configuration and Logs

test

Other Extensions

C/C++ v1.20.0 (pre-release) C/C++ Extension Pack v1.3.0 C/C++ Themes v2.0.0

Additional context

test

browntarik commented 6 months ago

Are you saying that IntelliSense isn't working correctly? Could you provide a screenshot of the issue you are seeing?

ManPython commented 6 months ago

Not sure.. intelisense or dock window with outliner (more this). test_c

browntarik commented 6 months ago

So there could be a few things here:

1) I am not sure your .c file has been opened correctly, it looks like it is missing the c symbol I usually see: image

2) This would seem to suggest and IntelliSense issue. Could you provide output from the C/C++: Log Diagnostics command you would have access to once you open the file?

3) Do you have access to any other IntelliSense features (i.e error squiggles)?

ManPython commented 6 months ago

Let me see.. I added test2.c file where have problem. Will be great to see your file. Maybe is coding problem.. not sure. But is strange. test2.zip

sean-mcmanus commented 6 months ago

@ManPython Symbols might not be found if there's some issue with your database. You can set C_Cpp.loggingLevel to "Debug" and look for database error messages, and/or run the C/C++: Reset IntelliSense Database command, and/or add this setting to your workspace's settings.json: "C_Cpp.default.browse.databaseFilename": "${workspaceFolder}/.vscode/browse.vc.db" and verify that the database is created successfully.

ManPython commented 6 months ago

Don't understanding nothing here : )

  1. Soo.. symbols are in database for each language? Where?
  2. I tried re-instal extensions as related c/c++ and nothing.
  3. The test.c code is not only for c/c++ but also for ca65 cl65 as ASM to include.. soo.. should be independent I think in relation to "${workspaceFolder}/.vscode/browse.vc.db
  4. C_Cpp.loggingLevel to "Debug" and look for database error messages ..but no errors around (F1 > Open View... > Shared
  5. "C_Cpp.default.browse.databaseFilename": "${workspaceFolder}/.vscode/browse.vc.db" and verify that the database is created successfully. - where this database should be created, how to check, I do this but not see sense here
sean-mcmanus commented 6 months ago

@ManPython Our C/C++ extension creates a database of symbols for C/C++ files for the Outline view. It's normally storied in some default location, but you can override that default location to put the database in your workspace folder (perhaps temporarily) to see if that fixes the issue and/or if the database is being created or not. With that setting set, the database should be in the .vscode folder of your workspace folder, the same folder that might contain a setting.json or c_cpp_properties.json files if you've modified those settings.

ManPython commented 6 months ago

Ok, got it.. but.. base exist, and some issue around coding? Or it's normal?

browse vc db

sean-mcmanus commented 6 months ago

@ManPython What do you mean by "base exist"? Do you mean the bug still repros? Your screenshot doesn't show anything unusual. The "code_items" table is where you should seem symbols.

ManPython commented 6 months ago

Data base exist. Symbols list not exist. Soo.. if no symbols, then some type of bug.. Did you try my file? Sent me other own example to check how can be done data base on this.. if possible.

sean-mcmanus commented 6 months ago

@ManPython Did you look for database or tag parsing errors in the "C/C++" logging pane? This one:

image

ManPython commented 6 months ago

In output I dont have C/C++ when .c But.. I save .c file as .cpp and symbols exist (and then I have in combolist C/C++), so it's problem only when .c file as extension.

sean-mcmanus commented 6 months ago

@ManPython We just found a bug with 1.20.1 (i.e. we reproed this bug) -- you should try downgrading to 1.20.0 or 1.19.9.

ManPython commented 6 months ago

Not working also on v1.19.8 soo waiting for upgrade.

sean-mcmanus commented 6 months ago

@ManPython Oh, sorry -- it turns out I was reproing a different issue. You're using the x64 vsix, right?

ManPython commented 6 months ago

Not sure about x64 vsix, Windows x64.

sean-mcmanus commented 6 months ago

Yeah, that should be the x64 vsix. We don't currently know what could be causing this failure, but the symptom is similar to a tag parser failure which could be caused if vcmeta.dll can't be loaded by our cpptools.exe process. You may want to verify vcmeta.dll exists at C:\Users\username\.vscode\extensions\ms-vscode.cpptools-1.20.1-win32-x64\bin\vcmeta.dll in case it's being deleted externally.

It's also possible that your OS is missing an expected DLL that vcmeta.dll needs to load. I'm not sure which DLL that would be. It's possible the Windows dependency walker could tell.

ManPython commented 6 months ago

Exist ver. 14.38.33135.0 But if working with cpp then is just case for c not .dll I think.

sean-mcmanus commented 6 months ago

@ManPython You're right -- a problem with vcmeta.dll would affect cpp files too. I'm not sure why there would be a failure just with c files (which we're not able to repro so far).

ManPython commented 6 months ago

I'm suggest to produce test example as .cx or .cc extension to see it's VSC problem or not.

github-actions[bot] commented 5 months ago

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

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

ManPython commented 5 months ago

Problem still exist with v1.20.4 (pre-release) and v1.20.5

Version: 1.89.1
Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685
Date: 2024-05-07T05:13:33.891Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Windows_NT x64 10.0.22631
github-actions[bot] commented 4 months ago

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

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

ManPython commented 4 months ago

But any changes around?

github-actions[bot] commented 3 months ago

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

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

ManPython commented 3 months ago

Not resolved.

ManPython commented 3 months ago

https://github.com/Microsoft/vscode/issues/61933

github-actions[bot] commented 2 months ago

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

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

github-actions[bot] commented 1 month ago

This issue has been closed because it needs more information and has not had recent activity.

ManPython commented 1 month ago

It's time to go for Rust!

sean-mcmanus commented 1 month ago

@ManPython Sorry, we're not able to reproduce the issue you are seeing and we're not sure what could be causing it.