Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't mark local X = require() as a definition when doing Go To Definition #878

Closed
JohnnyMorganz opened this issue Dec 24, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@JohnnyMorganz
Copy link
Owner

In an example like:

-- useFunction.luau
return function(...)
end

-- MyExample.luau
local useFunction = require(path.to.useFunction)

local x = useFunction(...)

If you perform go to definition on useFunction in the last line, it will give 2 results: the actual function definition from useFunction.luau, but also the line local useFunction = require(...).

The latter result is not helpful, and makes the go to definition a longer process than necessary (VSCode will pop up a lens displaying the 2 definitions, then you have to click through to the right one).

We should make go to definition only return the underlying definition. The local useFunction = require(...) should only show up when we want to find all references.

@JohnnyMorganz JohnnyMorganz added the enhancement New feature or request label Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant