Tencent / LuaHelper

LuaHelper is a High-performance lua VSCode plugin, Language Server Protocol for lua.
Other
633 stars 94 forks source link

当方法里 local 与 self 同名时,修正 self 指向正确的位置,通过 scope 寻找合适的 variable 位置 #111

Closed lalawue closed 2 years ago

lalawue commented 2 years ago

修正下面这样的场景,hover 或 define foo:test() 中的 self:bar() 时,无法定位到 foo:bar()

local AnyLib = require("anylib")
local foo = {}

function foo:test()
    local foo = {}
    self:bar()
end

function foo:bar()
end
yinfei8 commented 2 years ago

非常感谢合入,感谢!

yinfei8 commented 2 years ago

修正下面这样的场景,hover 或 define foo:test() 中的 self:bar() 时,无法定位到 foo:bar()

local AnyLib = require("anylib")
local foo = {}

function foo:test()
    local foo = {}
    self:bar()
end

function foo:bar()
end

感谢合入!