eclipse-cdt / cdt-lsp

Eclipse CDT™ LSP Extensions for CDT
Eclipse Public License 2.0
26 stars 11 forks source link

Blank editor after format #239

Closed ghentschke closed 8 months ago

ghentschke commented 8 months ago

When inserting a new #include in the LSP based C/C++ Editor and saving this file, the editor can become blank, if the format-on-save option is enabled: image

Steps to reproduce: There must be at least one local and one system header include. E.g.:

#include "config.h"
#include <iostream>

Insert a local header: #include "..." after the system header: #include <...> (in <>):

#include "config.h"
#include <iostream>
#include "Cmk1.hpp"

and save the file with format-on-save (Format source code) enabled. (see Preferences -> C/C++ -> Editor (LSP) -> SaveActions -> Format source code).

Stack trace:

I[12:33:30.727] --> textDocument/publishDiagnostics
I[12:33:30.737] <-- textDocument/documentSymbol("261")
I[12:33:30.738] --> reply:textDocument/documentSymbol("261") 0 ms
I[12:33:30.738] <-- textDocument/semanticTokens/full("262")
I[12:33:30.738] --> reply:textDocument/semanticTokens/full("262") 0 ms
I[12:33:30.739] <-- textDocument/documentHighlight("263")
I[12:33:30.739] --> reply:textDocument/documentHighlight("263") 0 ms
I[12:33:30.739] <-- textDocument/inlayHint("264")
I[12:33:30.740] --> reply:textDocument/inlayHint("264") 0 ms
I[12:33:30.804] <-- textDocument/didChange
I[12:33:30.811] <-- textDocument/completion("265")
I[12:33:30.822] Code complete: sema context IncludedFile, query scopes [] (AnyScope=true), expected type <none>
I[12:33:30.823] Code complete: 172 results from Sema, 0 from Index, 0 matched, 0 from identifiers, 100 returned (incomplete).
I[12:33:30.826] --> reply:textDocument/completion("265") 15 ms
I[12:33:30.867] ASTWorker building file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 10 with command 
[C:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default]
"C:\\Daten\\msys64\\mingw64\\bin\\clang++.exe" --driver-mode=g++ -IC:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default -o "CMakeFiles\\Cmk1.dir\\Cmk1.cpp.obj" -c -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/backward -isystem C:/Daten/msys64/mingw64/lib/clang/13.0.0/include -isystem C:/Daten/msys64/mingw64/x86_64-w64-mingw32/include -isystem C:/Daten/msys64/mingw64/include --target=x86_64-w64-windows-gnu "-resource-dir=C:\\temp\\clangd_17.0.3\\lib\\clang\\17" -- "C:\\Users\\gh\\cdt-main\\runtime-New_configuration\\Cmk1\\Cmk1.cpp"
E[12:33:30.888] IncludeCleaner: Failed to get an entry for resolved path : no such file or directory
I[12:33:30.889] --> textDocument/publishDiagnostics
I[12:33:30.956] <-- textDocument/didChange
I[12:33:30.963] <-- textDocument/completion("266")
I[12:33:30.982] Code complete: sema context IncludedFile, query scopes [] (AnyScope=true), expected type <none>
I[12:33:30.982] Code complete: 1773 results from Sema, 0 from Index, 0 matched, 0 from identifiers, 100 returned (incomplete).
I[12:33:30.985] --> reply:textDocument/completion("266") 22 ms
I[12:33:31.021] ASTWorker building file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 11 with command 
[C:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default]
"C:\\Daten\\msys64\\mingw64\\bin\\clang++.exe" --driver-mode=g++ -IC:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default -o "CMakeFiles\\Cmk1.dir\\Cmk1.cpp.obj" -c -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/backward -isystem C:/Daten/msys64/mingw64/lib/clang/13.0.0/include -isystem C:/Daten/msys64/mingw64/x86_64-w64-mingw32/include -isystem C:/Daten/msys64/mingw64/include --target=x86_64-w64-windows-gnu "-resource-dir=C:\\temp\\clangd_17.0.3\\lib\\clang\\17" -- "C:\\Users\\gh\\cdt-main\\runtime-New_configuration\\Cmk1\\Cmk1.cpp"
I[12:33:31.035] --> textDocument/publishDiagnostics
I[12:33:31.129] Built preamble of size 3312868 for file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 10 in 0.26 seconds
I[12:33:31.142] --> textDocument/publishDiagnostics
I[12:33:31.371] Built preamble of size 3312868 for file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 11 in 0.24 seconds
I[12:33:31.384] --> textDocument/publishDiagnostics
I[12:33:31.456] <-- textDocument/documentSymbol("267")
I[12:33:31.456] --> reply:textDocument/documentSymbol("267") 0 ms
I[12:33:31.459] <-- textDocument/semanticTokens/full("268")
I[12:33:31.459] --> reply:textDocument/semanticTokens/full("268") 0 ms
I[12:33:31.463] <-- textDocument/inlayHint("269")
I[12:33:31.463] --> reply:textDocument/inlayHint("269") 0 ms
I[12:33:31.516] <-- textDocument/documentHighlight("270")
I[12:33:31.516] --> reply:textDocument/documentHighlight("270") 0 ms
I[12:33:31.832] <-- textDocument/didChange
I[12:33:31.844] <-- textDocument/completion("271")
I[12:33:31.856] Code complete: sema context IncludedFile, query scopes [] (AnyScope=true), expected type <none>
I[12:33:31.856] Code complete: 91 results from Sema, 0 from Index, 0 matched, 0 from identifiers, 91 returned.
I[12:33:31.858] --> reply:textDocument/completion("271") 14 ms
I[12:33:31.886] ASTWorker building file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 12 with command 
[C:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default]
"C:\\Daten\\msys64\\mingw64\\bin\\clang++.exe" --driver-mode=g++ -IC:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default -o "CMakeFiles\\Cmk1.dir\\Cmk1.cpp.obj" -c -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/backward -isystem C:/Daten/msys64/mingw64/lib/clang/13.0.0/include -isystem C:/Daten/msys64/mingw64/x86_64-w64-mingw32/include -isystem C:/Daten/msys64/mingw64/include --target=x86_64-w64-windows-gnu "-resource-dir=C:\\temp\\clangd_17.0.3\\lib\\clang\\17" -- "C:\\Users\\gh\\cdt-main\\runtime-New_configuration\\Cmk1\\Cmk1.cpp"
E[12:33:31.899] IncludeCleaner: Failed to get an entry for resolved path : no such file or directory
I[12:33:31.900] --> textDocument/publishDiagnostics
I[12:33:31.933] <-- textDocument/didChange
I[12:33:31.996] ASTWorker building file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 13 with command 
[C:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default]
"C:\\Daten\\msys64\\mingw64\\bin\\clang++.exe" --driver-mode=g++ -IC:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default -o "CMakeFiles\\Cmk1.dir\\Cmk1.cpp.obj" -c -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/backward -isystem C:/Daten/msys64/mingw64/lib/clang/13.0.0/include -isystem C:/Daten/msys64/mingw64/x86_64-w64-mingw32/include -isystem C:/Daten/msys64/mingw64/include --target=x86_64-w64-windows-gnu "-resource-dir=C:\\temp\\clangd_17.0.3\\lib\\clang\\17" -- "C:\\Users\\gh\\cdt-main\\runtime-New_configuration\\Cmk1\\Cmk1.cpp"
E[12:33:32.007] IncludeCleaner: Failed to get an entry for resolved path : no such file or directory
I[12:33:32.008] --> textDocument/publishDiagnostics
I[12:33:32.044] <-- textDocument/didChange
I[12:33:32.107] ASTWorker building file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 14 with command 
[C:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default]
"C:\\Daten\\msys64\\mingw64\\bin\\clang++.exe" --driver-mode=g++ -IC:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default -o "CMakeFiles\\Cmk1.dir\\Cmk1.cpp.obj" -c -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/backward -isystem C:/Daten/msys64/mingw64/lib/clang/13.0.0/include -isystem C:/Daten/msys64/mingw64/x86_64-w64-mingw32/include -isystem C:/Daten/msys64/mingw64/include --target=x86_64-w64-windows-gnu "-resource-dir=C:\\temp\\clangd_17.0.3\\lib\\clang\\17" -- "C:\\Users\\gh\\cdt-main\\runtime-New_configuration\\Cmk1\\Cmk1.cpp"
E[12:33:32.119] IncludeCleaner: Failed to get an entry for resolved path : no such file or directory
I[12:33:32.120] --> textDocument/publishDiagnostics
I[12:33:32.141] Built preamble of size 3312868 for file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 12 in 0.25 seconds
E[12:33:32.152] IncludeCleaner: Failed to get an entry for resolved path : no such file or directory
I[12:33:32.153] --> textDocument/publishDiagnostics
I[12:33:32.387] Built preamble of size 3312872 for file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 14 in 0.25 seconds
E[12:33:32.399] IncludeCleaner: Failed to get an entry for resolved path : no such file or directory
I[12:33:32.400] --> textDocument/publishDiagnostics
I[12:33:32.544] <-- textDocument/documentSymbol("272")
I[12:33:32.545] --> reply:textDocument/documentSymbol("272") 0 ms
I[12:33:32.548] <-- textDocument/semanticTokens/full("273")
I[12:33:32.548] --> reply:textDocument/semanticTokens/full("273") 0 ms
I[12:33:32.552] <-- textDocument/inlayHint("274")
I[12:33:32.552] --> reply:textDocument/inlayHint("274") 0 ms
I[12:33:32.595] <-- textDocument/documentHighlight("275")
I[12:33:32.595] --> reply:textDocument/documentHighlight("275") 0 ms
I[12:33:32.775] <-- textDocument/didChange
I[12:33:32.840] ASTWorker building file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 15 with command 
[C:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default]
"C:\\Daten\\msys64\\mingw64\\bin\\clang++.exe" --driver-mode=g++ -IC:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default -o "CMakeFiles\\Cmk1.dir\\Cmk1.cpp.obj" -c -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/backward -isystem C:/Daten/msys64/mingw64/lib/clang/13.0.0/include -isystem C:/Daten/msys64/mingw64/x86_64-w64-mingw32/include -isystem C:/Daten/msys64/mingw64/include --target=x86_64-w64-windows-gnu "-resource-dir=C:\\temp\\clangd_17.0.3\\lib\\clang\\17" -- "C:\\Users\\gh\\cdt-main\\runtime-New_configuration\\Cmk1\\Cmk1.cpp"
I[12:33:32.856] --> textDocument/publishDiagnostics
I[12:33:33.081] Built preamble of size 3312880 for file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 15 in 0.24 seconds
I[12:33:33.093] --> textDocument/publishDiagnostics
I[12:33:33.278] <-- textDocument/documentSymbol("276")
I[12:33:33.278] --> reply:textDocument/documentSymbol("276") 0 ms
I[12:33:33.279] <-- textDocument/semanticTokens/full("277")
I[12:33:33.279] --> reply:textDocument/semanticTokens/full("277") 0 ms
I[12:33:33.284] <-- textDocument/inlayHint("278")
I[12:33:33.284] --> reply:textDocument/inlayHint("278") 0 ms
I[12:33:33.349] <-- textDocument/documentHighlight("279")
I[12:33:33.350] --> reply:textDocument/documentHighlight("279") 0 ms
I[12:33:33.798] <-- textDocument/semanticTokens/full("280")
I[12:33:33.798] --> reply:textDocument/semanticTokens/full("280") 0 ms
I[12:33:35.356] <-- textDocument/didChange
I[12:33:35.368] <-- textDocument/completion("281")
I[12:33:35.376] Code complete: sema context IncludedFile, query scopes [] (AnyScope=true), expected type <none>
I[12:33:35.376] Code complete: 1 results from Sema, 0 from Index, 0 matched, 0 from identifiers, 1 returned.
I[12:33:35.377] --> reply:textDocument/completion("281") 8 ms
I[12:33:35.414] ASTWorker building file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 16 with command 
[C:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default]
"C:\\Daten\\msys64\\mingw64\\bin\\clang++.exe" --driver-mode=g++ -IC:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default -o "CMakeFiles\\Cmk1.dir\\Cmk1.cpp.obj" -c -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/backward -isystem C:/Daten/msys64/mingw64/lib/clang/13.0.0/include -isystem C:/Daten/msys64/mingw64/x86_64-w64-mingw32/include -isystem C:/Daten/msys64/mingw64/include --target=x86_64-w64-windows-gnu "-resource-dir=C:\\temp\\clangd_17.0.3\\lib\\clang\\17" -- "C:\\Users\\gh\\cdt-main\\runtime-New_configuration\\Cmk1\\Cmk1.cpp"
I[12:33:35.420] <-- textDocument/didChange
I[12:33:35.430] --> textDocument/publishDiagnostics
I[12:33:35.476] ASTWorker building file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 17 with command 
[C:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default]
"C:\\Daten\\msys64\\mingw64\\bin\\clang++.exe" --driver-mode=g++ -IC:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default -o "CMakeFiles\\Cmk1.dir\\Cmk1.cpp.obj" -c -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/backward -isystem C:/Daten/msys64/mingw64/lib/clang/13.0.0/include -isystem C:/Daten/msys64/mingw64/x86_64-w64-mingw32/include -isystem C:/Daten/msys64/mingw64/include --target=x86_64-w64-windows-gnu "-resource-dir=C:\\temp\\clangd_17.0.3\\lib\\clang\\17" -- "C:\\Users\\gh\\cdt-main\\runtime-New_configuration\\Cmk1\\Cmk1.cpp"
I[12:33:35.489] --> textDocument/publishDiagnostics
I[12:33:35.524] <-- textDocument/didChange
I[12:33:35.528] <-- textDocument/didChange
I[12:33:35.538] <-- textDocument/completion("282")
I[12:33:35.545] Code complete: sema context IncludedFile, query scopes [] (AnyScope=true), expected type <none>
I[12:33:35.546] Code complete: 0 results from Sema, 0 from Index, 0 matched, 0 from identifiers, 0 returned.
I[12:33:35.546] --> reply:textDocument/completion("282") 7 ms
I[12:33:35.588] ASTWorker building file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 19 with command 
[C:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default]
"C:\\Daten\\msys64\\mingw64\\bin\\clang++.exe" --driver-mode=g++ -IC:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default -o "CMakeFiles\\Cmk1.dir\\Cmk1.cpp.obj" -c -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/backward -isystem C:/Daten/msys64/mingw64/lib/clang/13.0.0/include -isystem C:/Daten/msys64/mingw64/x86_64-w64-mingw32/include -isystem C:/Daten/msys64/mingw64/include --target=x86_64-w64-windows-gnu "-resource-dir=C:\\temp\\clangd_17.0.3\\lib\\clang\\17" -- "C:\\Users\\gh\\cdt-main\\runtime-New_configuration\\Cmk1\\Cmk1.cpp"
I[12:33:35.602] --> textDocument/publishDiagnostics
I[12:33:35.664] Built preamble of size 3312876 for file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 16 in 0.25 seconds
I[12:33:35.676] --> textDocument/publishDiagnostics
I[12:33:35.905] Built preamble of size 3312884 for file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 19 in 0.24 seconds
I[12:33:35.918] --> textDocument/publishDiagnostics
I[12:33:36.029] <-- textDocument/documentSymbol("283")
I[12:33:36.029] --> reply:textDocument/documentSymbol("283") 0 ms
I[12:33:36.035] <-- textDocument/semanticTokens/full("284")
I[12:33:36.035] --> reply:textDocument/semanticTokens/full("284") 0 ms
I[12:33:36.037] <-- textDocument/documentHighlight("285")
I[12:33:36.037] --> reply:textDocument/documentHighlight("285") 0 ms
I[12:33:36.039] <-- textDocument/inlayHint("286")
I[12:33:36.039] --> reply:textDocument/inlayHint("286") 0 ms
I[12:33:36.077] <-- textDocument/didChange
I[12:33:36.139] ASTWorker building file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 20 with command 
[C:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default]
"C:\\Daten\\msys64\\mingw64\\bin\\clang++.exe" --driver-mode=g++ -IC:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default -o "CMakeFiles\\Cmk1.dir\\Cmk1.cpp.obj" -c -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/backward -isystem C:/Daten/msys64/mingw64/lib/clang/13.0.0/include -isystem C:/Daten/msys64/mingw64/x86_64-w64-mingw32/include -isystem C:/Daten/msys64/mingw64/include --target=x86_64-w64-windows-gnu "-resource-dir=C:\\temp\\clangd_17.0.3\\lib\\clang\\17" -- "C:\\Users\\gh\\cdt-main\\runtime-New_configuration\\Cmk1\\Cmk1.cpp"
I[12:33:36.159] --> textDocument/publishDiagnostics
I[12:33:36.383] Built preamble of size 3312880 for file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 20 in 0.24 seconds
I[12:33:36.396] --> textDocument/publishDiagnostics
I[12:33:36.412] <-- textDocument/didChange
I[12:33:36.471] ASTWorker building file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 21 with command 
[C:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default]
"C:\\Daten\\msys64\\mingw64\\bin\\clang++.exe" --driver-mode=g++ -IC:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default -o "CMakeFiles\\Cmk1.dir\\Cmk1.cpp.obj" -c -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/backward -isystem C:/Daten/msys64/mingw64/lib/clang/13.0.0/include -isystem C:/Daten/msys64/mingw64/x86_64-w64-mingw32/include -isystem C:/Daten/msys64/mingw64/include --target=x86_64-w64-windows-gnu "-resource-dir=C:\\temp\\clangd_17.0.3\\lib\\clang\\17" -- "C:\\Users\\gh\\cdt-main\\runtime-New_configuration\\Cmk1\\Cmk1.cpp"
I[12:33:36.487] --> textDocument/publishDiagnostics
I[12:33:36.715] Built preamble of size 3312880 for file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 21 in 0.24 seconds
I[12:33:36.728] --> textDocument/publishDiagnostics
I[12:33:36.844] <-- textDocument/didChange
I[12:33:36.897] ASTWorker building file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 22 with command 
[C:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default]
"C:\\Daten\\msys64\\mingw64\\bin\\clang++.exe" --driver-mode=g++ -IC:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default -o "CMakeFiles\\Cmk1.dir\\Cmk1.cpp.obj" -c -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/backward -isystem C:/Daten/msys64/mingw64/lib/clang/13.0.0/include -isystem C:/Daten/msys64/mingw64/x86_64-w64-mingw32/include -isystem C:/Daten/msys64/mingw64/include --target=x86_64-w64-windows-gnu "-resource-dir=C:\\temp\\clangd_17.0.3\\lib\\clang\\17" -- "C:\\Users\\gh\\cdt-main\\runtime-New_configuration\\Cmk1\\Cmk1.cpp"
I[12:33:36.913] --> textDocument/publishDiagnostics
I[12:33:37.135] Built preamble of size 3312876 for file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 22 in 0.23 seconds
I[12:33:37.147] --> textDocument/publishDiagnostics
I[12:33:37.352] <-- textDocument/documentSymbol("287")
I[12:33:37.352] --> reply:textDocument/documentSymbol("287") 0 ms
I[12:33:37.357] <-- textDocument/semanticTokens/full("288")
I[12:33:37.357] --> reply:textDocument/semanticTokens/full("288") 0 ms
I[12:33:37.361] <-- textDocument/inlayHint("289")
I[12:33:37.361] --> reply:textDocument/inlayHint("289") 0 ms
I[12:33:37.380] <-- textDocument/didChange
I[12:33:37.393] <-- textDocument/completion("290")
I[12:33:37.401] Code complete: sema context IncludedFile, query scopes [] (AnyScope=true), expected type <none>
I[12:33:37.401] Code complete: 1 results from Sema, 0 from Index, 0 matched, 0 from identifiers, 1 returned.
I[12:33:37.401] --> reply:textDocument/completion("290") 8 ms
I[12:33:37.420] <-- textDocument/documentHighlight("291")
I[12:33:37.421] ASTWorker building file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 23 with command 
[C:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default]
"C:\\Daten\\msys64\\mingw64\\bin\\clang++.exe" --driver-mode=g++ -IC:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default -o "CMakeFiles\\Cmk1.dir\\Cmk1.cpp.obj" -c -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/backward -isystem C:/Daten/msys64/mingw64/lib/clang/13.0.0/include -isystem C:/Daten/msys64/mingw64/x86_64-w64-mingw32/include -isystem C:/Daten/msys64/mingw64/include --target=x86_64-w64-windows-gnu "-resource-dir=C:\\temp\\clangd_17.0.3\\lib\\clang\\17" -- "C:\\Users\\gh\\cdt-main\\runtime-New_configuration\\Cmk1\\Cmk1.cpp"
I[12:33:37.436] --> textDocument/publishDiagnostics
I[12:33:37.436] --> reply:textDocument/documentHighlight("291") 15 ms
I[12:33:37.509] <-- textDocument/didChange
I[12:33:37.569] ASTWorker building file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 24 with command 
[C:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default]
"C:\\Daten\\msys64\\mingw64\\bin\\clang++.exe" --driver-mode=g++ -IC:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default -o "CMakeFiles\\Cmk1.dir\\Cmk1.cpp.obj" -c -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/backward -isystem C:/Daten/msys64/mingw64/lib/clang/13.0.0/include -isystem C:/Daten/msys64/mingw64/x86_64-w64-mingw32/include -isystem C:/Daten/msys64/mingw64/include --target=x86_64-w64-windows-gnu "-resource-dir=C:\\temp\\clangd_17.0.3\\lib\\clang\\17" -- "C:\\Users\\gh\\cdt-main\\runtime-New_configuration\\Cmk1\\Cmk1.cpp"
I[12:33:37.582] --> textDocument/publishDiagnostics
I[12:33:37.671] Built preamble of size 3312880 for file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 23 in 0.25 seconds
I[12:33:37.684] --> textDocument/publishDiagnostics
I[12:33:37.716] <-- textDocument/didChange
I[12:33:37.773] ASTWorker building file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 25 with command 
[C:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default]
"C:\\Daten\\msys64\\mingw64\\bin\\clang++.exe" --driver-mode=g++ -IC:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default -o "CMakeFiles\\Cmk1.dir\\Cmk1.cpp.obj" -c -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/backward -isystem C:/Daten/msys64/mingw64/lib/clang/13.0.0/include -isystem C:/Daten/msys64/mingw64/x86_64-w64-mingw32/include -isystem C:/Daten/msys64/mingw64/include --target=x86_64-w64-windows-gnu "-resource-dir=C:\\temp\\clangd_17.0.3\\lib\\clang\\17" -- "C:\\Users\\gh\\cdt-main\\runtime-New_configuration\\Cmk1\\Cmk1.cpp"
I[12:33:37.787] --> textDocument/publishDiagnostics
I[12:33:37.918] Built preamble of size 3312880 for file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 24 in 0.25 seconds
I[12:33:37.931] --> textDocument/publishDiagnostics
I[12:33:38.151] Built preamble of size 3312884 for file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 25 in 0.23 seconds
I[12:33:38.163] --> textDocument/publishDiagnostics
I[12:33:38.182] <-- textDocument/didChange
I[12:33:38.240] ASTWorker building file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 26 with command 
[C:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default]
"C:\\Daten\\msys64\\mingw64\\bin\\clang++.exe" --driver-mode=g++ -IC:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default -o "CMakeFiles\\Cmk1.dir\\Cmk1.cpp.obj" -c -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/backward -isystem C:/Daten/msys64/mingw64/lib/clang/13.0.0/include -isystem C:/Daten/msys64/mingw64/x86_64-w64-mingw32/include -isystem C:/Daten/msys64/mingw64/include --target=x86_64-w64-windows-gnu "-resource-dir=C:\\temp\\clangd_17.0.3\\lib\\clang\\17" -- "C:\\Users\\gh\\cdt-main\\runtime-New_configuration\\Cmk1\\Cmk1.cpp"
I[12:33:38.254] --> textDocument/publishDiagnostics
I[12:33:38.478] Built preamble of size 3313324 for file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 26 in 0.24 seconds
I[12:33:38.491] --> textDocument/publishDiagnostics
I[12:33:38.684] <-- textDocument/documentSymbol("292")
I[12:33:38.685] --> reply:textDocument/documentSymbol("292") 0 ms
I[12:33:38.689] <-- textDocument/semanticTokens/full("293")
I[12:33:38.689] --> reply:textDocument/semanticTokens/full("293") 0 ms
I[12:33:38.693] <-- textDocument/inlayHint("294")
I[12:33:38.693] --> reply:textDocument/inlayHint("294") 0 ms
I[12:33:38.802] <-- textDocument/documentHighlight("295")
I[12:33:38.802] --> reply:textDocument/documentHighlight("295") 0 ms
I[12:33:39.195] <-- textDocument/semanticTokens/full("296")
I[12:33:39.195] --> reply:textDocument/semanticTokens/full("296") 0 ms
I[12:33:39.414] <-- textDocument/rangeFormatting("297")
I[12:33:39.416] --> reply:textDocument/rangeFormatting("297") 2 ms
I[12:33:39.418] <-- textDocument/didChange

