Repository navigation
Go to the code behind an interface with Go to implementation (gi) - #701
Conversation
Go to definition stops at an interface or abstract declaration. Go to implementation asks the language server for textDocument/implementation and routes the answer as Go to definition does: one jumps, several open the picker titled "Implementations of <Type>.<Member>", decompiled library places included. A server whose initialize result lacks implementationProvider, such as Pyright, is never asked, and the status bar says it can't find them. csharp-ls answers an unimplemented member with its own declaration, so that is left out and the status bar says there are none. Quick info moves to qi / Ctrl+G Q. In the leader, Enter now runs a complete mnemonic that a longer one starts with, so q waits and q Enter quits; every other mnemonic still runs as it's typed. The resolver is handed the whole table so q waits even where qi isn't offered. Closes #699 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Asked for the implementations of an interface member nothing implements, csharp-ls 0.28 answers with the member's own declaration, so gi jumped back to the interface instead of saying there are none. A single answer that is the definition the name comes from now counts as none. The fake server answers the same way, so the "nothing implements it" test covers it. Closes #699 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Needs changing
Worth considering
|
|
Review answered: Needs changing
Worth considering: I've left all three for you. Say if you want any of them done. |
Please fix these. |
…e implementations The status bar uses KnownLanguageServers' title for a server TuiCode knows, and serverInfo.name only for one it doesn't, so "Pyright can't find implementations" no longer depends on what Pyright calls itself. gi now sends textDocument/definition alongside textDocument/implementation instead of after it, and skips documentSymbol when the answer is a single jump that never shows the name. Closes #699 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Both fixed in 259bc6b.
|
In a C# file you can now go from a call through an interface to the code that actually runs. Go to implementation (
Ctrl+G I, mnemonicgi, Go menu) jumps to the only implementation, or opens a picker titledImplementations of IShape.Areawhen there are several. On an interface name it lists the classes that implement it. If nothing implements it, the status bar saysNo implementations of ILogger.Log. Implementations that live in a referenced library open as read-only decompiled source, the same way Go to definition's do.Closes #699
Choices worth flagging:
Ctrl+G Q/qi. In the leader,qnow waits and listsqandqi:q Enterquits andqiopens Quick info. Every other mnemonic still runs as soon as you type it.qwaits even where Quick info isn't offered (in the Explorer, say), so the key you have to press doesn't change depending on where you are.gisays there are none rather than jumping to the method itself. Go to definition already does that jump.implementationProvideris never asked. The status bar says<server> can't find implementations. The name is the one TuiCode knows the server by, so Pyright shows asPyright; only a server TuiCode doesn't know is named by its ownserverInfo.name. I couldn't run Pyright here, so only a test covers that message.IComparable<int>.CompareTo, csharp-ls returns every BCL type that implementsIComparable<T>(79 places in 39 files), and the picker takes about 7 s to open on that query. Most of that is the server's own answer.🤖 Generated with Claude Code
What it looks like
In a C# file, on a call through an interface method with one implementation,
Ctrl+G Iputs the cursor on that implementation, unfolded and below any sticky lines, andCtrl+G Pcomes back.In a C# file, on a call through an interface method with one implementation,
Ctrl+G Iputs the cursor on that implementation, unfolded and below any sticky lines, andCtrl+G Pcomes back.On an interface method with two or more implementations,
Ctrl+G Iopens a picker titledImplementations of <Type>.<Member>, with a Filter text field and one row per implementation (File.cs:12 code on that line).Enteror the Go to button goes to the selected row;Escor Cancel leaves the cursor where it was.On an interface type name,
Ctrl+G Ilists or jumps to the classes that implement it.Where nothing implements it, the status bar says
No implementations of <name>.An implementation that lives in a referenced library opens as read-only decompiled source, as Go to definition's do.
The Go menu lists Go to implementation beside Go to definition with its
Ctrl+G Ihint, and the F1 help lists it.Quick info now opens with
Ctrl+G Qand the mnemonicqi; its Go menu item has hotkeyQand showsCtrl+G Q, and its F1 row says the same.In the leader, typing
qalone no longer quits at once: it waits, listingqandqi.q Enterquits;qiopens Quick info.Checked by the team
screenIn a C# file, on a call through an interface method with one implementation,Ctrl+G Iputs the cursor on that implementation, unfolded and below any sticky lines, andCtrl+G Pcomes back.testTyping the mnemonicgiin the leader does the same.screenOn an interface method with two or more implementations,Ctrl+G Iopens a picker titledImplementations of <Type>.<Member>, with a Filter text field and one row per implementation (File.cs:12 code on that line).Enteror the Go to button goes to the selected row;Escor Cancel leaves the cursor where it was.screenOn an interface type name,Ctrl+G Ilists or jumps to the classes that implement it.screenWhere nothing implements it, the status bar saysNo implementations of <name>.screenAn implementation that lives in a referenced library opens as read-only decompiled source, as Go to definition's do.testIn a Python file served by Pyright, the status bar saysPyright can't find implementationsinstead of reporting none.testWith no language server, or while one is still starting,Ctrl+G Isays whatCtrl+G Dsays, and the Go menu dims Go to implementation as it dims Go to definition.screenThe Go menu lists Go to implementation beside Go to definition with itsCtrl+G Ihint, and the F1 help lists it.screenQuick info now opens withCtrl+G Qand the mnemonicqi; its Go menu item has hotkeyQand showsCtrl+G Q, and its F1 row says the same.screenIn the leader, typingqalone no longer quits at once: it waits, listingqandqi.q Enterquits;qiopens Quick info.testEvery other mnemonic still runs as soon as it's typed, withoutEnter.a-team try tuicode 701