@@ -509,7 +509,7 @@ func (handler *InoHandler) didOpen(ctx context.Context, params *lsp.DidOpenTextD
509
509
handler .docs [doc .URI ] = & doc
510
510
511
511
// If we are tracking a .ino...
512
- if doc .URI .AsPath (). Ext () == ".ino" {
512
+ if doc .URI .Ext () == ".ino" {
513
513
handler .sketchTrackedFilesCount ++
514
514
log .Printf (" increasing .ino tracked files count: %d" , handler .sketchTrackedFilesCount )
515
515
@@ -549,7 +549,7 @@ func (handler *InoHandler) didChange(ctx context.Context, req *lsp.DidChangeText
549
549
550
550
// If changes are applied to a .ino file we increment the global .ino.cpp versioning
551
551
// for each increment of the single .ino file.
552
- if doc .URI .AsPath (). Ext () == ".ino" {
552
+ if doc .URI .Ext () == ".ino" {
553
553
554
554
cppChanges := []lsp.TextDocumentContentChangeEvent {}
555
555
for _ , inoChange := range req .ContentChanges {
@@ -853,7 +853,7 @@ func (handler *InoHandler) cpp2inoCodeAction(codeAction *lsp.CodeAction, uri lsp
853
853
Diagnostics : codeAction .Diagnostics ,
854
854
Command : handler .Cpp2InoCommand (codeAction .Command ),
855
855
}
856
- if uri .AsPath (). Ext () == ".ino" {
856
+ if uri .Ext () == ".ino" {
857
857
for i , diag := range inoCodeAction .Diagnostics {
858
858
_ , inoCodeAction .Diagnostics [i ].Range = handler .sketchMapper .CppToInoRange (diag .Range )
859
859
}
@@ -953,7 +953,7 @@ func (handler *InoHandler) cpp2inoTextEdit(edit *lsp.TextEdit, uri lsp.DocumentU
953
953
}
954
954
955
955
func (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 {
957
957
return origSymbols
958
958
}
959
959
@@ -1072,7 +1072,7 @@ func (handler *InoHandler) FromClangd(ctx context.Context, connection *jsonrpc2.
1072
1072
// If we have an "undefined reference" in the .ino code trigger a
1073
1073
// check for newly created symbols (that in turn may trigger a
1074
1074
// new arduino-preprocessing of the sketch).
1075
- if msg .URI .AsPath (). Ext () == ".ino" {
1075
+ if msg .URI .Ext () == ".ino" {
1076
1076
for _ , diag := range msg .Diagnostics {
1077
1077
if diag .Code == "undeclared_var_use_suggest" {
1078
1078
handler .buildSketchSymbolsCheck = true
0 commit comments