docs: Add Kate installation section

This commit is contained in:
Méven Car 2021-05-08 07:33:24 +02:00
parent 9c8763714c
commit b39578d816

View file

@ -383,6 +383,33 @@ If available in PATH or in some standard location, `rust-analyzer` is detected a
If `rust-analyzer` is not detected, Corrosion will prompt you for configuration of your Rust toolchain and language server with a link to the __Window > Preferences > Rust__ preference page; from here a button allows to download and configure `rust-analyzer`, but you can also reference another installation.
You'll need to close and reopen all .rs and Cargo files, or to restart the IDE, for this change to take effect.
=== Kate Text Editor
Support for the language server protocol is built into Kate through the LSP plugin, which is included by default.
It is preconfigured to use Rls for rust sources, but allows you to use rust-analyzer through a simple settings change.
In the LSP Client settings of Kate, copy the content of the third tab "default parameters" to the second tab "server configuration".
Then in the configuration replace:
[source,json]
----
"rust": {
"command": ["rls"],
"rootIndicationFileNames": ["Cargo.lock", "Cargo.toml"],
"url": "https://github.com/rust-lang/rls",
"highlightingModeRegex": "^Rust$"
},
----
With
[source,json]
----
"rust": {
"command": ["rust-analyzer"],
"rootIndicationFileNames": ["Cargo.lock", "Cargo.toml"],
"url": "https://github.com/rust-analyzer/rust-analyzer",
"highlightingModeRegex": "^Rust$"
},
----
Then click on apply, and restart the LSP server for your rust project.
== Configuration
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/rust-analyzer/src/config.rs[config.rs]