microsoft / vscode-cpptools

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

Error squiggle count is displayed in debug output but no red underlines are displayed in the editor #5617

Open NotKevinOu opened 4 years ago

NotKevinOu commented 4 years ago

Type: LanguageService

Describe the bug

Description Red squiggle underlines do not appear in the editor under errors despite showing a non-zero "Error squiggle count" in the debug output. A red squiggle shows only for invalid #include statements.

Some of my settings that might be related: C_Cpp.default.enableConfigurationSquiggles: true C_Cpp.errorSquiggles: Enabled C_Cpp.intelliSenseEngine: Default C_Cpp.intelliSenseEngineFallback: Disabled

For example attached is an image where I would expect some red squiggles to be displayed. An "Error squiggle count: 2" is displayed but I cannot see the visible underling. Attached is also a copy of the debug output. image

cpptools/didChangeCppProperties
Attempting to get defaults from compiler found on the machine: 'C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe'
Code browsing service initialized
Attempting to get defaults from compiler found on the machine: 'C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe'
  Folder: C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO/2017/COMMUNITY/VC/TOOLS/MSVC/14.16.27023/INCLUDE/* will be indexed
  Folder: C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO/2017/COMMUNITY/VC/TOOLS/MSVC/14.16.27023/ATLMFC/INCLUDE/* will be indexed
  Folder: C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.17763.0/UM/ will be indexed
  Folder: C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.17763.0/UCRT/ will be indexed
  Folder: C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.17763.0/SHARED/ will be indexed
  Folder: C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.17763.0/WINRT/ will be indexed
  Folder: C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.17763.0/CPPWINRT/ will be indexed
textDocument/didOpen: file:///c%3A/Users/kevin/Downloads/test.cpp
Populate include completion cache.
cpptools/activeDocumentChange: file:///c%3A/Users/kevin/Downloads/test.cpp
Discovering files...
cpptools/textEditorSelectionChange
cpptools/getDocumentSymbols: file:///c%3A/Users/kevin/Downloads/test.cpp (id: 2)
cpptools/getCodeActions: file:///c%3A/Users/kevin/Downloads/test.cpp (id: 3)
cpptools/getDocumentSymbols
sending compilation args for C:\USERS\KEVIN\DOWNLOADS\TEST.CPP
  include: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\COMMUNITY\VC\TOOLS\MSVC\14.16.27023\INCLUDE
  include: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\COMMUNITY\VC\TOOLS\MSVC\14.16.27023\ATLMFC\INCLUDE
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.17763.0\UM
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.17763.0\UCRT
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.17763.0\SHARED
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.17763.0\WINRT
  include: C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.17763.0\CPPWINRT
  define: _DEBUG
  define: UNICODE
  define: _UNICODE
  stdver: ms_c++17
  intelliSenseMode: msvc-x64
  Processing folder (non-recursive): C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO/2017/COMMUNITY/VC/TOOLS/MSVC/14.16.27023/INCLUDE
  Processing folder (non-recursive): C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO/2017/COMMUNITY/VC/TOOLS/MSVC/14.16.27023/ATLMFC/INCLUDE
  Processing folder (recursive): C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.17763.0/UM/
Checking for syntax errors: file:///c%3A/Users/kevin/Downloads/test.cpp
Queueing IntelliSense update for files in translation unit of: C:\USERS\KEVIN\DOWNLOADS\TEST.CPP
  Processing folder (recursive): C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.17763.0/UCRT/
  Processing folder (recursive): C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.17763.0/SHARED/
  Processing folder (recursive): C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.17763.0/WINRT/
  Processing folder (recursive): C:/PROGRAM FILES (X86)/WINDOWS KITS/10/INCLUDE/10.0.17763.0/CPPWINRT/
  Discovering files: 4739 file(s) processed
  0 file(s) removed from database
Done discovering files.
Parsing remaining files...
  Parsing: 0 files(s) processed
Done parsing remaining files.
idle loop: reparsing the active document
cpptools/getFoldingRanges: file:///c%3A/Users/kevin/Downloads/test.cpp (id: 4)
Checking for syntax errors: file:///c%3A/Users/kevin/Downloads/test.cpp
Queueing IntelliSense update for files in translation unit of: C:\USERS\KEVIN\DOWNLOADS\TEST.CPP
cpptools/finishUpdateSquiggles
Error squiggle count: 2
Update IntelliSense time (sec): 0.509

However I do see the red underlining if there is an error with an #include statement. I also see red underlining in other languages if there is an error (such as incorrect syntax in the settings.json file).

image

Sorry if this is a trivial issue and does not belong here. I've tried to looking through other issues and couldn't remedy this myself. I've also tried uninstalling and reinstalling VS Code, as well as uninstalling and reinstalling the C++ extension.

sean-mcmanus commented 4 years ago

Error squiggles are currently disabled in "single file mode" (intentionally). It will work if you open folder, and then open the file. It's a one line change for us to re-enable the setting, but if we do that then maybe we'd want a setting to opt-in to single-file errors.

It would also be good to output better logging to explain this so users aren't confused as to why no error squiggles are appearing.