diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-11-20 21:55:41 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-11-20 21:55:41 +0800 |
commit | c63b2e404d8d2bb984afe3678a5ba2b2836380cc (patch) | |
tree | a70661effacc7a29caa8d49583673ac4be2faaf5 /script/method/textDocument/documentHighlight.lua | |
parent | 85c5a4210e4447422cd5677369ae740ed65725a0 (diff) | |
download | lua-language-server-c63b2e404d8d2bb984afe3678a5ba2b2836380cc.zip |
remove the old version
Diffstat (limited to 'script/method/textDocument/documentHighlight.lua')
-rw-r--r-- | script/method/textDocument/documentHighlight.lua | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/script/method/textDocument/documentHighlight.lua b/script/method/textDocument/documentHighlight.lua deleted file mode 100644 index 2a6768f2..00000000 --- a/script/method/textDocument/documentHighlight.lua +++ /dev/null @@ -1,40 +0,0 @@ -local core = require 'core' - ---- @param lsp LSP ---- @param params table ---- @return table -return function (lsp, params) - local uri = params.textDocument.uri - local vm, lines = lsp:loadVM(uri) - if not vm then - return nil - end - local position = lines:positionAsChar(params.position.line + 1, params.position.character) - local positions = core.highlight(vm, position) - if not positions then - return nil - end - - local result = {} - for i, position in ipairs(positions) do - local start, finish = position[1], position[2] - local start_row, start_col = lines:rowcol(start) - local finish_row, finish_col = lines:rowcol(finish) - result[i] = { - range = { - start = { - line = start_row - 1, - character = start_col - 1, - }, - ['end'] = { - line = finish_row - 1, - -- 这里不用-1,因为前端期待的是匹配完成后的位置 - character = finish_col, - }, - }, - kind = position[3], - } - end - - return result -end |