@@ -149,15 +149,17 @@ func (handler *InoHandler) HandleMessageFromIDE(ctx context.Context, conn *jsonr
149
149
inoURI = p .TextDocument .URI
150
150
log .Printf ("--> didOpen(%s@%d as '%s')" , p .TextDocument .URI , p .TextDocument .Version , p .TextDocument .LanguageID )
151
151
152
- res , err := handler .didOpen (ctx , p )
153
-
154
- if res == nil {
152
+ if res , e := handler .didOpen (p ); e != nil {
153
+ params = nil
154
+ err = e
155
+ } else if res == nil {
155
156
log .Println (" --X notification is not propagated to clangd" )
156
- return nil , err // do not propagate to clangd
157
+ return nil , nil // do not propagate to clangd
158
+ } else {
159
+ log .Printf (" --> didOpen(%s@%d as '%s')" , res .TextDocument .URI , res .TextDocument .Version , p .TextDocument .LanguageID )
160
+ params = res
157
161
}
158
162
159
- log .Printf (" --> didOpen(%s@%d as '%s')" , res .TextDocument .URI , res .TextDocument .Version , p .TextDocument .LanguageID )
160
- params = res
161
163
162
164
case * lsp.DidChangeTextDocumentParams :
163
165
// notification "textDocument/didChange"
@@ -530,7 +532,7 @@ func startClangd(compileCommandsDir, sketchCpp *paths.Path) (io.WriteCloser, io.
530
532
}
531
533
}
532
534
533
- func (handler * InoHandler ) didOpen (ctx context. Context , inoDidOpen * lsp.DidOpenTextDocumentParams ) (* lsp.DidOpenTextDocumentParams , error ) {
535
+ func (handler * InoHandler ) didOpen (inoDidOpen * lsp.DidOpenTextDocumentParams ) (* lsp.DidOpenTextDocumentParams , error ) {
534
536
// Add the TextDocumentItem in the tracked files list
535
537
inoItem := inoDidOpen .TextDocument
536
538
handler .docs [inoItem .URI ] = & inoItem
0 commit comments