@@ -731,7 +731,7 @@ func startClangd(compileCommandsDir, sketchCpp *paths.Path, compilers map[string
731
731
func (handler * InoHandler ) didOpen (inoDidOpen * lsp.DidOpenTextDocumentParams ) (* lsp.DidOpenTextDocumentParams , error ) {
732
732
// Add the TextDocumentItem in the tracked files list
733
733
inoItem := inoDidOpen .TextDocument
734
- handler .docs [inoItem .URI .Canonical ()] = & inoItem
734
+ handler .docs [inoItem .URI .AsPath (). String ()] = & inoItem
735
735
736
736
// If we are tracking a .ino...
737
737
if inoItem .URI .Ext () == ".ino" {
@@ -752,8 +752,8 @@ func (handler *InoHandler) didOpen(inoDidOpen *lsp.DidOpenTextDocumentParams) (*
752
752
753
753
func (handler * InoHandler ) didClose (inoDidClose * lsp.DidCloseTextDocumentParams ) (* lsp.DidCloseTextDocumentParams , error ) {
754
754
inoIdentifier := inoDidClose .TextDocument
755
- if _ , exist := handler .docs [inoIdentifier .URI .Canonical ()]; exist {
756
- delete (handler .docs , inoIdentifier .URI .Canonical ())
755
+ if _ , exist := handler .docs [inoIdentifier .URI .AsPath (). String ()]; exist {
756
+ delete (handler .docs , inoIdentifier .URI .AsPath (). String ())
757
757
} else {
758
758
log .Printf (" didClose of untracked document: %s" , inoIdentifier .URI )
759
759
return nil , unknownURI (inoIdentifier .URI )
@@ -789,8 +789,9 @@ func (handler *InoHandler) ino2cppTextDocumentItem(inoItem lsp.TextDocumentItem)
789
789
cppItem .Version = handler .sketchMapper .CppText .Version
790
790
} else {
791
791
cppItem .LanguageID = inoItem .LanguageID
792
- cppItem .Text = handler .docs [inoItem .URI .Canonical ()].Text
793
- cppItem .Version = handler .docs [inoItem .URI .Canonical ()].Version
792
+ inoPath := inoItem .URI .AsPath ().String ()
793
+ cppItem .Text = handler .docs [inoPath ].Text
794
+ cppItem .Version = handler .docs [inoPath ].Version
794
795
}
795
796
796
797
return cppItem , nil
@@ -799,7 +800,7 @@ func (handler *InoHandler) ino2cppTextDocumentItem(inoItem lsp.TextDocumentItem)
799
800
func (handler * InoHandler ) didChange (ctx context.Context , req * lsp.DidChangeTextDocumentParams ) (* lsp.DidChangeTextDocumentParams , error ) {
800
801
doc := req .TextDocument
801
802
802
- trackedDoc , ok := handler .docs [doc .URI .Canonical ()]
803
+ trackedDoc , ok := handler .docs [doc .URI .AsPath (). String ()]
803
804
if ! ok {
804
805
return nil , unknownURI (doc .URI )
805
806
}
@@ -1405,7 +1406,7 @@ func (handler *InoHandler) cpp2inoTextEdit(cppURI lsp.DocumentURI, cppEdit lsp.T
1405
1406
}
1406
1407
1407
1408
func (handler * InoHandler ) cpp2inoDocumentSymbols (cppSymbols []lsp.DocumentSymbol , inoRequestedURI lsp.DocumentURI ) []lsp.DocumentSymbol {
1408
- inoRequested := inoRequestedURI .Canonical ()
1409
+ inoRequested := inoRequestedURI .AsPath (). String ()
1409
1410
log .Printf (" filtering for requested ino file: %s" , inoRequested )
1410
1411
if inoRequestedURI .Ext () != ".ino" || len (cppSymbols ) == 0 {
1411
1412
return cppSymbols
0 commit comments