summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/core/noder.lua6
-rw-r--r--script/service/telemetry.lua8
-rw-r--r--script/vm/getDocs.lua3
-rw-r--r--script/workspace/require-path.lua3
4 files changed, 15 insertions, 5 deletions
diff --git a/script/core/noder.lua b/script/core/noder.lua
index 0a04a744..fcc6b6f4 100644
--- a/script/core/noder.lua
+++ b/script/core/noder.lua
@@ -186,7 +186,11 @@ local function getFieldEventName(field)
if not secondTypeUnit or secondTypeUnit.type ~= 'doc.type.function' then
return nil
end
- local eventName = firstEnum[1]:match [[^['"](.+)['"]$]]
+ local enmuStr = firstEnum[1]
+ if type(enmuStr) ~= 'string' then
+ return nil
+ end
+ local eventName = enmuStr:match [[^['"](.+)['"]$]]
field._eventName = eventName
return eventName
end
diff --git a/script/service/telemetry.lua b/script/service/telemetry.lua
index d1bf7680..e4e610e3 100644
--- a/script/service/telemetry.lua
+++ b/script/service/telemetry.lua
@@ -60,16 +60,16 @@ local function pushVersion(link)
end
local function occlusionPath(str)
- return str:gsub('[^"\r\n]+', function (chunk)
+ return str:gsub('(%s*)([^:"\r\n]+)', function (left, chunk)
if not chunk:find '[/\\]' then
return
end
local newStr, count = chunk:gsub('.+([/\\]script[/\\])', '***%1')
if count > 0 then
- return newStr
- elseif chunk:find '^%u:'
+ return left .. newStr
+ elseif chunk:sub(1, 1) == '\\'
or chunk:sub(1, 1) == '/' then
- return '***'
+ return left .. '***'
end
end)
end
diff --git a/script/vm/getDocs.lua b/script/vm/getDocs.lua
index 59651ee9..4aeda446 100644
--- a/script/vm/getDocs.lua
+++ b/script/vm/getDocs.lua
@@ -11,6 +11,9 @@ local noder = require 'core.noder'
---@param name? string
---@return parser.guide.object[]
function vm.getDocDefines(uri, name)
+ if type(name) ~= 'string' then
+ return {}
+ end
local cache = vm.getCache 'getDocDefines'
if cache[name] then
return cache[name]
diff --git a/script/workspace/require-path.lua b/script/workspace/require-path.lua
index f0a75eb1..56c94424 100644
--- a/script/workspace/require-path.lua
+++ b/script/workspace/require-path.lua
@@ -148,6 +148,9 @@ end
local function removeVisiblePath(uri)
local path = furi.decode(uri)
path = workspace.normalize(path)
+ if not path then
+ return
+ end
for _, scp in ipairs(workspace.folders) do
scp:get('visiblePath')[path] = nil
---@type collector