diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-09-16 17:58:42 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-09-16 17:58:42 +0800 |
commit | 8398aa93fc8e92eda1ee259ebe256d8eda820e09 (patch) | |
tree | 6d637b85af910e35ec077ff2aad4e86551696c47 /test-beta/crossfile | |
parent | f0e3b9d18c95af0f5f8581bbc0ab46bd882337d4 (diff) | |
download | lua-language-server-8398aa93fc8e92eda1ee259ebe256d8eda820e09.zip |
修正一些bug
Diffstat (limited to 'test-beta/crossfile')
-rw-r--r-- | test-beta/crossfile/completion.lua | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/test-beta/crossfile/completion.lua b/test-beta/crossfile/completion.lua index 0e344a5b..6ac45c29 100644 --- a/test-beta/crossfile/completion.lua +++ b/test-beta/crossfile/completion.lua @@ -95,10 +95,14 @@ function TEST(data) item[k] = v end for k in pairs(item) do - if not Cared[k] then + if not Cared[k] then item[k] = nil end end + if item['description'] then + item['description'] = item['description'] + : gsub('\r\n', '\n') + end end assert(result) assert(eq(expect, result)) @@ -542,3 +546,34 @@ TEST { }, } } + +Cared['description'] = true +TEST { + { + path = [[a.lua]], + content = [[ + local m = {} + + return m + ]] + }, + { + path = 'main.lua', + content = [[ + local z = require 'a' + + z$ + ]], + main = true, + }, + completion = { + { + label = 'z', + kind = CompletionItemKind.Variable, + description = [[ +```lua +local z: {} +```]] + }, + } +} |