rust/crates/rust-analyzer/src
Aleksey Kladov be84f85c1d feat: gate custom clint-side commands behind capabilities
Some features of rust-analyzer requires support for custom commands on
the client side. Specifically, hover & code lens need this.

Stock LSP doesn't have a way for the server to know which client-side
commands are available. For that reason, we historically were just
sending the commands, not worrying whether the client supports then or
not.

That's not really great though, so in this PR we add infrastructure for
the client to explicitly opt-into custom commands, via `extensions`
field of the ClientCapabilities.

To preserve backwards compatability, if the client doesn't set the
field, we assume that it does support all custom commands. In the
future, we'll start treating that case as if the client doesn't support
commands.

So, if you maintain a rust-analyzer client and implement
`rust-analyzer/runSingle` and such, please also advertise this via a
capability.
2021-07-30 19:16:33 +03:00
..
bin refactor logger flushing 2021-07-05 21:37:17 +04:30
cli remove debug prints 2021-07-19 16:38:36 +03:00
diagnostics internal: a bit more of cwd safety for flycheck 2021-07-17 18:13:35 +03:00
caps.rs feat: Add the Hover Range server capability 2021-07-27 18:31:21 -04:00
cargo_target_spec.rs internal: use types to remove some unwraps 2021-07-19 21:20:10 +03:00
cli.rs Prime caches on workspace load 2021-06-11 02:00:03 +03:00
config.rs feat: gate custom clint-side commands behind capabilities 2021-07-30 19:16:33 +03:00
diagnostics.rs clippy::redudant_borrow 2021-06-13 09:24:16 +05:30
diff.rs Split textDocument/formatting TextEdit with diff 2020-12-31 15:33:20 +01:00
dispatch.rs clippy::useless_return 2021-06-13 09:35:29 +05:30
from_proto.rs internal: unfork code paths for unresolved and resolved assist 2021-04-13 10:59:15 +03:00
global_state.rs internal: prepare to track changes to mem_docs 2021-07-26 20:17:10 +03:00
handlers.rs feat: gate custom clint-side commands behind capabilities 2021-07-30 19:16:33 +03:00
integrated_benchmarks.rs internal: simplify handling of the build scripts 2021-07-18 11:29:22 +03:00
lib.rs internal: prepare to track changes to mem_docs 2021-07-26 20:17:10 +03:00
line_index.rs Fix bitrotted module name 2021-02-16 19:17:32 +03:00
lsp_ext.rs feat: gate custom clint-side commands behind capabilities 2021-07-30 19:16:33 +03:00
lsp_utils.rs clippy::redudant_borrow 2021-06-13 09:24:16 +05:30
main_loop.rs refactor: Make handle_hover handle ranges too 2021-07-27 18:29:22 -04:00
markdown.rs Check for rust doc code attributes like rustdoc does 2021-04-19 13:32:52 +02:00
mem_docs.rs fix: correctly update diagnostics when files are opened and closed 2021-07-26 21:22:06 +03:00
op_queue.rs internal: simplify handling of the build scripts 2021-07-18 11:29:22 +03:00
reload.rs internal: prepare to track changes to mem_docs 2021-07-26 20:17:10 +03:00
request_metrics.rs Flatten module hierarchy 2020-06-24 18:57:30 +02:00
semantic_tokens.rs Resolve attribute paths in attribute highlighting 2021-06-28 21:53:17 +02:00
thread_pool.rs Improve prime_caches and display its progress 2020-10-12 13:35:01 +02:00
to_proto.rs feat: gate custom clint-side commands behind capabilities 2021-07-30 19:16:33 +03:00