Closed mmlacak closed 2 years ago
Hi @mmlacak . Thank you for reporting this. We appear to have a bug preventing semantic highlighting in a source file from being updated when a header in the same translation unit is changed.
The underlying cause appears to be related to internal use of uri's that are equivalent but not perfect string matches.
@Colengms But the user is using Linux -- this isn't related to the Windows drive case capitalization, right?
You're right, that's another issue. I can also repro this one. :)
Something similar also repro's in VS. Though, instead of clearing the semantic tokens, it simply does not update semantic tokens for the other file until a 'full parse' occurs. So, it may be by-design that the other file is not updated, despite being visible. We could at lease prevent them from being cleared, as stale tokens would appear valid in a majority of scenarios.
I believe this was addressed in 1.9.1. Closing as fixed.
Bug type: Language Service
Describe the bug
Steps to reproduce
Works the other way around, if H file is edited and saved, then C file editor switches to default coloring (as if without C/C++ extension).
Expected behavior
All C and H files retain their new syntax highlight at all times, regardless of any editing, saving, ...
Code sample and logs
Code sample Works with any correct (parseable) C, H files.
Configurations in
c_cpp_properties.json
Logs from running
C/C++: Log Diagnostics
from the VS Code command palette------- Workspace parsing diagnostics ------- Number of files discovered (not excluded): 7467 Number of files parsed: 589
loggingLevel: Debug loggingLevel has changed to: Debug cpptools/didChangeCppProperties $/setTraceNotification cpptools/getCodeActions: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c (id: 82) cpptools/textEditorSelectionChange cpptools/activeDocumentChange: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c cpptools/getFoldingRanges: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c (id: 83) textDocument/hover: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c (id: 84) textDocument/hover: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c (id: 85) textDocument/hover: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c (id: 86) textDocument/didChange: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c cpptools/textEditorSelectionChange cpptools/getFoldingRanges: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c (id: 87) cpptools/getSemanticTokens: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c (id: 88) cpptools/getDocumentSymbols: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c (id: 89) cpptools/getDocumentSymbols Checking for syntax errors: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c Queueing IntelliSense update for files in translation unit of: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c tag parsing file: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c sending 1 changes to server cpptools/finishUpdateSquiggles Error squiggle count: 0 Error squiggle count: 0 Update IntelliSense time (sec): 2.355 cpptools/getSemanticTokens: /home/pero/src/crochess/ws/libcrochess/inc/cc_ply.h (id: 90) cpptools/getFoldingRanges: /home/pero/src/crochess/ws/libcrochess/inc/cc_ply.h (id: 91) cpptools/getFoldingRanges: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c (id: 92) textDocument/didChange: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c cpptools/textEditorSelectionChange willSaveWaitUntil: 0ms textDocument/didSave: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c tag parsing file: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c cpptools/fileChanged: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c cpptools/getFoldingRanges: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c (id: 94) idle loop: reparsing the active document Checking for syntax errors: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c Queueing IntelliSense update for files in translation unit of: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c cpptools/getSemanticTokens: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c (id: 95) sending 1 changes to server cpptools/finishUpdateSquiggles Error squiggle count: 0 Error squiggle count: 0 cpptools/getSemanticTokens: /home/pero/src/crochess/ws/libcrochess/inc/cc_ply.h (id: 96) cpptools/getFoldingRanges: /home/pero/src/crochess/ws/libcrochess/inc/cc_ply.h (id: 97) cpptools/getFoldingRanges: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c (id: 98) cpptools/getDocumentSymbols: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c (id: 99) cpptools/getDocumentSymbols Checking for syntax errors: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c Queueing IntelliSense update for files in translation unit of: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c cpptools/finishUpdateSquiggles Error squiggle count: 0 Error squiggle count: 0 Update IntelliSense time (sec): 2.259 cpptools/getSemanticTokens: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c (id: 100) cpptools/getSemanticTokens: /home/pero/src/crochess/ws/libcrochess/inc/cc_ply.h (id: 101) cpptools/getFoldingRanges: /home/pero/src/crochess/ws/libcrochess/inc/cc_ply.h (id: 102) cpptools/getFoldingRanges: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c (id: 103) textDocument/hover: /home/pero/src/crochess/ws/libcrochess/inc/cc_ply.h (id: 104) textDocument/hover: /home/pero/src/crochess/ws/libcrochess/inc/cc_ply.h (id: 105) cpptools/textEditorSelectionChange cpptools/activeDocumentChange: /home/pero/src/crochess/ws/libcrochess/inc/cc_ply.h idle loop: reparsing the active document Checking for syntax errors: /home/pero/src/crochess/ws/libcrochess/inc/cc_ply.h Queueing IntelliSense update for files in translation unit of: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c cpptools/finishUpdateSquiggles Error squiggle count: 0 Error squiggle count: 0 Update IntelliSense time (sec): 0.257 cpptools/getSemanticTokens: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c (id: 106) cpptools/getSemanticTokens: /home/pero/src/crochess/ws/libcrochess/inc/cc_ply.h (id: 107) cpptools/getFoldingRanges: /home/pero/src/crochess/ws/libcrochess/inc/cc_ply.h (id: 108) cpptools/getFoldingRanges: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c (id: 109) textDocument/hover: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c (id: 110) cpptools/textEditorSelectionChange cpptools/textEditorSelectionChange cpptools/activeDocumentChange: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c idle loop: reparsing the active document Checking for syntax errors: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c Queueing IntelliSense update for files in translation unit of: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c cpptools/finishUpdateSquiggles Error squiggle count: 0 Error squiggle count: 0 Update IntelliSense time (sec): 0.257 cpptools/getSemanticTokens: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c (id: 111) cpptools/getSemanticTokens: /home/pero/src/crochess/ws/libcrochess/inc/cc_ply.h (id: 112) cpptools/getFoldingRanges: /home/pero/src/crochess/ws/libcrochess/inc/cc_ply.h (id: 113) cpptools/getFoldingRanges: /home/pero/src/crochess/ws/libcrochess/src/cc_ply.c (id: 114)