diff options
Diffstat (limited to 'script')
-rw-r--r-- | script/vm/compiler.lua | 3 | ||||
-rw-r--r-- | script/vm/doc.lua | 6 | ||||
-rw-r--r-- | script/workspace/workspace.lua | 2 |
3 files changed, 10 insertions, 1 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index d764c91d..32cc7128 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -980,7 +980,7 @@ local compilerSwitch = util.switch() for _, doc in ipairs(src.bindDocs) do if doc.type == 'doc.type' then vm.setNode(src, vm.compileNode(doc), true) - return + return vm.getNode(src) end end end @@ -1773,6 +1773,7 @@ local function compileByGlobal(source) vm.setNode(source, globalNode, true) return end + ---@type vm.node globalNode = vm.createNode(global) vm.setNode(root._globalBase[name], globalNode, true) vm.setNode(source, globalNode, true) diff --git a/script/vm/doc.lua b/script/vm/doc.lua index 5a92a103..055b3d49 100644 --- a/script/vm/doc.lua +++ b/script/vm/doc.lua @@ -27,6 +27,9 @@ function vm.isMetaFile(uri) return false end local cache = files.getCache(uri) + if not cache then + return false + end if cache.isMeta ~= nil then return cache.isMeta end @@ -332,6 +335,9 @@ function vm.isDiagDisabledAt(uri, position, name) return false end local cache = files.getCache(uri) + if not cache then + return false + end if not cache.diagnosticRanges then cache.diagnosticRanges = {} for _, doc in ipairs(status.ast.docs) do diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua index 91923bb8..26c3a3b2 100644 --- a/script/workspace/workspace.lua +++ b/script/workspace/workspace.lua @@ -332,6 +332,8 @@ function m.findUrisByFilePath(path) return results end +---@param path string +---@return string function m.normalize(path) if not path then return nil |