summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog.md1
-rw-r--r--script/core/completion.lua10
2 files changed, 7 insertions, 4 deletions
diff --git a/changelog.md b/changelog.md
index 14955980..7057ca28 100644
--- a/changelog.md
+++ b/changelog.md
@@ -4,6 +4,7 @@
* `CHG` diagnostic: `unused-function` ignores function with `<close>`
* `CHG` semantic: not cover local call
* `FIX` semantic: tokens may not be updated correctly
+* `FIX` completion: require path broken
* `FIX` [#291](https://github.com/sumneko/lua-language-server/issues/291)
## 1.6.0
diff --git a/script/core/completion.lua b/script/core/completion.lua
index 436a1689..5db4aa1b 100644
--- a/script/core/completion.lua
+++ b/script/core/completion.lua
@@ -806,8 +806,9 @@ local function checkUri(ast, text, offset, results)
if not collect[info.expect] then
collect[info.expect] = {
textEdit = {
- start = source.start + #source[2],
- finish = source.finish - #source[2],
+ start = source.start + #source[2],
+ finish = source.finish - #source[2],
+ newText = info.expect,
}
}
end
@@ -835,8 +836,9 @@ local function checkUri(ast, text, offset, results)
if not collect[path] then
collect[path] = {
textEdit = {
- start = source.start + #source[2],
- finish = source.finish - #source[2],
+ start = source.start + #source[2],
+ finish = source.finish - #source[2],
+ newText = path,
}
}
end