diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-12-05 22:04:17 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-12-05 22:04:17 +0800 |
commit | 9c03601143094f6552a90b7e3f4975594bc00553 (patch) | |
tree | 14fb0c91af7796595d2159162c8021cb20b49512 | |
parent | 19dd94e4af06254595a949a61c9bd05c5a911328 (diff) | |
download | lua-language-server-9c03601143094f6552a90b7e3f4975594bc00553.zip |
Revert "stash"
This reverts commit 19dd94e4af06254595a949a61c9bd05c5a911328.
-rw-r--r-- | script/core/code-action.lua | 31 | ||||
-rw-r--r-- | test.lua | 1 | ||||
-rw-r--r-- | test/code_action/init.lua | 36 |
3 files changed, 0 insertions, 68 deletions
diff --git a/script/core/code-action.lua b/script/core/code-action.lua index 13d5220d..3a7f7374 100644 --- a/script/core/code-action.lua +++ b/script/core/code-action.lua @@ -279,34 +279,6 @@ local function solveDiagnostic(uri, diag, results) disableDiagnostic(uri, diag.code, results) end -local function checkSwapParams(results, uri, start, finish) - local ast = files.getAst(uri) - if not ast then - return - end - local result = guide.eachSourceBetween(ast.ast, start, finish, function (source) - if source.type == 'callargs' then - return { - node = source.parent.node, - args = source, - } - end - if source.type == 'funcargs' then - return { - node = source.parent, - args = source, - } - end - end) - if not result then - return - end -end - -local function checkExtractAsFunction(results, uri, start, finish) - -end - return function (uri, start, finish, diagnostics) local ast = files.getAst(uri) if not ast then @@ -319,8 +291,5 @@ return function (uri, start, finish, diagnostics) solveDiagnostic(uri, diag, results) end - checkSwapParams(results, uri, start, finish) - checkExtractAsFunction(results, uri, start, finish) - return results end @@ -68,7 +68,6 @@ local function main() test 'completion' test 'signature' test 'document_symbol' - test 'code_action' test 'crossfile' test 'full' --test 'other' diff --git a/test/code_action/init.lua b/test/code_action/init.lua deleted file mode 100644 index d3b2d768..00000000 --- a/test/code_action/init.lua +++ /dev/null @@ -1,36 +0,0 @@ -local core = require 'core.code-action' -local files = require 'files' -local lang = require 'language' - -rawset(_G, 'TEST', true) - -function TEST(script) - return function (expect) - files.removeAll() - local start = script:find('<?', 1, true) - local finish = script:find('?>', 1, true) - local pos = (start + finish) // 2 + 1 - local new_script = script:gsub('<[!?]', ' '):gsub('[!?]>', ' ') - files.setText('', new_script) - local results = core('', pos) - assert(results) - assert(expect == results) - end -end - -TEST [[ -print(<?a?>, b, c) -]] -{ - { - title = lang.script.ACTION_SWAP_PARAMS, - kind = 'refactor.rewrite', - edit = { - change = { - ['file:///.lua'] = { - - } - } - } - } -} |