rust-analyzer/crates
bors 3c89945e78 Auto merge of #14098 - pascalkuthe:did_change_workspace_folder, r=Veykril
Support DidChangeWorkspaceFolders notifications

This PR enables the `WorkspaceFoldersServerCapabilities` capability for rust-analyzer and implemented support for the associated [`DidChangeWorkspaceFolders`](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_didChangeWorkspaceFolders) notification to allow clients to update the list of `workspaceFolders` sent during initialization.

## Motivation

This allows clients which lazily autodiscover their workspace roots (like the [helix editor](https://github.com/helix-editor/helix) once [my PR](https://github.com/helix-editor/helix/pull/5748) lands) avoid spawning multiple instances of RA. Right now such clients are forced to either:

* greedily discover all LSP roots in the workspace (precludes the ability to respond to new workspace roots)
* spawn multiple instance of rust-analyzer (one for each root)
* restart rust-analyzer whenever a new workspace is added

Some example use-cases are shown [here](https://github.com/helix-editor/helix/pull/5748#issuecomment-1421012523).

This PR will also improve support for VSCode (and Atom) multi workspaces.

## Implementation

The implementation was fairly straightforward as `rust-analyzer` already supports dynamically reloading workspaces, for example on configuration changes. Furthermore, rust-analyzer also already supports auto-discovering internal workspace from the `workspaceFolders` key in the initialization request. Therefore, the necessary logic just needed to be moved to a central place and reused.
2023-02-08 09:14:01 +00:00
..
base-db Add regression tests 2023-02-05 22:28:03 +09:00
cfg Make tt generic over the span data 2023-01-31 14:58:16 +01:00
flycheck Auto merge of #13969 - Veykril:workspace.dependencies, r=Veykril 2023-01-17 10:29:27 +00:00
hir Auto merge of #14065 - lowr:patch/generate-generic-function, r=Veykril 2023-02-02 09:06:22 +00:00
hir-def Add tests for float access macro call inputs 2023-02-07 17:12:24 +01:00
hir-expand Auto merge of #14036 - Veykril:write-method-resolution, r=Veykril 2023-02-01 10:23:33 +00:00
hir-ty Auto merge of #14099 - Veykril:inlay-hint-loc, r=Veykril 2023-02-08 08:43:10 +00:00
ide Auto merge of #14099 - Veykril:inlay-hint-loc, r=Veykril 2023-02-08 08:43:10 +00:00
ide-assists Auto merge of #13991 - vasilev-alex:add-braces-assist, r=Veykril 2023-02-07 17:12:01 +00:00
ide-completion Add regression tests 2023-02-05 22:28:03 +09:00
ide-db Auto merge of #14065 - lowr:patch/generate-generic-function, r=Veykril 2023-02-02 09:06:22 +00:00
ide-diagnostics Auto merge of #13969 - Veykril:workspace.dependencies, r=Veykril 2023-01-17 10:29:27 +00:00
ide-ssr Auto merge of #13969 - Veykril:workspace.dependencies, r=Veykril 2023-01-17 10:29:27 +00:00
intern Bump once_cell 2023-01-21 08:48:46 +02:00
limit Specify authors, edition and license via workspace.package 2023-01-16 16:44:00 +01:00
mbe Fixup comments 2023-02-07 18:08:05 +01:00
parser Fixup comments 2023-02-07 18:08:05 +01:00
paths Specify authors, edition and license via workspace.package 2023-01-16 16:44:00 +01:00
proc-macro-api Auto merge of #14070 - Veykril:proc-macro-api, r=Veykril 2023-02-03 09:41:24 +00:00
proc-macro-srv Fail spawning proc-macro servers when their api version is newer than r-a's 2023-02-03 10:38:38 +01:00
proc-macro-srv-cli Auto merge of #13969 - Veykril:workspace.dependencies, r=Veykril 2023-01-17 10:29:27 +00:00
proc-macro-test Auto merge of #13969 - Veykril:workspace.dependencies, r=Veykril 2023-01-17 10:29:27 +00:00
profile Bump zip 2023-02-01 19:24:32 +02:00
project-model Auto merge of #14094 - HKalbasi:layout, r=flodiebold 2023-02-06 22:35:37 +00:00
rust-analyzer Support DidChangeWorkspaceFolders capability 2023-02-07 22:40:40 +01:00
sourcegen Specify authors, edition and license via workspace.package 2023-01-16 16:44:00 +01:00
stdx fix: support non-ascii characters in case conversion 2023-02-03 18:11:11 +09:00
syntax Auto merge of #14010 - silvergasp:ci, r=lnicola 2023-02-03 11:15:54 +00:00
test-utils Auto merge of #14036 - Veykril:write-method-resolution, r=Veykril 2023-02-01 10:23:33 +00:00
text-edit Specify authors, edition and license via workspace.package 2023-01-16 16:44:00 +01:00
toolchain Specify authors, edition and license via workspace.package 2023-01-16 16:44:00 +01:00
tt Add tests for float access macro call inputs 2023-02-07 17:12:24 +01:00
vfs fix: Fix process-changes not deduplicating changes correctly 2023-01-25 15:01:15 +01:00
vfs-notify Auto merge of #13969 - Veykril:workspace.dependencies, r=Veykril 2023-01-17 10:29:27 +00:00