microsoft / vscode-cpptools

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

undefined var error un-detected while wrong .h included #7027

Closed Shaka0723 closed 3 years ago

Shaka0723 commented 3 years ago

-- env version: vscode ver: 1.53.2 cpptools ver: 1.2.2 bug found on above version of cpptools-----however, bug occurs in all version of cpptools & vscode I have installed in my computer

-- bug description: A) if I include a wrong header file, cpptools seems to not report any other errors, undefined var used, e.g. pls see below picture. B) and sometimes, eventhough all #include is right, this bug occurs.

is this a real bug? or do I not get the right config for cpptools?

pic prjA bug vscode cpptools bug-1

pic prjB bug image

image image image

Shaka0723 commented 3 years ago

I asked one of my friend, bug B occurs in his computer. we are both c coder.

michelleangela commented 3 years ago

@Shaka0723 It could be that the c_cpp_properties.json is not configured to include the correct header files. Could you run the command C/C++: Log Diagnostics from the VS Code command palette? This will print out a log of which include paths are sent to the language server.

Shaka0723 commented 3 years ago

@Shaka0723 It could be that the c_cpp_properties.json is not configured to include the correct header files. Could you run the command C/C++: Log Diagnostics from the VS Code command palette? This will print out a log of which include paths are sent to the language server.

there are 4 points below, pls scroll to buttom to get point 3 and 4

1)Diagnostics Result as below

