summaryrefslogtreecommitdiff
path: root/script/service/telemetry.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-02-18 16:14:18 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-02-18 16:14:18 +0800
commit9606edaf4de6bf763ad20671e6b6313feeb13e9f (patch)
tree814f1bc6748ba34f5446dc6e150b978a6bf01c70 /script/service/telemetry.lua
parentc99f2e3c71b81633c08913d2046914f1c69f740b (diff)
downloadlua-language-server-9606edaf4de6bf763ad20671e6b6313feeb13e9f.zip
telemetry occlusion path
Diffstat (limited to 'script/service/telemetry.lua')
-rw-r--r--script/service/telemetry.lua20
1 files changed, 18 insertions, 2 deletions
diff --git a/script/service/telemetry.lua b/script/service/telemetry.lua
index 1b3e2972..d1bf7680 100644
--- a/script/service/telemetry.lua
+++ b/script/service/telemetry.lua
@@ -59,12 +59,28 @@ local function pushVersion(link)
))
end
+local function occlusionPath(str)
+ return str:gsub('[^"\r\n]+', function (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:'
+ or chunk:sub(1, 1) == '/' then
+ return '***'
+ end
+ end)
+end
+
local function pushErrorLog(link)
- if not log.firstError then
+ local err = log.firstError
+ if not err then
return
end
- local err = log.firstError
log.firstError = nil
+ err = occlusionPath(err)
send(link, string.pack('zzzz'
, 'error'
, token