ZIm/crates/project/src
Luis Cossío 7b5fdcee7f
lsp: Support Goto Declaration (#15785)
Adds support for [Goto
Declaration](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_declaration)
LSP command.

I am particularly interested in [this for Rust
projects](https://rust-analyzer.github.io/manual.html#go-to-declaration),
to be able to navigate to the place where a trait method is declared,
coming from a trait method implementation.

I noticed this was something I could do in VSCode before, but was
somehow missing is Zed. Thanks to the already existing infrastructure
for Goto Definition, I just followed and copy-paste-adapted it for Goto
Declaration.

As a bonus, I added `ctrl-F12` and `alt-ctrl-F12` as default macOS
keybindings for `GoToDeclaration` and `GoToDeclarationSplit`,
respectively. They are not keybindings from another editor, but I
figured they made sense to be grouped along with the other *F12
commands.

### Release Notes:

- Added "Go to declaration" editor action.
- vim: Breaking change to keybindings after introduction of the `Go to
declaration` editor action. The new keybindings are the following (and
can be found [here](https://zed.dev/docs/vim), alongside the other key
bindings):
  - `g d` - Go to definition
  - `g D` - Go to declaration
  - `g y` - Go to type definition
  - `g I` - Go to implementation




https://github.com/user-attachments/assets/ee5c10a8-94f0-4e50-afbb-6f71db540c1b

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-08-06 11:20:51 +02:00
..
lsp_command Tidy up collab-related signature help data (#14377) 2024-07-13 04:06:01 +03:00
buffer_store.rs Make git blame for SSH remote projects (#15106) 2024-07-24 15:50:29 -07:00
connection_manager.rs Handle buffer diff base updates and file renames properly for SSH projects (#14989) 2024-07-23 11:32:37 -07:00
debounced_delay.rs Handle buffer diff base updates and file renames properly for SSH projects (#14989) 2024-07-23 11:32:37 -07:00
lsp_command.rs lsp: Support Goto Declaration (#15785) 2024-08-06 11:20:51 +02:00
lsp_ext_command.rs lsp: Revert URL type change (#13193) 2024-06-18 12:39:56 +02:00
prettier_support.rs SSH remoting: terminal & tasks (#15321) 2024-07-28 22:45:00 -06:00
project.rs lsp: Support Goto Declaration (#15785) 2024-08-06 11:20:51 +02:00
project_settings.rs Use US English spelling of "behavior" and "customize" (#15117) 2024-07-24 16:36:01 -04:00
project_tests.rs Remove primary/secondary distinction for CachedLspAdapter (#15634) 2024-08-01 13:51:34 -04:00
search.rs util: Use GlobSet in PathMatcher (#13197) 2024-06-18 16:12:24 +02:00
search_history.rs project search: Persist search history across session (#9932) 2024-04-02 11:13:18 +02:00
task_inventory.rs chore: Clippy fixes for 1.80 (#13987) 2024-07-10 17:53:17 +02:00
terminals.rs SSH remoting: terminal & tasks (#15321) 2024-07-28 22:45:00 -06:00
worktree_store.rs regression: Fix a panic when removing git-containing worktree from the project panel (#15256) 2024-07-26 14:20:59 +03:00
yarn.rs Add support for projects managed with Yarn (#13644) 2024-07-11 14:56:07 +02:00