@@ -129,18 +129,24 @@ func (handler *InoHandler) HandleMessageFromIDE(ctx context.Context, conn *jsonr
129129 handler .synchronizer .DataMux .RUnlock ()
130130
131131 case * lsp.DidOpenTextDocumentParams :
132- // method "textDocument/didOpen":
132+ // method "textDocument/didOpen"
133133 uri = p .TextDocument .URI
134+ log .Printf ("--> didOpen(%s)" , uri )
135+
134136 handler .synchronizer .DataMux .Lock ()
135137 res , err := handler .didOpen (ctx , p )
136138 handler .synchronizer .DataMux .Unlock ()
139+
137140 if res == nil {
138- log .Println (" notification is not propagated to clangd" )
141+ log .Println (" --X notification is not propagated to clangd" )
139142 return nil , err // do not propagate to clangd
140143 }
144+
145+ log .Printf (" --> didOpen(%s)" , res .TextDocument .URI )
141146 params = res
142147
143- case * lsp.CompletionParams : // "textDocument/completion":
148+ case * lsp.CompletionParams :
149+ // method: "textDocument/completion"
144150 uri = p .TextDocument .URI
145151 log .Printf ("--> completion(%s:%d:%d)\n " , p .TextDocument .URI , p .Position .Line , p .Position .Character )
146152
@@ -346,7 +352,6 @@ func (handler *InoHandler) didOpen(ctx context.Context, params *lsp.DidOpenTextD
346352 // Add the TextDocumentItem in the tracked files list
347353 doc := params .TextDocument
348354 handler .trackedFiles [doc .URI ] = doc
349- log .Printf ("--> didOpen(%s)" , doc .URI )
350355
351356 // If we are tracking a .ino...
352357 if doc .URI .AsPath ().Ext () == ".ino" {
@@ -364,7 +369,6 @@ func (handler *InoHandler) didOpen(ctx context.Context, params *lsp.DidOpenTextD
364369 Version : 1 ,
365370 },
366371 }
367- log .Printf (" message for clangd: didOpen(%s)" , newParam .TextDocument .URI )
368372 return newParam , err
369373 }
370374 }
0 commit comments