summaryrefslogtreecommitdiff
path: root/script-beta
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-11-18 21:07:47 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-11-18 21:07:47 +0800
commit9ad3190aa784bf4830d495ea02f2bc4601ae0b00 (patch)
tree272048ef1b4d465fb4720271e0ff07a58caa512d /script-beta
parent1827e053fa17863a7a3632a731540176648242ae (diff)
downloadlua-language-server-9ad3190aa784bf4830d495ea02f2bc4601ae0b00.zip
meta 文件不要预览上下文
Diffstat (limited to 'script-beta')
-rw-r--r--script-beta/core/completion.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/script-beta/core/completion.lua b/script-beta/core/completion.lua
index 840d4cd7..b466edcd 100644
--- a/script-beta/core/completion.lua
+++ b/script-beta/core/completion.lua
@@ -208,7 +208,10 @@ local function getSnip(source)
local text = files.getText(uri)
local lines = files.getLines(uri)
if not text then
- return nil
+ goto CONTINUE
+ end
+ if vm.isMetaFile(uri) then
+ goto CONTINUE
end
local row = guide.positionOf(lines, def.start)
local firstRow = lines[row]
@@ -216,6 +219,7 @@ local function getSnip(source)
local snip = text:sub(firstRow.start, lastRow.finish)
return snip
end
+ ::CONTINUE::
end
end