From c0fa5e2246457df10e92c2e11c971f2f40921793 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 18 Feb 2020 12:33:16 +0100 Subject: Rename the binary to rust-analyzer --- docs/dev/README.md | 18 +++++++++--------- docs/dev/architecture.md | 6 +++--- docs/dev/debugging.md | 16 ++++++++-------- docs/user/readme.adoc | 8 ++++---- 4 files changed, 24 insertions(+), 24 deletions(-) (limited to 'docs') diff --git a/docs/dev/README.md b/docs/dev/README.md index ba24524f2..9da2eb014 100644 --- a/docs/dev/README.md +++ b/docs/dev/README.md @@ -80,7 +80,7 @@ In general, I use one of the following workflows for fixing bugs and implementing features. If the problem concerns only internal parts of rust-analyzer (ie, I don't need -to touch `ra_lsp_server` crate or typescript code), there is a unit-test for it. +to touch `rust-analyzer` crate or typescript code), there is a unit-test for it. So, I use **Rust Analyzer: Run** action in VS Code to run this single test, and then just do printf-driven development/debugging. As a sanity check after I'm done, I use `cargo xtask install --server` and **Reload Window** action in VS @@ -88,17 +88,17 @@ Code to sanity check that the thing works as I expect. If the problem concerns only the VS Code extension, I use **Run Extension** launch configuration from `launch.json`. Notably, this uses the usual -`ra_lsp_server` binary from `PATH`. For this it is important to have the following +`rust-analyzer` binary from `PATH`. For this it is important to have the following in `setting.json` file: ```json { - "rust-analyzer.raLspServerPath": "ra_lsp_server" + "rust-analyzer.raLspServerPath": "rust-analyzer" } ``` After I am done with the fix, I use `cargo xtask install --client-code` to try the new extension for real. -If I need to fix something in the `ra_lsp_server` crate, I feel sad because it's +If I need to fix something in the `rust-analyzer` crate, I feel sad because it's on the boundary between the two processes, and working there is slow. I usually just `cargo xtask install --server` and poke changes from my live environment. Note that this uses `--release`, which is usually faster overall, because @@ -113,7 +113,7 @@ communication, and `print!` would break it. If I need to fix something simultaneously in the server and in the client, I feel even more sad. I don't have a specific workflow for this case. -Additionally, I use `cargo run --release -p ra_lsp_server -- analysis-stats +Additionally, I use `cargo run --release -p rust-analyzer -- analysis-stats path/to/some/rust/crate` to run a batch analysis. This is primarily useful for performance optimizations, or for bug minimization. @@ -148,7 +148,7 @@ There's also two VS Code commands which might be of interest: * `Rust Analyzer: Status` shows some memory-usage statistics. To take full advantage of it, you need to compile rust-analyzer with jemalloc support: ``` - $ cargo install --path crates/ra_lsp_server --force --features jemalloc + $ cargo install --path crates/rust-analyzer --force --features jemalloc ``` There's an alias for this: `cargo xtask install --server --jemalloc`. @@ -170,12 +170,12 @@ In particular, I have `export RA_PROFILE='*>10'` in my shell profile. To measure time for from-scratch analysis, use something like this: ``` -$ cargo run --release -p ra_lsp_server -- analysis-stats ../chalk/ +$ cargo run --release -p rust-analyzer -- analysis-stats ../chalk/ ``` For measuring time of incremental analysis, use either of these: ``` -$ cargo run --release -p ra_lsp_server -- analysis-bench ../chalk/ --highlight ../chalk/chalk-engine/src/logic.rs -$ cargo run --release -p ra_lsp_server -- analysis-bench ../chalk/ --complete ../chalk/chalk-engine/src/logic.rs:94:0 +$ cargo run --release -p rust-analyzer -- analysis-bench ../chalk/ --highlight ../chalk/chalk-engine/src/logic.rs +$ cargo run --release -p rust-analyzer -- analysis-bench ../chalk/ --complete ../chalk/chalk-engine/src/logic.rs:94:0 ``` diff --git a/docs/dev/architecture.md b/docs/dev/architecture.md index 41c3909f7..0343b6c81 100644 --- a/docs/dev/architecture.md +++ b/docs/dev/architecture.md @@ -134,7 +134,7 @@ APIs in this crate are IDE centric: they take text offsets as input and produce offsets and strings as output. This works on top of rich code model powered by `hir`. -### `crates/ra_lsp_server` +### `crates/rust-analyzer` An LSP implementation which wraps `ra_ide` into a language server protocol. @@ -153,7 +153,7 @@ Rust Analyzer has three interesting [systems boundaries](https://www.tedinski.com/2018/04/10/making-tests-a-positive-influence-on-design.html) to concentrate tests on. -The outermost boundary is the `ra_lsp_server` crate, which defines an LSP +The outermost boundary is the `rust-analyzer` crate, which defines an LSP interface in terms of stdio. We do integration testing of this component, by feeding it with a stream of LSP requests and checking responses. These tests are known as "heavy", because they interact with Cargo and read real files from @@ -162,7 +162,7 @@ in a statically typed language, it's hard to make an error in the protocol itself if messages are themselves typed. The middle, and most important, boundary is `ra_ide`. Unlike -`ra_lsp_server`, which exposes API, `ide` uses Rust API and is intended to +`rust-analyzer`, which exposes API, `ide` uses Rust API and is intended to use by various tools. Typical test creates an `AnalysisHost`, calls some `Analysis` functions and compares the results against expectation. diff --git a/docs/dev/debugging.md b/docs/dev/debugging.md index e6b082156..bece6a572 100644 --- a/docs/dev/debugging.md +++ b/docs/dev/debugging.md @@ -22,8 +22,8 @@ where **only** the `rust-analyzer` extension being debugged is enabled. ## Debug TypeScript VSCode extension -- `Run Extension` - runs the extension with the globally installed `ra_lsp_server` binary. -- `Run Extension (Dev Server)` - runs extension with the locally built LSP server (`target/debug/ra_lsp_server`). +- `Run Extension` - runs the extension with the globally installed `rust-analyzer` binary. +- `Run Extension (Dev Server)` - runs extension with the locally built LSP server (`target/debug/rust-analyzer`). TypeScript debugging is configured to watch your source edits and recompile. To apply changes to an already running debug process press Ctrl+Shift+P and run the following command in your `[Extension Development Host]` @@ -47,13 +47,13 @@ To apply changes to an already running debug process press Ctrl+Shift+PCtrl+Shift+P