summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-11-05 15:18:48 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-11-05 15:18:48 +0800
commit9c931e98e13ac7e781f1b7ddbfbb1d3daa1c33cf (patch)
tree4596bc3abf6924f5d68d3109263449aaa16bdf6f
parent4faf234224537a71a5f0ead902079ecb1b0d2044 (diff)
downloadlua-language-server-9c931e98e13ac7e781f1b7ddbfbb1d3daa1c33cf.zip
修正一些问题
-rw-r--r--script-beta/core/completion.lua4
-rw-r--r--script-beta/core/hover/table.lua1
-rw-r--r--script-beta/files.lua2
-rw-r--r--script-beta/parser/guide.lua2
4 files changed, 6 insertions, 3 deletions
diff --git a/script-beta/core/completion.lua b/script-beta/core/completion.lua
index 75e8a470..2635f2bf 100644
--- a/script-beta/core/completion.lua
+++ b/script-beta/core/completion.lua
@@ -1205,6 +1205,10 @@ local function completion(uri, offset)
local results = {}
clearStack()
vm.setSearchLevel(3)
+ guide.searchMax = 1000
+ local _ <close> = util.defer(function ()
+ guide.searchMax = nil
+ end)
if ast then
if getComment(ast, offset) then
tryLuaDoc(ast, text, offset, results)
diff --git a/script-beta/core/hover/table.lua b/script-beta/core/hover/table.lua
index 145f3c08..35a5f337 100644
--- a/script-beta/core/hover/table.lua
+++ b/script-beta/core/hover/table.lua
@@ -277,7 +277,6 @@ return function (source)
result = buildAsHash(classes, literals)
end
if timeUp then
- result = '\n--出于性能考虑,已禁用了部分类型推断。\n' .. result
result = ('\n--%s\n%s'):format(lang.script.HOVER_TABLE_TIME_UP, result)
end
return result
diff --git a/script-beta/files.lua b/script-beta/files.lua
index 873d859e..06e598ee 100644
--- a/script-beta/files.lua
+++ b/script-beta/files.lua
@@ -203,7 +203,7 @@ function m.eachFile()
end
function m.compileAst(uri, text)
- if #text >= config.config.workspace.preloadFileSize * 1000 then
+ if not m.isOpen(uri) and #text >= config.config.workspace.preloadFileSize * 1000 then
if not m.notifyCache['preloadFileSize'] then
m.notifyCache['preloadFileSize'] = {}
m.notifyCache['skipLargeFileCount'] = 0
diff --git a/script-beta/parser/guide.lua b/script-beta/parser/guide.lua
index f52e9545..0c9ec43d 100644
--- a/script-beta/parser/guide.lua
+++ b/script-beta/parser/guide.lua
@@ -2083,7 +2083,7 @@ function m.searchSameFields(status, simple, mode)
max = max + 1
status.cache.count = status.cache.count + 1
m.checkSameSimple(status, simple, data, mode, status.results, queue)
- if max >= 10000 then
+ if max >= (m.searchMax or 10000) then
logWarn('Queue too large!')
break
end