diff options
-rw-r--r-- | script/file-uri.lua | 4 | ||||
-rw-r--r-- | script/provider/diagnostic.lua | 4 | ||||
-rw-r--r-- | script/provider/provider.lua | 9 |
3 files changed, 13 insertions, 4 deletions
diff --git a/script/file-uri.lua b/script/file-uri.lua index 7f3e36a8..ccd47156 100644 --- a/script/file-uri.lua +++ b/script/file-uri.lua @@ -94,4 +94,8 @@ function m.decode(uri) return value end +function m.split(uri) + return uri:match('([^:]*):?/?/?([^/]*)(.*)') +end + return m diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua index de1a735e..3e587009 100644 --- a/script/provider/diagnostic.lua +++ b/script/provider/diagnostic.lua @@ -225,7 +225,7 @@ function m.doDiagnostic(uri, isScopeDiag) local prog <close> = progress.create(scp, lang.script.WINDOW_DIAGNOSING, 0.5) prog:setMessage(ws.getRelativePath(uri)) - log.debug('Diagnostic file:', uri) + --log.debug('Diagnostic file:', uri) local syntax = m.syntaxErrors(uri, state) @@ -235,7 +235,7 @@ function m.doDiagnostic(uri, isScopeDiag) tracy.ZoneBeginN 'mergeSyntaxAndDiags' local _ <close> = tracy.ZoneEnd local full = mergeDiags(syntax, lastDiag, diags) - log.debug(('Pushed [%d] results'):format(full and #full or 0)) + --log.debug(('Pushed [%d] results'):format(full and #full or 0)) if not full then m.clear(uri) return diff --git a/script/provider/provider.lua b/script/provider/provider.lua index 5ee99b3e..eef22b21 100644 --- a/script/provider/provider.lua +++ b/script/provider/provider.lua @@ -225,8 +225,13 @@ m.register 'workspace/didRenameFiles' { m.register 'textDocument/didOpen' { ---@async function (params) - local doc = params.textDocument - local uri = files.getRealUri(doc.uri) + local doc = params.textDocument + local scheme = furi.split(doc.uri) + if scheme ~= 'file' then + return + end + local uri = files.getRealUri(doc.uri) + log.debug('didOpen', uri) workspace.awaitReady(uri) local text = doc.text files.setText(uri, text, true, function (file) |