!ENTRY org.eclipse.text 4 2 2024-01-21 12:33:39.421
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.text".
!STACK 0
java.lang.IllegalArgumentException: Argument not valid
    at org.eclipse.swt.SWT.error(SWT.java:4899)
    at org.eclipse.swt.SWT.error(SWT.java:4833)
    at org.eclipse.swt.SWT.error(SWT.java:4804)
    at org.eclipse.jface.text.DefaultDocumentAdapter.getLine(DefaultDocumentAdapter.java:167)
    at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:1022)
    at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:908)
    at org.eclipse.swt.custom.StyledTextRenderer.calculate(StyledTextRenderer.java:298)
    at org.eclipse.swt.custom.StyledTextRenderer.calculateClientArea(StyledTextRenderer.java:328)
    at org.eclipse.swt.custom.StyledText.resetCache(StyledText.java:7831)
    at org.eclipse.swt.custom.StyledText.reset(StyledText.java:7800)
    at org.eclipse.swt.custom.StyledText.handleTextSet(StyledText.java:6153)
    at org.eclipse.swt.custom.StyledText$5.textSet(StyledText.java:5410)
    at org.eclipse.jface.text.DefaultDocumentAdapter.fireTextSet(DefaultDocumentAdapter.java:332)
    at org.eclipse.jface.text.DefaultDocumentAdapter.resumeForwardingDocumentChanges(DefaultDocumentAdapter.java:371)
    at org.eclipse.jface.text.TextViewer.enabledRedrawing(TextViewer.java:5020)
    at org.eclipse.jface.text.TextViewer.enabledRedrawing(TextViewer.java:5007)
    at org.eclipse.jface.text.TextViewer.setRedraw(TextViewer.java:5089)
    at org.eclipse.jface.text.TextViewer.setRedraw(TextViewer.java:5063)
    at org.eclipse.jface.text.TextViewer$RewriteTarget.setRedraw(TextViewer.java:1004)
    at org.eclipse.jface.text.TextViewer$DocumentRewriteSessionListener.documentRewriteSessionChanged(TextViewer.java:1410)
    at org.eclipse.jface.text.AbstractDocument.fireRewriteSessionChanged(AbstractDocument.java:1423)
    at org.eclipse.jface.text.AbstractDocument.stopRewriteSession(AbstractDocument.java:1504)
    at org.eclipse.core.internal.filebuffers.SynchronizableDocument.stopRewriteSession(SynchronizableDocument.java:108)
    at org.eclipse.jface.text.RewriteSessionEditProcessor.performEdits(RewriteSessionEditProcessor.java:101)
    at org.eclipse.lsp4e.LSPEclipseUtils.applyEdits(LSPEclipseUtils.java:541)
    at org.eclipse.lsp4e.VersionedEdits.apply(VersionedEdits.java:45)
    at org.eclipse.lsp4e.DocumentContentSynchronizer.formatDocument(DocumentContentSynchronizer.java:296)
    at org.eclipse.lsp4e.DocumentContentSynchronizer.documentAboutToBeSaved(DocumentContentSynchronizer.java:251)
    at org.eclipse.lsp4e.LanguageServerWrapper$1.stateChanging(LanguageServerWrapper.java:127)
    at org.eclipse.core.internal.filebuffers.TextFileBufferManager$9.run(TextFileBufferManager.java:749)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
    at org.eclipse.core.internal.filebuffers.TextFileBufferManager.fireStateChanging(TextFileBufferManager.java:746)
    at org.eclipse.core.internal.filebuffers.ResourceFileBuffer.commit(ResourceFileBuffer.java:314)
    at org.eclipse.ui.editors.text.TextFileDocumentProvider.commitFileBuffer(TextFileDocumentProvider.java:870)
    at org.eclipse.ui.editors.text.TextFileDocumentProvider$2.execute(TextFileDocumentProvider.java:804)
    at org.eclipse.ui.editors.text.TextFileDocumentProvider$DocumentProviderOperation.run(TextFileDocumentProvider.java:133)
    at org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation.execute(WorkspaceModifyDelegatingOperation.java:71)
    at org.eclipse.ui.actions.WorkspaceModifyOperation.lambda$0(WorkspaceModifyOperation.java:110)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2453)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2478)
    at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:131)
    at org.eclipse.ui.internal.editors.text.WorkspaceOperationRunner.run(WorkspaceOperationRunner.java:76)
    at org.eclipse.ui.internal.editors.text.WorkspaceOperationRunner.run(WorkspaceOperationRunner.java:66)
    at org.eclipse.ui.editors.text.TextFileDocumentProvider.executeOperation(TextFileDocumentProvider.java:461)
    at org.eclipse.ui.editors.text.TextFileDocumentProvider.saveDocument(TextFileDocumentProvider.java:783)
    at org.eclipse.ui.texteditor.AbstractTextEditor.performSave(AbstractTextEditor.java:5009)
    at org.eclipse.ui.texteditor.AbstractTextEditor.doSave(AbstractTextEditor.java:4805)
    at org.eclipse.ui.texteditor.AbstractTextEditor$TextEditorSavable.doSave(AbstractTextEditor.java:7185)
    at org.eclipse.ui.Saveable.doSave(Saveable.java:213)
    at org.eclipse.ui.internal.SaveableHelper.doSaveModel(SaveableHelper.java:333)
    at org.eclipse.ui.internal.SaveableHelper.lambda$1(SaveableHelper.java:196)
    at org.eclipse.ui.internal.SaveableHelper.lambda$3(SaveableHelper.java:271)
    at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:434)
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:354)
    at org.eclipse.ui.internal.WorkbenchWindow.lambda$7(WorkbenchWindow.java:2348)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
    at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2345)
    at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:278)
    at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:260)
    at org.eclipse.ui.internal.SaveableHelper.saveModels(SaveableHelper.java:207)
    at org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelper.java:150)
    at org.eclipse.ui.internal.WorkbenchPage.saveSaveable(WorkbenchPage.java:3825)
    at org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPage.java:3838)
    at org.eclipse.ui.internal.handlers.SaveHandler.execute(SaveHandler.java:82)
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:283)
    at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:99)
    at jdk.internal.reflect.GeneratedMethodAccessor60.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:298)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:232)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:174)
    at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:165)
    at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:485)
    at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
    at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:308)
    at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:580)
    at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:655)
    at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:439)
    at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:96)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
    at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1286)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1065)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1090)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1075)
    at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1117)
    at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1113)
    at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1594)
    at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4866)
    at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:345)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4744)
    at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:340)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5039)
    at org.eclipse.swt.internal.win32.OS.DispatchMessage(Native Method)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:342)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:648)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:342)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:555)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:651)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:588)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1459)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1432)
