@@ -1106,7 +1106,7 @@ func (ls *INOLanguageServer) didClose(logger jsonrpc.FunctionLogger, inoDidClose
11061106 delete (ls .trackedIDEDocs , inoIdentifier .URI .AsPath ().String ())
11071107 } else {
11081108 logger .Logf (" didClose of untracked document: %s" , inoIdentifier .URI )
1109- return nil , unknownURI ( inoIdentifier .URI )
1109+ return nil , & UnknownURI { inoIdentifier .URI }
11101110 }
11111111
11121112 // If we are tracking a .ino...
@@ -1161,7 +1161,7 @@ func (ls *INOLanguageServer) didChange(logger jsonrpc.FunctionLogger, inoDidChan
11611161 // Apply the change to the tracked sketch file.
11621162 trackedInoID := inoDoc .URI .AsPath ().String ()
11631163 if doc , ok := ls .trackedIDEDocs [trackedInoID ]; ! ok {
1164- return nil , unknownURI ( inoDoc .URI )
1164+ return nil , & UnknownURI { inoDoc .URI }
11651165 } else if updatedDoc , err := textedits .ApplyLSPTextDocumentContentChangeEvent (doc , inoDidChangeParams ); err != nil {
11661166 return nil , err
11671167 } else {
@@ -1446,6 +1446,10 @@ func (ls *INOLanguageServer) cpp2inoDocumentSymbols(logger jsonrpc.FunctionLogge
14461446 return inoSymbols
14471447}
14481448
1449- func unknownURI (uri lsp.DocumentURI ) error {
1450- return errors .New ("Document is not available: " + uri .String ())
1449+ type UnknownURI struct {
1450+ URI lsp.DocumentURI
1451+ }
1452+
1453+ func (e * UnknownURI ) Error () string {
1454+ return "Document is not available: " + e .URI .String ()
14511455}
0 commit comments