summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-05-22 20:37:52 +0800
committersumneko <sumneko@hotmail.com>2019-05-22 20:37:52 +0800
commitde808902586795f0f49badd8df238bb04189c931 (patch)
treeaae577c0c8069290f62d45ab6dafb101c47a6680 /server/src
parent86a58617a89ea8f8f7070f8767b51d413d0b0266 (diff)
downloadlua-language-server-de808902586795f0f49badd8df238bb04189c931.zip
修正bug
Diffstat (limited to 'server/src')
-rw-r--r--server/src/core/completion.lua13
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