diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-11-19 18:30:25 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-11-19 18:30:25 +0800 |
commit | eaa3c93756ab549f0184ebdb2d50c350d904bd70 (patch) | |
tree | b7da4269ec4c56e8d42679a5958984f7d8973b7a /server-beta/src/files.lua | |
parent | e0eef52ac0a819a1c211231f908072562c78caf0 (diff) | |
download | lua-language-server-eaa3c93756ab549f0184ebdb2d50c350d904bd70.zip |
诊断进行一下过滤,以免影响前端的性能
Diffstat (limited to 'server-beta/src/files.lua')
-rw-r--r-- | server-beta/src/files.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/server-beta/src/files.lua b/server-beta/src/files.lua index 076c491b..34c8c2de 100644 --- a/server-beta/src/files.lua +++ b/server-beta/src/files.lua @@ -195,6 +195,28 @@ function m.getOriginUri(uri) return file.uri end +function m.setDiagnostic(uri, diag) + if platform.OS == 'Windows' then + uri = uri:lower() + end + local file = m.fileMap[uri] + if not file then + return + end + file._diag = diag +end + +function m.getDiagnostic(uri) + if platform.OS == 'Windows' then + uri = uri:lower() + end + local file = m.fileMap[uri] + if not file then + return nil + end + return file._diag +end + --- 寻找全局变量 function m.findGlobals(name) local uris = {} |