-
-
Couldn't load subscription status.
- Fork 384
Open
Description
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Windows
What is the issue affecting?
Plugins
Expected Behaviour
这是正常的表现
当我在插件写这样的代码的时候
function OnTransformAst(uri, ast)
guide.eachSourceType(ast, "call", function (source)
local node = source.node
if not guide.isGet(node) then
return
end
if not guide.isGlobal(node) then
return
end
if guide.getKeyName(node) ~= 'Class' then
return
end
local wants = {
['local'] = true,
['setglobal'] = true
}
local classnameNode = guide.getParentTypes(source, wants)
if not classnameNode then
return
end
local classname = guide.getKeyName(classnameNode)
if classname then
local group = {}
helper.addClassDoc(ast, classnameNode, classname, group)
helper.addDoc(ast, classnameNode, "field", "a string", group)
helper.addDoc(ast, classnameNode, "field", "b string", group)
helper.addDoc(ast, classnameNode, "field", "c string", group)
end
end)
end
样式会变成这样
Actual Behaviour
另外,如果这个时候对着变量按F2重命名,会出现field的名称,
或者按ctrl对着某个地方跳转,也可以跳转到定义
也就是虚拟的comment会被选中
Metadata
Metadata
Assignees
Labels
No labels