8759: docs: Add Kate installation section r=matklad a=meven

Replaces https://github.com/rust-analyzer/rust-analyzer.github.io/pull/111#issuecomment-834797031

Co-authored-by: Méven Car <meven29@gmail.com>
This commit is contained in:
bors[bot] 2021-05-08 06:04:09 +00:00 committed by GitHub
commit dd12184e4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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]