-------- Diagnostics - 2021/2/25 上午11:02:53 Version: 1.2.2-insiders2 Current Configuration: { "name": "Win32", "includePath": [ "${workspaceFolder}/", "C:\Program Files\CodeBlocks\MinGW\x86_64-w64-mingw32\include\" ], "defines": [], "compilerPath": "C:\Program Files\CodeBlocks\MinGW\bin\gcc.exe", "cStandard": "gnu99", "cppStandard": "c++11", "intelliSenseMode": "gcc-arm", "compilerArgs": [], "intelliSenseModeIsExplicit": true, "cStandardIsExplicit": true, "cppStandardIsExplicit": true, "compilerPathIsExplicit": true, "browse": { "path": [ "${workspaceFolder}/", "C:\Program Files\CodeBlocks\MinGW\x86_64-w64-mingw32\include\" ], "limitSymbolsToIncludedHeaders": true } } Translation Unit Mappings: [ E:\WPS\SmartPova\01-Story\code\c\1\src\main.c ]: E:\WPS\SMARTPOVA\01-STORY\CODE\C\1\SRC\MAIN.C Translation Unit Configurations: [ E:\WPS\SmartPova\01-Story\code\c\1\src\main.c ]: Process ID: 14964 Memory Usage: 15 MB Compiler Path: C:\Program Files\CodeBlocks\MinGW\bin\gcc.exe Includes: C:\PROGRAM FILES\CODEBLOCKS\MINGW\LIB\GCC\X86_64-W64-MINGW32\8.1.0\INCLUDE C:\PROGRAM FILES\CODEBLOCKS\MINGW\LIB\GCC\X86_64-W64-MINGW32\8.1.0\INCLUDE-FIXED C:\PROGRAM FILES\CODEBLOCKS\MINGW\X86_64-W64-MINGW32\INCLUDE Standard Version: c99 IntelliSense Mode: windows-gcc-arm Other Flags: --gcc --gnu_version=80100 Total Memory Usage: 15 MB

------- Workspace parsing diagnostics ------- Number of folders and files enumerated: 2443 Number of files discovered (not excluded): 2384

2) extension LOG

sometimes I found cpptools extension doesn't start acc.to below log print sometimes cpptools extension starts but didn't work (can't detect mistakes in grammar )

[2021-02-25 11:00:47.675] [exthost] [info] extension host started [2021-02-25 11:00:47.754] [exthost] [info] ExtensionService#_doActivateExtension vscode.microsoft-authentication {"startup":false,"extensionId":{"value":"vscode.microsoft-authentication","_lower":"vscode.microsoft-authentication"},"activationEvent":"onAuthenticationRequest:microsoft"} [2021-02-25 11:00:47.754] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/microsoft-authentication/dist/extension.js [2021-02-25 11:00:47.760] [exthost] [info] ExtensionService#_doActivateExtension aaron-bond.better-comments {"startup":false,"extensionId":{"value":"aaron-bond.better-comments","_lower":"aaron-bond.better-comments"},"activationEvent":"onLanguage:plaintext"} [2021-02-25 11:00:47.760] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/aaron-bond.better-comments-2.1.0/out/extension [2021-02-25 11:00:47.764] [exthost] [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch {"startup":true,"extensionId":{"value":"vscode.debug-auto-launch","_lower":"vscode.debug-auto-launch"},"activationEvent":""} [2021-02-25 11:00:47.764] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/debug-auto-launch/dist/extension [2021-02-25 11:00:47.767] [exthost] [info] ExtensionService#_doActivateExtension vscode.git {"startup":true,"extensionId":{"value":"vscode.github","_lower":"vscode.github"},"activationEvent":""} [2021-02-25 11:00:47.767] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/git/dist/main [2021-02-25 11:00:47.802] [exthost] [info] ExtensionService#_doActivateExtension 2gua.rainbow-brackets {"startup":true,"extensionId":{"value":"2gua.rainbow-brackets","_lower":"2gua.rainbow-brackets"},"activationEvent":""} [2021-02-25 11:00:47.802] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/2gua.rainbow-brackets-0.0.6/out/src/extension [2021-02-25 11:00:47.804] [exthost] [info] ExtensionService#_doActivateExtension alefragnani.project-manager {"startup":true,"extensionId":{"value":"alefragnani.project-manager","_lower":"alefragnani.project-manager"},"activationEvent":""} [2021-02-25 11:00:47.804] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/alefragnani.project-manager-12.0.1/dist/extension [2021-02-25 11:00:47.808] [exthost] [info] ExtensionService#_doActivateExtension bukas.GBKtoUTF8 {"startup":true,"extensionId":{"value":"bukas.GBKtoUTF8","_lower":"bukas.gbktoutf8"},"activationEvent":""} [2021-02-25 11:00:47.808] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/bukas.gbktoutf8-0.0.2/out/src/extension [2021-02-25 11:00:47.815] [exthost] [info] ExtensionService#_doActivateExtension christian-kohler.path-intellisense {"startup":true,"extensionId":{"value":"christian-kohler.path-intellisense","_lower":"christian-kohler.path-intellisense"},"activationEvent":""} [2021-02-25 11:00:47.815] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/christian-kohler.path-intellisense-2.3.0/out/extension.js [2021-02-25 11:00:47.839] [exthost] [info] ExtensionService#_doActivateExtension cl.keil-assistant {"startup":true,"extensionId":{"value":"cl.keil-assistant","_lower":"cl.keil-assistant"},"activationEvent":""} [2021-02-25 11:00:47.839] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/cl.keil-assistant-1.7.0/dist/extension.js [2021-02-25 11:00:47.878] [exthost] [info] ExtensionService#_doActivateExtension cliffordfajardo.highlight-line-vscode {"startup":true,"extensionId":{"value":"cliffordfajardo.highlight-line-vscode","_lower":"cliffordfajardo.highlight-line-vscode"},"activationEvent":""} [2021-02-25 11:00:47.879] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/cliffordfajardo.highlight-line-vscode-0.0.1/out/extension [2021-02-25 11:00:47.880] [exthost] [info] ExtensionService#_doActivateExtension cliffordfajardo.hightlight-selections-vscode {"startup":true,"extensionId":{"value":"cliffordfajardo.hightlight-selections-vscode","_lower":"cliffordfajardo.hightlight-selections-vscode"},"activationEvent":""} [2021-02-25 11:00:47.880] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/cliffordfajardo.hightlight-selections-vscode-0.0.1/out/extension [2021-02-25 11:00:47.884] [exthost] [info] ExtensionService#_doActivateExtension cssho.vscode-svgviewer {"startup":true,"extensionId":{"value":"cssho.vscode-svgviewer","_lower":"cssho.vscode-svgviewer"},"activationEvent":""} [2021-02-25 11:00:47.884] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/cssho.vscode-svgviewer-2.0.0/out/src/extension [2021-02-25 11:00:47.925] [exthost] [info] ExtensionService#_doActivateExtension eppz.eppz-code {"startup":true,"extensionId":{"value":"eppz.eppz-code","_lower":"eppz.eppz-code"},"activationEvent":""} [2021-02-25 11:00:47.925] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/eppz.eppz-code-1.2.52/out/src/main [2021-02-25 11:00:48.134] [exthost] [info] ExtensionService#_doActivateExtension iceliu.highlight-icemode {"startup":true,"extensionId":{"value":"iceliu.highlight-icemode","_lower":"iceliu.highlight-icemode"},"activationEvent":""} [2021-02-25 11:00:48.134] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/iceliu.highlight-icemode-0.0.6/extension [2021-02-25 11:00:48.135] [exthost] [info] ExtensionService#_doActivateExtension IgorSbitnev.error-gutters {"startup":true,"extensionId":{"value":"IgorSbitnev.error-gutters","_lower":"igorsbitnev.error-gutters"},"activationEvent":""} [2021-02-25 11:00:48.135] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/igorsbitnev.error-gutters-1.0.1/extension [2021-02-25 11:00:48.137] [exthost] [info] ExtensionService#_doActivateExtension in4margaret.compareit {"startup":true,"extensionId":{"value":"in4margaret.compareit","_lower":"in4margaret.compareit"},"activationEvent":""} [2021-02-25 11:00:48.137] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/in4margaret.compareit-0.0.2/out/extension [2021-02-25 11:00:48.174] [exthost] [info] ExtensionService#_doActivateExtension intellsmi.comment-translate {"startup":true,"extensionId":{"value":"intellsmi.comment-translate","_lower":"intellsmi.comment-translate"},"activationEvent":""} [2021-02-25 11:00:48.174] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/intellsmi.comment-translate-1.4.2/client/out/extension [2021-02-25 11:00:48.212] [exthost] [info] ExtensionService#_doActivateExtension jock.svg {"startup":true,"extensionId":{"value":"jock.svg","_lower":"jock.svg"},"activationEvent":""} [2021-02-25 11:00:48.212] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/jock.svg-1.4.5/client/out/extension.js [2021-02-25 11:00:48.255] [exthost] [info] ExtensionService#_doActivateExtension karyfoundation.comment {"startup":true,"extensionId":{"value":"karyfoundation.comment","_lower":"karyfoundation.comment"},"activationEvent":""} [2021-02-25 11:00:48.255] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/karyfoundation.comment-7.0.3/comment [2021-02-25 11:00:48.257] [exthost] [info] ExtensionService#_doActivateExtension kruemelkatze.vscode-dashboard {"startup":true,"extensionId":{"value":"kruemelkatze.vscode-dashboard","_lower":"kruemelkatze.vscode-dashboard"},"activationEvent":""} [2021-02-25 11:00:48.257] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/kruemelkatze.vscode-dashboard-2.3.1/dist/dashboard [2021-02-25 11:00:48.267] [exthost] [info] ExtensionService#_doActivateExtension lyzerk.linecounter {"startup":true,"extensionId":{"value":"lyzerk.linecounter","_lower":"lyzerk.linecounter"},"activationEvent":""} [2021-02-25 11:00:48.267] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/lyzerk.linecounter-0.2.7/out/src/extension [2021-02-25 11:00:48.271] [exthost] [info] ExtensionService#_doActivateExtension OBKoro1.korofileheader {"startup":true,"extensionId":{"value":"OBKoro1.korofileheader","_lower":"obkoro1.korofileheader"},"activationEvent":""} [2021-02-25 11:00:48.271] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/obkoro1.korofileheader-4.8.2/src/main.js [2021-02-25 11:00:48.300] [exthost] [info] ExtensionService#_doActivateExtension slevesque.vscode-hexdump {"startup":true,"extensionId":{"value":"slevesque.vscode-hexdump","_lower":"slevesque.vscode-hexdump"},"activationEvent":""} [2021-02-25 11:00:48.300] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/slevesque.vscode-hexdump-1.8.1/out/src/extension [2021-02-25 11:00:48.355] [exthost] [info] ExtensionService#_doActivateExtension TabNine.tabnine-vscode {"startup":true,"extensionId":{"value":"TabNine.tabnine-vscode","_lower":"tabnine.tabnine-vscode"},"activationEvent":""} [2021-02-25 11:00:48.355] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/tabnine.tabnine-vscode-3.2.8/out/extension [2021-02-25 11:00:48.475] [exthost] [info] ExtensionService#_doActivateExtension vscode-icons-team.vscode-icons {"startup":true,"extensionId":{"value":"vscode-icons-team.vscode-icons","_lower":"vscode-icons-team.vscode-icons"},"activationEvent":""} [2021-02-25 11:00:48.475] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/vscode-icons-team.vscode-icons-11.1.0/dist/src/vscode-icons.bundle.js [2021-02-25 11:00:48.487] [exthost] [info] ExtensionService#_doActivateExtension yycalm.linecount {"startup":true,"extensionId":{"value":"yycalm.linecount","_lower":"yycalm.linecount"},"activationEvent":""} [2021-02-25 11:00:48.487] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/yycalm.linecount-0.1.7/out/src/extension [2021-02-25 11:00:48.490] [exthost] [info] ExtensionService#_doActivateExtension zhuangtongfa.material-theme {"startup":true,"extensionId":{"value":"zhuangtongfa.material-theme","_lower":"zhuangtongfa.material-theme"},"activationEvent":""} [2021-02-25 11:00:48.490] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/zhuangtongfa.material-theme-3.9.15/out/extension.js [2021-02-25 11:00:48.585] [exthost] [error] Activating extension yycalm.linecount failed due to an error: [2021-02-25 11:00:48.586] [exthost] [error] Error: command 'extension.linecount.currentfile' already exists at b.registerCommand (c:\Users\Administrator\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:86:87254) at Object.registerCommand (c:\Users\Administrator\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:94:21021) at activate (c:\Users\Administrator.vscode\extensions\yycalm.linecount-0.1.7\out\src\extension.js:20:39) at Function._callActivateOptional (c:\Users\Administrator\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:90:13728) at Function._callActivate (c:\Users\Administrator\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:90:13405) at c:\Users\Administrator\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:90:11743 at processTicksAndRejections (internal/process/task_queues.js:97:5) at async Promise.all (index 23) at async Promise.all (index 0) [2021-02-25 11:00:48.792] [exthost] [info] ExtensionService#_doActivateExtension vscode.configuration-editing {"startup":false,"extensionId":{"value":"vscode.configuration-editing","_lower":"vscode.configuration-editing"},"activationEvent":"onLanguage:jsonc"} [2021-02-25 11:00:48.792] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/configuration-editing/dist/configurationEditingMain [2021-02-25 11:00:48.797] [exthost] [info] ExtensionService#_doActivateExtension vscode.json-language-features {"startup":false,"extensionId":{"value":"vscode.json-language-features","_lower":"vscode.json-language-features"},"activationEvent":"onLanguage:jsonc"} [2021-02-25 11:00:48.797] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/json-language-features/client/dist/node/jsonClientMain [2021-02-25 11:00:48.826] [exthost] [info] ExtensionService#_doActivateExtension vscode.typescript-language-features {"startup":false,"extensionId":{"value":"vscode.typescript-language-features","_lower":"vscode.typescript-language-features"},"activationEvent":"onLanguage:jsonc"} [2021-02-25 11:00:48.826] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/typescript-language-features/dist/extension [2021-02-25 11:00:48.860] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode.js-debug {"startup":false,"extensionId":{"value":"ms-vscode.js-debug","_lower":"ms-vscode.js-debug"},"activationEvent":"onCommand:extension.js-debug.clearAutoAttachVariables"} [2021-02-25 11:00:48.860] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/ms-vscode.js-debug/src/extension.js [2021-02-25 11:00:48.989] [exthost] [info] ExtensionService#_doActivateExtension vscode.github {"startup":false,"extensionId":{"value":"vscode.github","_lower":"vscode.github"},"activationEvent":""} [2021-02-25 11:00:48.989] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/github/dist/extension.js [2021-02-25 11:00:49.042] [exthost] [info] ExtensionService#_doActivateExtension vscode.github-authentication {"startup":false,"extensionId":{"value":"vscode.github-authentication","_lower":"vscode.github-authentication"},"activationEvent":"onAuthenticationRequest:github"} [2021-02-25 11:00:49.042] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/github-authentication/dist/extension.js [2021-02-25 11:00:49.486] [exthost] [info] eager extensions activated [2021-02-25 11:00:49.488] [exthost] [info] ExtensionService#_doActivateExtension vscode.emmet {"startup":false,"extensionId":{"value":"vscode.emmet","_lower":"vscode.emmet"},"activationEvent":"onStartupFinished"} [2021-02-25 11:00:49.488] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/emmet/dist/node/emmetNodeMain [2021-02-25 11:00:49.492] [exthost] [info] ExtensionService#_doActivateExtension vscode.merge-conflict {"startup":false,"extensionId":{"value":"vscode.merge-conflict","_lower":"vscode.merge-conflict"},"activationEvent":"onStartupFinished"} [2021-02-25 11:00:49.492] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/merge-conflict/dist/mergeConflictMain [2021-02-25 11:00:49.495] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-wsl-recommender {"startup":false,"extensionId":{"value":"ms-vscode-remote.remote-wsl-recommender","_lower":"ms-vscode-remote.remote-wsl-recommender"},"activationEvent":"onStartupFinished"} [2021-02-25 11:00:49.495] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/ms-vscode-remote.remote-wsl-recommender/dist/extension.js [2021-02-25 11:00:49.501] [exthost] [info] ExtensionService#_doActivateExtension vscode.testing-editor-contributions {"startup":false,"extensionId":{"value":"vscode.testing-editor-contributions","_lower":"vscode.testing-editor-contributions"},"activationEvent":"onStartupFinished"} [2021-02-25 11:00:49.501] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/testing-editor-contributions/dist/extension.js [2021-02-25 11:00:49.503] [exthost] [info] ExtensionService#_doActivateExtension alefragnani.Bookmarks {"startup":false,"extensionId":{"value":"alefragnani.Bookmarks","_lower":"alefragnani.bookmarks"},"activationEvent":"onStartupFinished"} [2021-02-25 11:00:49.503] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/alefragnani.bookmarks-13.0.1/dist/extension [2021-02-25 11:00:49.507] [exthost] [info] ExtensionService#_doActivateExtension eamodio.gitlens {"startup":false,"extensionId":{"value":"eamodio.gitlens","_lower":"eamodio.gitlens"},"activationEvent":"onStartupFinished"} [2021-02-25 11:00:49.507] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/eamodio.gitlens-11.2.1/dist/gitlens [2021-02-25 11:00:49.529] [exthost] [info] ExtensionService#_doActivateExtension formulahendry.code-runner {"startup":false,"extensionId":{"value":"formulahendry.code-runner","_lower":"formulahendry.code-runner"},"activationEvent":"onStartupFinished"} [2021-02-25 11:00:49.530] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/formulahendry.code-runner-0.11.2/out/src/extension [2021-02-25 11:00:49.570] [exthost] [info] ExtensionService#_doActivateExtension semyon-ivanov.cortex-builder {"startup":false,"extensionId":{"value":"semyon-ivanov.cortex-builder","_lower":"semyon-ivanov.cortex-builder"},"activationEvent":"onStartupFinished"} [2021-02-25 11:00:49.571] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/semyon-ivanov.cortex-builder-1.0.5/out/extension.js [2021-02-25 11:00:49.592] [exthost] [info] ExtensionService#_doActivateExtension usernamehw.errorlens {"startup":false,"extensionId":{"value":"usernamehw.errorlens","_lower":"usernamehw.errorlens"},"activationEvent":"onStartupFinished"} [2021-02-25 11:00:49.592] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/Administrator/.vscode/extensions/usernamehw.errorlens-3.2.4/dist/extension [2021-02-25 11:00:50.144] [exthost] [info] extension host terminating: received terminate message from renderer [2021-02-25 11:00:51.774] [exthost] [info] exiting with code 0

3) bug occurs, even though there is only one main.c in project )

