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.
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 aname/3
andname/5
, you still have to somewhat-arbitrarily pick. For simplicity, I'm inclined to go to the lowest-arity existing definition forname
. This means that it would go toname/0
if that existed, even though it's probably not what you want, but I think it's the most understandable.