Skip to content

Commit 4de9d6f

Browse files
committed
completion: show words in string
1 parent fc5716f commit 4de9d6f

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* `NEW` folding: `---@class` and docs of function
66
* `CHG` supports `~` in command line
77
* `CHG` completion: improve workspace words
8+
* `CHG` completion: show words in string
89
* `FIX` [#339](https://github.com/sumneko/lua-language-server/issues/339)
910

1011
## 1.9.0

script/core/completion.lua

+5
Original file line numberDiff line numberDiff line change
@@ -1158,6 +1158,11 @@ local function tryWord(ast, text, offset, results)
11581158
end
11591159
local hasSpace = finish ~= offset
11601160
if isInString(ast, offset) then
1161+
if not hasSpace then
1162+
if #results == 0 then
1163+
checkCommon(ast, word, text, offset, results)
1164+
end
1165+
end
11611166
else
11621167
local parent, oop = findParent(ast, text, start - 1)
11631168
if parent then

test/completion/init.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ local ast = 1
905905
local t = 'as$'
906906
local ask = 1
907907
]]
908-
(nil)
908+
(EXISTS)
909909

910910
TEST [[
911911
local add

0 commit comments

Comments
 (0)