diff options
author | sumneko <sumneko@hotmail.com> | 2019-05-22 20:37:52 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2019-05-22 20:37:52 +0800 |
commit | de808902586795f0f49badd8df238bb04189c931 (patch) | |
tree | aae577c0c8069290f62d45ab6dafb101c47a6680 /server/src | |
parent | 86a58617a89ea8f8f7070f8767b51d413d0b0266 (diff) | |
download | lua-language-server-de808902586795f0f49badd8df238bb04189c931.zip |
修正bug
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/core/completion.lua | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/server/src/core/completion.lua b/server/src/core/completion.lua index 502d08fa..9afeec2a 100644 --- a/server/src/core/completion.lua +++ b/server/src/core/completion.lua @@ -520,6 +520,12 @@ end local function buildTextEdit(start, finish, str, quo) local text, lquo, rquo, label, filterText + if quo == nil then + local text = str:gsub('\r', '\\r'):gsub('\n', '\\n'):gsub('"', '\\"') + return { + label = '"' .. text .. '"' + } + end if quo == '"' then label = str filterText = str @@ -532,13 +538,6 @@ local function buildTextEdit(start, finish, str, quo) text = str:gsub('\r', '\\r'):gsub('\n', '\\n'):gsub("'", "\\'") lquo = quo rquo = quo - elseif quo == nil then - quo = '' - text = str:gsub('\r', '\\r'):gsub('\n', '\\n'):gsub('"', '\\"') - lquo = quo - rquo = quo - label = '"' .. text .. '"' - filterText = label else label = str filterText = str |