Found this in an Elixir forum thread.
It seems like this only happens with multiple function heads, so we could either default to the first definition or make it configurable.
Update:
The Zed extension is just a passthrough here, it can't filter definition results with the current extension API, so we need to do a fix in Dexter.
When a function has multiple heads (e.g. multiple def foo/1 clauses), Dexter's Definition handler returns all of them as separate Location entries. When Zed receives multiple locations from textDocument/definition, it shows the "find references" picker UI instead of jumping directly.
Fix options (in Dexter):
- Return only the first location - simplest, just results[:1] before converting to locations
- Group by function and return only the first head - slightly smarter, still just one jump target
- Make it configurable - as the issue suggests, let users choose between "first definition" and "all definitions"
I would go with v3
Found this in an Elixir forum thread.
It seems like this only happens with multiple function heads, so we could either default to the first definition or make it configurable.
Update:
The Zed extension is just a passthrough here, it can't filter definition results with the current extension API, so we need to do a fix in Dexter.
When a function has multiple heads (e.g. multiple def foo/1 clauses), Dexter's Definition handler returns all of them as separate Location entries. When Zed receives multiple locations from textDocument/definition, it shows the "find references" picker UI instead of jumping directly.
Fix options (in Dexter):
I would go with v3