summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/src/core/completion.lua13
-rw-r--r--server/test/completion/init.lua8
2 files changed, 6 insertions, 15 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
diff --git a/server/test/completion/init.lua b/server/test/completion/init.lua
index 918195da..fee69e74 100644
--- a/server/test/completion/init.lua
+++ b/server/test/completion/init.lua
@@ -456,29 +456,21 @@ io.read($)
label = '"n"',
kind = CompletionItemKind.EnumMember,
documentation = EXISTS,
- textEdit = EXISTS,
- additionalTextEdits = EXISTS,
},
{
label = '"a"',
kind = CompletionItemKind.EnumMember,
documentation = EXISTS,
- textEdit = EXISTS,
- additionalTextEdits = EXISTS,
},
{
label = '"l"',
kind = CompletionItemKind.EnumMember,
documentation = EXISTS,
- textEdit = EXISTS,
- additionalTextEdits = EXISTS,
},
{
label = '"L"',
kind = CompletionItemKind.EnumMember,
documentation = EXISTS,
- textEdit = EXISTS,
- additionalTextEdits = EXISTS,
},
}