so I don't think is the c_cpp_properties.json wrong configuration resulting the "bug". image image

4) I installed a extension named Project Dashboard.

(https://github.com/microsoft/vscode-cpptools/issues/7027) and add some projects links on this dashboard. when I open the project by clicking the dashboard, cpptools works!!!! With No bugs!!! image

michelleangela commented 3 years ago

@Shaka0723 If the extension cannot locate a header file because either the header file does not exist or its include path is not specified in c_cpp_properties.json, then the extension will disable error squiggles. This is by design. See example below for expected error when include a header file that the extension cannot find. image If the extension can't locate and include code from headers file, then it won't be able to properly evaluate a source file (or translation unit) because it could be missing code from some unlocated header file, therefore error squiggles are disabled for that translation unit.

Is the header file "stdin0t.h" supposed to be under some path or is it a non-existent file that you're trying to test out to see if it will disable error squiggles?

Shaka0723 commented 3 years ago

Thanks!

Is the header file "stdin0t.h" supposed to be under some path or is it a non-existent file that you're trying to test out to see if it will disable error --yes, just a test

1.You mean, in these 2 situations error Squiggles would be disabled?

1).include a wrong head file (wrong head file name, or not included in the include path defined in c_cpp_properties.json) 2).not include any head files.

--I don't think this is a good design, because the error squiggle does't give any error hint even I lost a ";" at the end of line.

