LuaLS / LuaLS/lua-language-server

Support for capturing function names

Open
#3,250 3 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.