summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog.md3
-rw-r--r--locale/en-us/script.lua1
-rw-r--r--locale/zh-cn/script.lua1
-rw-r--r--script/config.lua1
-rw-r--r--script/core/guide.lua11
-rw-r--r--script/proto/define.lua3
6 files changed, 15 insertions, 5 deletions
diff --git a/changelog.md b/changelog.md
index a4e2da3a..8c996f2b 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,8 +1,9 @@
# changelog
## 1.20.5
+`NEW` setting: `completion.autoRequire`
+`NEW` setting: `hover.enumsLimit`
`CHG` folding: supports `-- #region`
-`CHG` completion: `auto require` can be disabled
`FIX` [#522](https://github.com/sumneko/lua-language-server/issues/522)
`FIX` [#523](https://github.com/sumneko/lua-language-server/issues/523)
diff --git a/locale/en-us/script.lua b/locale/en-us/script.lua
index 6ab52156..69f97bb1 100644
--- a/locale/en-us/script.lua
+++ b/locale/en-us/script.lua
@@ -154,6 +154,7 @@ HOVER_STRING_BYTES = '{} bytes'
HOVER_STRING_CHARACTERS = '{} bytes, {} characters'
HOVER_MULTI_DEF_PROTO = '({} definitions, {} prototypes)'
HOVER_MULTI_PROTO_NOT_FUNC = '({} non functional definition)'
+HOVER_MORE_ENUMS = '|...(+{})'
HOVER_USE_LUA_PATH = '(Search path: `{}`)'
HOVER_EXTENDS = 'Expand to {}'
diff --git a/locale/zh-cn/script.lua b/locale/zh-cn/script.lua
index fa4dd36c..e949ad31 100644
--- a/locale/zh-cn/script.lua
+++ b/locale/zh-cn/script.lua
@@ -153,6 +153,7 @@ HOVER_STRING_BYTES = '{} 个字节'
HOVER_STRING_CHARACTERS = '{} 个字节,{} 个字符'
HOVER_MULTI_DEF_PROTO = '({} 个定义,{} 个原型)'
HOVER_MULTI_PROTO_NOT_FUNC = '({} 个非函数定义)'
+HOVER_MORE_ENUMS = '|...(+{})'
HOVER_USE_LUA_PATH = '(搜索路径: `{}`)'
HOVER_EXTENDS = '展开为 {}'
diff --git a/script/config.lua b/script/config.lua
index a133cf1c..8bc05b98 100644
--- a/script/config.lua
+++ b/script/config.lua
@@ -176,6 +176,7 @@ local ConfigTemplate = {
viewNumber = {true, Boolean},
fieldInfer = {3000, Integer},
previewFields = {100, Integer},
+ enumsLimit = {5, Integer},
},
color = {
mode = {'Semantic', String},
diff --git a/script/core/guide.lua b/script/core/guide.lua
index b80a3628..367b91e2 100644
--- a/script/core/guide.lua
+++ b/script/core/guide.lua
@@ -1,4 +1,6 @@
local util = require 'utility'
+local config = require 'config'
+local lang = require 'language'
local error = error
local type = type
local next = next
@@ -3396,7 +3398,14 @@ function m.mergeTypes(types)
end
end)
- return tableConcat(results, '|')
+ local enumsLimit = config.config.hover.enumsLimit
+ if #results > enumsLimit then
+ return tableConcat(results, '|', 1, enumsLimit)
+ .. lang.script('HOVER_MORE_ENUMS', #results - enumsLimit)
+ else
+ return tableConcat(results, '|')
+ end
+
end
function m.getClassExtends(class)
diff --git a/script/proto/define.lua b/script/proto/define.lua
index 15e434de..abfaa9b0 100644
--- a/script/proto/define.lua
+++ b/script/proto/define.lua
@@ -1,6 +1,3 @@
-local guide = require 'core.guide'
-local util = require 'utility'
-
local m = {}
---@alias location table