summaryrefslogtreecommitdiff
path: root/script/provider/provider.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-10-17 17:00:51 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-10-17 17:00:51 +0800
commit12809be7f931ecf606b32b95665d8e3251e0b81f (patch)
tree5de856297f6a9eb4225750264e7de18469d98add /script/provider/provider.lua
parentbfb576d3eba9f12bb582a9f7e942c5eac387fe2b (diff)
downloadlua-language-server-12809be7f931ecf606b32b95665d8e3251e0b81f.zip
fix
Diffstat (limited to 'script/provider/provider.lua')
-rw-r--r--script/provider/provider.lua24
1 files changed, 10 insertions, 14 deletions
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index fb16c2c6..2225588a 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -1329,32 +1329,28 @@ m.register 'textDocument/inlayHint' {
local results = core(uri, start, finish)
local hintResults = {}
for i, res in ipairs(results) do
- local luri = guide.getUri(res.source)
+ local luri = res.source and guide.getUri(res.source)
local lstate = files.getState(luri)
- if not lstate then
- goto CONTINUE
- end
- hintResults[#hintResults+1] = {
+ hintResults[i] = {
label = {
{
value = res.text,
tooltip = res.tooltip,
- location = res.source and converter.location(
+ location = lstate and converter.location(
luri,
- converter.packRange(
- lstate,
- res.source.start,
- res.source.finish
- )
- ),
+ converter.packRange(
+ lstate,
+ res.source.start,
+ res.source.finish
+ )
+ ),
},
},
- position = converter.packPosition(lstate, res.offset),
+ position = converter.packPosition(state, res.offset),
kind = res.kind,
paddingLeft = true,
paddingRight = true,
}
- ::CONTINUE::
end
return hintResults
end