2.I tried adding #include and configing a right include path in c_cpp_properties.json

and then open the project normally(in windows explorer, project folder -> right click ->open by vscode) the error squiggle didn't work. image I am sure that the code can run sucessfully if commenting the line 4 (aa+b=c; )

3.did you see my point 4 in my last comment?

why error squiggles works when I start the c project by the vscode extension "Project Dashboard", But error squiggles failed when I start the same project by opening it in windows explorer?

michelleangela commented 3 years ago

1.You mean, in these 2 situations error Squiggles would be disabled? 1).include a wrong head file (wrong head file name, or not included in the include path defined in c_cpp_properties.json) 2).not include any head files.

--I don't think this is a good design, because the error squiggle does't give any error hint even I lost a ";" at the end of line.

If there are #include errors, then it could result in a lot of error squiggles in a file. This is why the design was to disable all of error squiggles when there are #include errors.

However I see do you have the setting C_Cpp.errorSquiggles set to "enabled", so it should show error squiggles when #include paths are not resolved. Note that the setting C_Cpp.errorSquiggles is ignored when the Tag Parser engine is being used.

If you set C_Cpp.intelliSenseEngineFallback to "enabled", then the Tag Parser engine will be enabled and ignores the setting C_Cpp.errorSquiggles. Could you try setting C_Cpp.intelliSenseEngineFallback to "disabled" and see if that will show error squiggles even when #include paths are not resolved?

You can set the setting C_Cpp.loggingLevel to "debug" to see in the logs of "C/C++" output window if "Tag Parser" is being used or not.

Here's an example with IntelliSense Engine falling back to "Tag Parser" because there are #include errors, and it doesn't show error squiggles because "Tag Parser" does not have context awareness. image

Here's an example with IntelliSense Engine not falling back to "Tag Parser" when there are #include errors, and with C_Cpp.errorSquiggles set to "enabled". image

3.did you see my point 4 in my last comment? why error squiggles works when I start the c project by the vscode extension "Project Dashboard", But error squiggles failed when I start the same project by opening it in windows explorer?

I wonder if "Project Dashboard" has a different scope for settings than from opening a folder via Windows Explorer or VS Code's "open folder"?

I tried to use "Project Dashboard" and I could still get error squiggles either from regular opening a folder or from "Project Dashboard" as long as C_Cpp.intelliSenseEngineFallback is "disabled" and C_Cpp.errorSquiggles is "enabled".

Also, I'm not sure why the C++ extension would sometimes not activate as shown from your extension logs. Are there settings or extensions that could be disabling it?

github-actions[bot] commented 3 years ago

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