summaryrefslogtreecommitdiff
path: root/script/provider
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-07-14 17:54:14 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-07-14 17:54:14 +0800
commit9ad3fdce5bd6c889f5734eddd04708595e1fa621 (patch)
tree028fe13842e0b7f40fd189f1109ef8ec1245812c /script/provider
parent0d79784ccf47a03f9f35e1afbd579ecbab0acd5a (diff)
downloadlua-language-server-9ad3fdce5bd6c889f5734eddd04708595e1fa621.zip
`---@source`
Diffstat (limited to 'script/provider')
-rw-r--r--script/provider/provider.lua45
1 files changed, 21 insertions, 24 deletions
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index eb1362eb..18147e80 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -22,6 +22,7 @@ local inspect = require 'inspect'
local markdown = require 'provider.markdown'
local guide = require 'parser.guide'
local fs = require 'bee.filesystem'
+local jumpSource = require 'core.jump-source'
---@async
local function updateConfig(uri)
@@ -376,18 +377,16 @@ m.register 'textDocument/definition' {
for i, info in ipairs(result) do
local targetUri = info.uri
if targetUri then
- if files.exists(targetUri) then
- if client.getAbility 'textDocument.definition.linkSupport' then
- response[i] = converter.locationLink(targetUri
- , converter.packRange(targetUri, info.target.start, info.target.finish)
- , converter.packRange(targetUri, info.target.start, info.target.finish)
- , converter.packRange(uri, info.source.start, info.source.finish)
- )
- else
- response[i] = converter.location(targetUri
- , converter.packRange(targetUri, info.target.start, info.target.finish)
- )
- end
+ if client.getAbility 'textDocument.definition.linkSupport' then
+ response[i] = converter.locationLink(targetUri
+ , converter.packRange(targetUri, info.target.start, info.target.finish)
+ , converter.packRange(targetUri, info.target.start, info.target.finish)
+ , converter.packRange(uri, info.source.start, info.source.finish)
+ )
+ else
+ response[i] = converter.location(targetUri
+ , converter.packRange(targetUri, info.target.start, info.target.finish)
+ )
end
end
end
@@ -418,18 +417,16 @@ m.register 'textDocument/typeDefinition' {
for i, info in ipairs(result) do
local targetUri = info.uri
if targetUri then
- if files.exists(targetUri) then
- if client.getAbility 'textDocument.typeDefinition.linkSupport' then
- response[i] = converter.locationLink(targetUri
- , converter.packRange(targetUri, info.target.start, info.target.finish)
- , converter.packRange(targetUri, info.target.start, info.target.finish)
- , converter.packRange(uri, info.source.start, info.source.finish)
- )
- else
- response[i] = converter.location(targetUri
- , converter.packRange(targetUri, info.target.start, info.target.finish)
- )
- end
+ if client.getAbility 'textDocument.typeDefinition.linkSupport' then
+ response[i] = converter.locationLink(targetUri
+ , converter.packRange(targetUri, info.target.start, info.target.finish)
+ , converter.packRange(targetUri, info.target.start, info.target.finish)
+ , converter.packRange(uri, info.source.start, info.source.finish)
+ )
+ else
+ response[i] = converter.location(targetUri
+ , converter.packRange(targetUri, info.target.start, info.target.finish)
+ )
end
end
end