summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-rw-r--r--script/file-uri.lua6
-rw-r--r--script/workspace/workspace.lua3
2 files changed, 9 insertions, 0 deletions
diff --git a/script/file-uri.lua b/script/file-uri.lua
index d849eac1..7f3e36a8 100644
--- a/script/file-uri.lua
+++ b/script/file-uri.lua
@@ -24,6 +24,9 @@ local m = {}
---@param path string
---@return uri uri
function m.encode(path)
+ if not path then
+ return nil
+ end
local authority = ''
if platform.OS == 'Windows' then
path = path:gsub('\\', '/')
@@ -67,6 +70,9 @@ end
---@param uri uri
---@return string path
function m.decode(uri)
+ if not uri then
+ return nil
+ end
local scheme, authority, path = uri:match('([^:]*):?/?/?([^/]*)(.*)')
if not scheme then
return ''
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua
index 9160657a..b8ddedb5 100644
--- a/script/workspace/workspace.lua
+++ b/script/workspace/workspace.lua
@@ -472,6 +472,9 @@ end
---@param uri uri
function m.isReady(uri)
local scp = m.getScope(uri)
+ if scp.type == 'fallback' then
+ return true
+ end
return scp:get('ready') == true
end