summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-09-23 16:03:37 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-09-23 16:03:37 +0800
commit5fd5881a00a9a3c99ee0b8c9e17d1bd40f1f5309 (patch)
tree6940bca962056bfa592fbe3c7c03c0e12ff1ce6d /script/core
parent466874e8a8e360634833a07508fb48131530b704 (diff)
downloadlua-language-server-5fd5881a00a9a3c99ee0b8c9e17d1bd40f1f5309.zip
cleanup
Diffstat (limited to 'script/core')
-rw-r--r--script/core/completion.lua29
1 files changed, 0 insertions, 29 deletions
diff --git a/script/core/completion.lua b/script/core/completion.lua
index e56ed3f8..bb55506a 100644
--- a/script/core/completion.lua
+++ b/script/core/completion.lua
@@ -225,35 +225,6 @@ local function buildFunction(results, source, value, oop, data)
end
end
-local function buildInsertRequire(state, targetUri, stemName)
- local uri = guide.getUri(state.ast)
- local text = files.getText(uri)
- local start = 1
- for i = 1, #lines do
- local ln = lines[i]
- local lnText = text:sub(ln.start, ln.finish)
- if not lnText:find('require', 1, true) then
- start = ln.start
- break
- end
- end
- local path = furi.decode(targetUri)
- local visiblePaths = rpath.getVisiblePath(path, config.get 'Lua.runtime.path', true)
- if not visiblePaths or #visiblePaths == 0 then
- return nil
- end
- table.sort(visiblePaths, function (a, b)
- return #a.expect < #b.expect
- end)
- return {
- {
- start = start,
- finish = start - 1,
- newText = ('local %s = require %q\n'):format(stemName, visiblePaths[1].expect)
- }
- }
-end
-
local function isSameSource(state, source, pos)
if guide.getUri(source) ~= guide.getUri(state.ast) then
return false