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

Best-effort go-to-definition if current arity doesn't match #780

Open
zachallaun opened this issue Jun 25, 2024 · 0 comments
Open

Best-effort go-to-definition if current arity doesn't match #780

zachallaun opened this issue Jun 25, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@zachallaun
Copy link
Collaborator

I was doing a refactor starting at a call site where I removed an argument to a function, so the call went from e.g. arity 4 to arity 3. If you then try to go-to-definition for that call, it fails because name/3 doesn't exist.

In these cases, I think it would be an improvement to go to the definition that does exist, even if the arity doesn't match.

There's a question of which definition to go to. You could say "closest arity", but if you go-to-definition for name/4 and there's a name/3 and name/5, you still have to somewhat-arbitrarily pick. For simplicity, I'm inclined to go to the lowest-arity existing definition for name. This means that it would go to name/0 if that existed, even though it's probably not what you want, but I think it's the most understandable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant