diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-11-11 19:47:09 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-11-11 19:47:09 +0800 |
commit | cf646670972e75d38fbbd7f18e9ccf47de73f3fc (patch) | |
tree | ed7a65c8391fbf799bb79300e41b69c332c9ad0e | |
parent | 644b1a4e9f256f78bef75d288cba7a02c75ddfb7 (diff) | |
download | lua-language-server-cf646670972e75d38fbbd7f18e9ccf47de73f3fc.zip |
修改 hover enum 的格式
-rw-r--r-- | script-beta/core/hover/description.lua | 4 | ||||
-rw-r--r-- | test-beta/crossfile/hover.lua | 16 |
2 files changed, 10 insertions, 10 deletions
diff --git a/script-beta/core/hover/description.lua b/script-beta/core/hover/description.lua index 31d5bf58..3f39d959 100644 --- a/script-beta/core/hover/description.lua +++ b/script-beta/core/hover/description.lua @@ -207,8 +207,8 @@ local function buildEnumChunk(docType, name) local lines = {} lines[#lines+1] = ('%s: %s'):format(name, table.concat(types)) for _, enum in ipairs(enums) do - lines[#lines+1] = (' |%s%s%s'):format( - enum.default and '>' or ' ', + lines[#lines+1] = (' %s %s%s'):format( + enum.default and '->' or ' |', enum[1], enum.comment and (' -- %s'):format(enum.comment) or '' ) diff --git a/test-beta/crossfile/hover.lua b/test-beta/crossfile/hover.lua index fd11481d..9fc21461 100644 --- a/test-beta/crossfile/hover.lua +++ b/test-beta/crossfile/hover.lua @@ -314,8 +314,8 @@ TEST { description = [[ ```lua x: string - | '选项1' -- 注释1 - |>'选项2' -- 注释2 + | '选项1' -- 注释1 + -> '选项2' -- 注释2 ```]] } } @@ -341,8 +341,8 @@ TEST { description = [[ ```lua x: option - | '选项1' -- 注释1 - |>'选项2' -- 注释2 + | '选项1' -- 注释1 + -> '选项2' -- 注释2 ```]] } } @@ -370,8 +370,8 @@ function f() description = [[ ```lua x: option - | '选项1' -- 注释1 - |>'选项2' -- 注释2 + | '选项1' -- 注释1 + -> '选项2' -- 注释2 ```]] } } @@ -399,8 +399,8 @@ function f() description = [[ ```lua (return 1): option - | '选项1' -- 注释1 - |>'选项2' -- 注释2 + | '选项1' -- 注释1 + -> '选项2' -- 注释2 ```]] } } |