summaryrefslogtreecommitdiff
path: root/server-beta/src
diff options
context:
space:
mode:
Diffstat (limited to 'server-beta/src')
-rw-r--r--server-beta/src/core/definition.lua2
-rw-r--r--server-beta/src/parser/compile.lua2
-rw-r--r--server-beta/src/proto/provider.lua7
-rw-r--r--server-beta/src/searcher/eachRef.lua3
4 files changed, 8 insertions, 6 deletions
diff --git a/server-beta/src/core/definition.lua b/server-beta/src/core/definition.lua
index 1c2adf3e..9e69d27f 100644
--- a/server-beta/src/core/definition.lua
+++ b/server-beta/src/core/definition.lua
@@ -19,7 +19,7 @@ local function findDef(source, callback)
end
searcher.eachRef(source, function (info)
if info.mode == 'declare'
- or info.mode == 'set'
+ or info.mode == 'set'
or info.mode == 'return' then
local src = info.source
local root = guide.getRoot(src)
diff --git a/server-beta/src/parser/compile.lua b/server-beta/src/parser/compile.lua
index 9f92fb53..9db0c3e3 100644
--- a/server-beta/src/parser/compile.lua
+++ b/server-beta/src/parser/compile.lua
@@ -338,11 +338,11 @@ function Compile(obj, parent)
return
end
Compiled[obj] = true
+ obj.parent = parent
local f = vmMap[obj.type]
if not f then
return
end
- obj.parent = parent
f(obj)
end
diff --git a/server-beta/src/proto/provider.lua b/server-beta/src/proto/provider.lua
index 1799a284..9f3b5697 100644
--- a/server-beta/src/proto/provider.lua
+++ b/server-beta/src/proto/provider.lua
@@ -163,10 +163,11 @@ proto.on('textDocument/definition', function (params)
for i, info in ipairs(result) do
local targetUri = info.uri
local targetLines = files.getLines(targetUri)
+ local targetText = files.getText(targetUri)
response[i] = interface.locationLink(targetUri
- , interface.range(targetLines, text, info.target.start - 1, info.target.finish)
- , interface.range(targetLines, text, info.target.start - 1, info.target.finish)
- , interface.range(lines , text, info.source.start - 1, info.source.finish)
+ , interface.range(targetLines, targetText, info.target.start - 1, info.target.finish)
+ , interface.range(targetLines, targetText, info.target.start - 1, info.target.finish)
+ , interface.range(lines, text, info.source.start - 1, info.source.finish)
)
end
return response
diff --git a/server-beta/src/searcher/eachRef.lua b/server-beta/src/searcher/eachRef.lua
index 48c266bc..4cefa405 100644
--- a/server-beta/src/searcher/eachRef.lua
+++ b/server-beta/src/searcher/eachRef.lua
@@ -51,7 +51,7 @@ local function ofSpecialCall(call, func, index, callback)
local result = workspace.findUrisByRequirePath(literal, true)
local myUri = guide.getRoot(call).uri
for _, uri in ipairs(result) do
- if uri ~= myUri then
+ if not files.eq(uri, myUri) then
local ast = files.getAst(uri)
if ast then
searcher.eachRef(ast.ast, callback)
@@ -78,6 +78,7 @@ local function ofValue(value, callback)
source = value,
mode = 'value',
}
+ searcher.eachRef(value, callback)
end
local function ofSelf(loc, callback)