LuaLS / LuaLS/lua-language-server
Support for capturing function names
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 4.4k
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
Description
Similar to how you can capture class names in generics and annotate a function to then return that class it would be cool if you could do the same for functions. In a modloader we have a hooking function like this:
hook(object, "function_name", function(...) end)
which makes a function run after the hooked function on an object with the same parameters as the original function.
I understand if thats too much effort to implement but it would be nice if it was somehow possible to annotate the second argument of the hook function to be the name of a function on object.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing support for capturing class names in generics and annotating function arguments. Then determine how the hook function's second string argument could resolve to a function on the object and preserve the original function parameters. Done means the language server can infer and expose the hooked function name for this pattern.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100