summaryrefslogtreecommitdiff
path: root/script/provider
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-11-02 17:29:18 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-11-02 17:29:18 +0800
commit625f5be9a6ae1c30dd5821f1dd2485073d054209 (patch)
tree2581abc44fa0b6a42b590fc842501b8a9edf9a1f /script/provider
parent3bf48c900605681216ce7c14cfe0cb43e583de4f (diff)
downloadlua-language-server-625f5be9a6ae1c30dd5821f1dd2485073d054209.zip
`---@see` use workspace-symbol
#1344
Diffstat (limited to 'script/provider')
-rw-r--r--script/provider/provider.lua13
1 files changed, 7 insertions, 6 deletions
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index 8e99b354..9fede5cc 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -954,25 +954,26 @@ m.register 'workspace/symbol' {
local _ <close> = progress.create(workspace.getFirstScope().uri, lang.script.WINDOW_PROCESSING_WS_SYMBOL, 0.5)
local core = require 'core.workspace-symbol'
- local symbols = core(params.query)
+ local symbols = core(params.query, true)
if not symbols or #symbols == 0 then
return nil
end
local function convert(symbol)
- local state = files.getState(symbol.uri)
+ local uri = guide.getUri(symbol.source)
+ local state = files.getState(uri)
if not state then
return nil
end
return {
name = symbol.name,
- kind = symbol.kind,
+ kind = symbol.skind,
location = converter.location(
- symbol.uri,
+ uri,
converter.packRange(
state,
- symbol.range[1],
- symbol.range[2]
+ symbol.source.start,
+ symbol.source.finish
)
)
}