Tencent / LuaHelper

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

Configure or Change Autocomplete/Intellisense Behavior #184

Open delscorcho opened 10 months ago

delscorcho commented 10 months ago

Your plugin has been immensely useful and helpful, thank you!

Can you please tell me how the autocompletion/intellisense functionality in the plugin is implemented? Or where it's implemented?

I'm running into cases where it doesn't work, and would like to debug it. In particular, I'd like to make it less strict, since it can't resolve indirection. I'd actually rather it show potentially invalid results rather than be overly strict.

For example, if I have some basic inheritance, it will not resolve functions in the base. This is a contrived example to illustrate the issue.

MyTable = {}
function MyTable:SomeFunction(arg)
end

function DoSomethingWithTable(tbl)
    tbl: <-- Typing "tbl:" does not suggest "SomeFunction", presumably because it has no way to know this is a table, let alone a pointer to 'MyTable'.
end

DoSomethingWithTable(MyTable)

I can understand the limitation, since this kind of indirection is difficult to detect w/o a sophisticated language processor. But is there any way to force it to suggest BaseClassFunction in this case?