I[12:33:39.427] <-- textDocument/didSave
I[12:33:39.428] File version went from 60 to 60
I[12:33:39.428] File version went from 27 to 27
Jan. 21, 2024 12:33:39 PM org.eclipse.tm4e.core.model.TMModel$TokenizerThread revalidateTokens
SCHWERWIEGEND: org.eclipse.jface.text.BadLocationException
I[12:33:39.488] ASTWorker building file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\include\Cmk1.hpp version 60 with command inferred from C:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/Cmk1.cpp
[C:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default]
"C:\\Daten\\msys64\\mingw64\\bin\\clang++.exe" --driver-mode=g++ -IC:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default -c -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/backward -isystem C:/Daten/msys64/mingw64/lib/clang/13.0.0/include -isystem C:/Daten/msys64/mingw64/x86_64-w64-mingw32/include -isystem C:/Daten/msys64/mingw64/include --target=x86_64-w64-windows-gnu "-resource-dir=C:\\temp\\clangd_17.0.3\\lib\\clang\\17" -- "C:\\Users\\gh\\cdt-main\\runtime-New_configuration\\Cmk1\\include\\Cmk1.hpp"
I[12:33:39.488] ASTWorker building file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 27 with command 
[C:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default]
"C:\\Daten\\msys64\\mingw64\\bin\\clang++.exe" --driver-mode=g++ -IC:/Users/gh/cdt-main/runtime-New_configuration/Cmk1/build/default -o "CMakeFiles\\Cmk1.dir\\Cmk1.cpp.obj" -c -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/x86_64-w64-mingw32 -isystem C:/Daten/msys64/mingw64/include/c++/11.2.0/backward -isystem C:/Daten/msys64/mingw64/lib/clang/13.0.0/include -isystem C:/Daten/msys64/mingw64/x86_64-w64-mingw32/include -isystem C:/Daten/msys64/mingw64/include --target=x86_64-w64-windows-gnu "-resource-dir=C:\\temp\\clangd_17.0.3\\lib\\clang\\17" -- "C:\\Users\\gh\\cdt-main\\runtime-New_configuration\\Cmk1\\Cmk1.cpp"
I[12:33:39.498] --> textDocument/publishDiagnostics
I[12:33:39.501] Built preamble of size 236832 for file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\include\Cmk1.hpp version 60 in 0.01 seconds
I[12:33:39.504] --> textDocument/publishDiagnostics
I[12:33:39.510] --> textDocument/publishDiagnostics
I[12:33:39.751] Built preamble of size 3313360 for file C:\Users\gh\cdt-main\runtime-New_configuration\Cmk1\Cmk1.cpp version 27 in 0.26 seconds
I[12:33:39.765] --> textDocument/publishDiagnostics
I[12:33:39.920] <-- textDocument/documentSymbol("298")
I[12:33:39.920] --> reply:textDocument/documentSymbol("298") 0 ms
I[12:33:39.921] <-- textDocument/semanticTokens/full("299")
I[12:33:39.921] --> reply:textDocument/semanticTokens/full("299") 0 ms
I[12:33:39.925] <-- textDocument/inlayHint("300")
I[12:33:39.925] --> reply:textDocument/inlayHint("300") 0 ms
I[12:33:39.964] <-- textDocument/documentHighlight("301")
I[12:33:39.964] --> reply:textDocument/documentHighlight("301") 0 ms
I[12:33:40.426] <-- textDocument/semanticTokens/full("302")
I[12:33:40.428] --> reply:textDocument/semanticTokens/full("302") 1 ms
I[12:33:40.939] <-- textDocument/semanticTokens/full("303")
I[12:33:40.939] --> reply:textDocument/semanticTokens/full("303") 0 ms
ghentschke commented 8 months ago

It seems to be a race condition on LSP4E formatDocument org.eclipse.lsp4e.DocumentContentSynchronizer.formatDocument(DocumentContentSynchronizer.java:296)

It 's triggered by splitting the \r\n line ending during string replacement in the editors document. See https://github.com/eclipse-cdt/cdt-lsp/issues/239#issuecomment-1913091960

ghentschke commented 8 months ago

This happens also when formatting the code via context menu: Source -> Format or via Ctrl + Shift + F (under Windows) and then saving the file.

ghentschke commented 8 months ago

After some investigation, I found out, that this will be triggered when the newText string in the TextEdit response from clangd ends with a \r character:

[TextEdit [
  range = Range [
    start = Position [
      line = 1
      character = 0
    ]
    end = Position [
      line = 3
      character = 20
    ]
  ]
  newText = "#include "config.h"\r\n#include <Cmk1.hpp>\r\n#include <iostream>\r"
]]

This leads to editor document inconsistency when the \r\n line ending is used (typically on windows machines). That's why the problem occurs on windows machines only. I assume that during the document.replace operation, a separation of the \r\n line ending by the replacement string leads to an invalid document state.

ghentschke commented 8 months ago

Fixed by LSP4E PR #903