File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1296,6 +1296,14 @@ func (ls *INOLanguageServer) ino2cppTextDocumentItem(logger jsonrpc.FunctionLogg
1296
1296
}
1297
1297
1298
1298
func (ls * INOLanguageServer ) didChange (logger jsonrpc.FunctionLogger , inoDidChangeParams * lsp.DidChangeTextDocumentParams ) (* lsp.DidChangeTextDocumentParams , error ) {
1299
+ // Clear all RangeLengths: it's a deprecated field and if the byte count is wrong the
1300
+ // source text file will be unloaded from clangd without notice, leading to a "non-added
1301
+ // docuemtn" error for all subsequent requests.
1302
+ // https://github.com/clangd/clangd/issues/717#issuecomment-793220007
1303
+ for i := range inoDidChangeParams .ContentChanges {
1304
+ inoDidChangeParams .ContentChanges [i ].RangeLength = nil
1305
+ }
1306
+
1299
1307
inoDoc := inoDidChangeParams .TextDocument
1300
1308
1301
1309
// Apply the change to the tracked sketch file.
You can’t perform that action at this time.
0 commit comments