Skip to content

Commit d6a314f

Browse files
committed
支持转到实现
1 parent eda74fd commit d6a314f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# changelog
22

3+
## 3.8.4
4+
* `NEW` goto implementation
5+
36
## 3.8.3
47
`2024-4-23`
58
* `FIX` server may crash when the workspace is using a non-English path.

script/core/implementation.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ local function convertIndex(source)
7878
return source
7979
end
8080

81+
---@async
8182
return function (uri, offset)
8283
local ast = files.getState(uri)
8384
if not ast then
@@ -91,9 +92,12 @@ return function (uri, offset)
9192

9293
local results = {}
9394

94-
local defs = vm.getDefs(source)
95+
local defs = vm.getRefs(source)
9596

9697
for _, src in ipairs(defs) do
98+
if not guide.isAssign(src) then
99+
goto CONTINUE
100+
end
97101
if src.type == 'global' then
98102
goto CONTINUE
99103
end

0 commit comments

Comments
 (0)