From 5fd5881a00a9a3c99ee0b8c9e17d1bd40f1f5309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 23 Sep 2021 16:03:37 +0800 Subject: cleanup --- script/core/completion.lua | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'script/core') 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 -- cgit v1.2.3