vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

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

Open ManPython opened this issue 1 year ago • 28 comments

Environment

  • OS and Version:
  • VS Code Version:
  • C/C++ Extension Version:
  • If using SSH remote, specify OS of remote machine:

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

ManPython avatar Apr 09 '24 18:04 ManPython

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

browntarik avatar Apr 09 '24 19:04 browntarik

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

ManPython avatar Apr 09 '24 19:04 ManPython

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)?

browntarik avatar Apr 09 '24 19:04 browntarik

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

ManPython avatar Apr 09 '24 19:04 ManPython

@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.

sean-mcmanus avatar Apr 10 '24 01:04 sean-mcmanus

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

ManPython avatar Apr 10 '24 15:04 ManPython

@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.

sean-mcmanus avatar Apr 10 '24 21:04 sean-mcmanus

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

browse vc db

ManPython avatar Apr 11 '24 13:04 ManPython

@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.

sean-mcmanus avatar Apr 11 '24 19:04 sean-mcmanus

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.

ManPython avatar Apr 12 '24 09:04 ManPython

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

image

sean-mcmanus avatar Apr 12 '24 19:04 sean-mcmanus

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.

ManPython avatar Apr 12 '24 20:04 ManPython

@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.

sean-mcmanus avatar Apr 12 '24 20:04 sean-mcmanus

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

ManPython avatar Apr 12 '24 20:04 ManPython

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

sean-mcmanus avatar Apr 12 '24 21:04 sean-mcmanus

Not sure about x64 vsix, Windows x64.

ManPython avatar Apr 12 '24 21:04 ManPython

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.

sean-mcmanus avatar Apr 12 '24 22:04 sean-mcmanus

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

ManPython avatar Apr 12 '24 22:04 ManPython

@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).

sean-mcmanus avatar Apr 13 '24 00:04 sean-mcmanus

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

ManPython avatar Apr 13 '24 10:04 ManPython

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] avatar May 14 '24 11:05 github-actions[bot]

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

ManPython avatar May 14 '24 14:05 ManPython

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] avatar Jun 14 '24 11:06 github-actions[bot]

But any changes around?

ManPython avatar Jun 14 '24 21:06 ManPython

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] avatar Jul 15 '24 11:07 github-actions[bot]

Not resolved.

ManPython avatar Jul 15 '24 14:07 ManPython

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

ManPython avatar Jul 16 '24 17:07 ManPython

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] avatar Aug 16 '24 11:08 github-actions[bot]

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

github-actions[bot] avatar Sep 17 '24 11:09 github-actions[bot]

It's time to go for Rust!

ManPython avatar Sep 17 '24 14:09 ManPython