@@ -509,7 +509,7 @@ func (handler *InoHandler) didOpen(ctx context.Context, params *lsp.DidOpenTextD
509509 handler .docs [doc .URI ] = & doc
510510
511511 // If we are tracking a .ino...
512- if doc .URI .AsPath (). Ext () == ".ino" {
512+ if doc .URI .Ext () == ".ino" {
513513 handler .sketchTrackedFilesCount ++
514514 log .Printf (" increasing .ino tracked files count: %d" , handler .sketchTrackedFilesCount )
515515
@@ -549,7 +549,7 @@ func (handler *InoHandler) didChange(ctx context.Context, req *lsp.DidChangeText
549549
550550 // If changes are applied to a .ino file we increment the global .ino.cpp versioning
551551 // for each increment of the single .ino file.
552- if doc .URI .AsPath (). Ext () == ".ino" {
552+ if doc .URI .Ext () == ".ino" {
553553
554554 cppChanges := []lsp.TextDocumentContentChangeEvent {}
555555 for _ , inoChange := range req .ContentChanges {
@@ -853,7 +853,7 @@ func (handler *InoHandler) cpp2inoCodeAction(codeAction *lsp.CodeAction, uri lsp
853853 Diagnostics : codeAction .Diagnostics ,
854854 Command : handler .Cpp2InoCommand (codeAction .Command ),
855855 }
856- if uri .AsPath (). Ext () == ".ino" {
856+ if uri .Ext () == ".ino" {
857857 for i , diag := range inoCodeAction .Diagnostics {
858858 _ , inoCodeAction .Diagnostics [i ].Range = handler .sketchMapper .CppToInoRange (diag .Range )
859859 }
@@ -953,7 +953,7 @@ func (handler *InoHandler) cpp2inoTextEdit(edit *lsp.TextEdit, uri lsp.DocumentU
953953}
954954
955955func (handler * InoHandler ) cpp2inoDocumentSymbols (origSymbols []lsp.DocumentSymbol , origURI lsp.DocumentURI ) []lsp.DocumentSymbol {
956- if origURI .AsPath (). Ext () != ".ino" || len (origSymbols ) == 0 {
956+ if origURI .Ext () != ".ino" || len (origSymbols ) == 0 {
957957 return origSymbols
958958 }
959959
@@ -1072,7 +1072,7 @@ func (handler *InoHandler) FromClangd(ctx context.Context, connection *jsonrpc2.
10721072 // If we have an "undefined reference" in the .ino code trigger a
10731073 // check for newly created symbols (that in turn may trigger a
10741074 // new arduino-preprocessing of the sketch).
1075- if msg .URI .AsPath (). Ext () == ".ino" {
1075+ if msg .URI .Ext () == ".ino" {
10761076 for _ , diag := range msg .Diagnostics {
10771077 if diag .Code == "undeclared_var_use_suggest" {
10781078 handler .buildSketchSymbolsCheck = true
0 commit comments