diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-02-18 16:14:18 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-02-18 16:14:18 +0800 |
commit | 9606edaf4de6bf763ad20671e6b6313feeb13e9f (patch) | |
tree | 814f1bc6748ba34f5446dc6e150b978a6bf01c70 /script/service/telemetry.lua | |
parent | c99f2e3c71b81633c08913d2046914f1c69f740b (diff) | |
download | lua-language-server-9606edaf4de6bf763ad20671e6b6313feeb13e9f.zip |
telemetry occlusion path
Diffstat (limited to 'script/service/telemetry.lua')
-rw-r--r-- | script/service/telemetry.lua | 20 |
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 |