From c0fa5e2246457df10e92c2e11c971f2f40921793 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 18 Feb 2020 12:33:16 +0100 Subject: [PATCH 1/3] Rename the binary to rust-analyzer --- .github/workflows/release.yaml | 22 +++--- .vscode/launch.json | 4 +- .vscode/tasks.json | 2 +- Cargo.lock | 76 +++++++++---------- README.md | 2 +- crates/ra_db/src/input.rs | 2 +- crates/ra_ide_db/src/feature_flags.rs | 2 +- crates/ra_lsp_server/Cargo.toml | 4 +- crates/ra_lsp_server/src/bin/args.rs | 16 ++-- crates/ra_lsp_server/src/bin/main.rs | 6 +- crates/ra_lsp_server/src/main_loop.rs | 2 +- .../ra_lsp_server/tests/heavy_tests/main.rs | 2 +- .../tests/heavy_tests/support.rs | 2 +- crates/ra_prof/src/lib.rs | 4 +- crates/ra_syntax/Cargo.toml | 2 +- crates/ra_tt/Cargo.toml | 2 +- docs/dev/README.md | 18 ++--- docs/dev/architecture.md | 6 +- docs/dev/debugging.md | 16 ++-- docs/user/readme.adoc | 8 +- editors/code/package.json | 4 +- editors/code/src/config.ts | 8 +- xtask/src/install.rs | 4 +- 23 files changed, 107 insertions(+), 107 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d6d5dba95e..a697c0071a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -44,29 +44,29 @@ jobs: CC: clang with: command: build - args: --package ra_lsp_server --bin ra_lsp_server --release --target x86_64-unknown-linux-musl + args: --package rust-analyzer --bin rust-analyzer --release --target x86_64-unknown-linux-musl - name: Build if: matrix.os != 'ubuntu-latest' uses: actions-rs/cargo@v1 with: command: build - args: --package ra_lsp_server --bin ra_lsp_server --release + args: --package rust-analyzer --bin rust-analyzer --release - name: Create distribution dir run: mkdir ./dist - name: Copy binary if: matrix.os == 'ubuntu-latest' - run: cp ./target/x86_64-unknown-linux-musl/release/ra_lsp_server ./dist/ra_lsp_server-linux && strip ./dist/ra_lsp_server-linux + run: cp ./target/x86_64-unknown-linux-musl/release/rust-analyzer ./dist/rust-analyzer-linux && strip ./dist/rust-analyzer-linux - name: Copy binary if: matrix.os == 'macos-latest' - run: cp ./target/release/ra_lsp_server ./dist/ra_lsp_server-mac + run: cp ./target/release/rust-analyzer ./dist/rust-analyzer-mac - name: Copy binary if: matrix.os == 'windows-latest' - run: copy ./target/release/ra_lsp_server.exe ./dist/ra_lsp_server-windows.exe + run: copy ./target/release/rust-analyzer.exe ./dist/rust-analyzer-windows.exe - name: Upload artifacts uses: actions/upload-artifact@v1 @@ -153,8 +153,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./dist/ra_lsp_server-linux - asset_name: ra_lsp_server-linux + asset_path: ./dist/rust-analyzer-linux + asset_name: rust-analyzer-linux asset_content_type: application/octet-stream - uses: actions/upload-release-asset@v1.0.1 @@ -162,8 +162,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./dist/ra_lsp_server-mac - asset_name: ra_lsp_server-mac + asset_path: ./dist/rust-analyzer-mac + asset_name: rust-analyzer-mac asset_content_type: application/octet-stream - uses: actions/upload-release-asset@v1.0.1 @@ -171,8 +171,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./dist/ra_lsp_server-windows.exe - asset_name: ra_lsp_server-windows.exe + asset_path: ./dist/rust-analyzer-windows.exe + asset_name: rust-analyzer-windows.exe asset_content_type: application/octet-stream - uses: actions/upload-release-asset@v1.0.1 diff --git a/.vscode/launch.json b/.vscode/launch.json index b1bd98d4aa..2e5c61735f 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -45,7 +45,7 @@ "/**/*.js" ], "env": { - "__RA_LSP_SERVER_DEBUG": "${workspaceFolder}/target/debug/ra_lsp_server" + "__RA_LSP_SERVER_DEBUG": "${workspaceFolder}/target/debug/rust-analyzer" } }, { @@ -59,7 +59,7 @@ "name": "Attach To Server", "type": "lldb", "request": "attach", - "program": "${workspaceFolder}/target/debug/ra_lsp_server", + "program": "${workspaceFolder}/target/debug/rust-analyzer", "pid": "${command:pickMyProcess}", "sourceLanguages": [ "rust" diff --git a/.vscode/tasks.json b/.vscode/tasks.json index fc9a8593b0..4037e7cce1 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -19,7 +19,7 @@ "label": "Build Server", "group": "build", "type": "shell", - "command": "cargo build --package ra_lsp_server", + "command": "cargo build --package rust-analyzer", "problemMatcher": "$rustc" }, ] diff --git a/Cargo.lock b/Cargo.lock index c22cbca3a3..c10d72aa4c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1094,44 +1094,6 @@ dependencies = [ "unicase", ] -[[package]] -name = "ra_lsp_server" -version = "0.1.0" -dependencies = [ - "anyhow", - "crossbeam-channel", - "either", - "env_logger", - "globset", - "itertools", - "jod-thread", - "log", - "lsp-server", - "lsp-types", - "parking_lot", - "pico-args", - "ra_cargo_watch", - "ra_db", - "ra_hir", - "ra_hir_def", - "ra_hir_ty", - "ra_ide", - "ra_prof", - "ra_project_model", - "ra_syntax", - "ra_text_edit", - "ra_vfs", - "rand", - "relative-path", - "rustc-hash", - "serde", - "serde_json", - "tempfile", - "test_utils", - "threadpool", - "winapi 0.3.8", -] - [[package]] name = "ra_mbe" version = "0.1.0" @@ -1353,6 +1315,44 @@ dependencies = [ "thin-dst", ] +[[package]] +name = "rust-analyzer" +version = "0.1.0" +dependencies = [ + "anyhow", + "crossbeam-channel", + "either", + "env_logger", + "globset", + "itertools", + "jod-thread", + "log", + "lsp-server", + "lsp-types", + "parking_lot", + "pico-args", + "ra_cargo_watch", + "ra_db", + "ra_hir", + "ra_hir_def", + "ra_hir_ty", + "ra_ide", + "ra_prof", + "ra_project_model", + "ra_syntax", + "ra_text_edit", + "ra_vfs", + "rand", + "relative-path", + "rustc-hash", + "serde", + "serde_json", + "tempfile", + "test_utils", + "threadpool", + "winapi 0.3.8", +] + [[package]] name = "rustc-demangle" version = "0.1.16" diff --git a/README.md b/README.md index fabb8479d4..13d81d4ae8 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ $ git clone https://github.com/rust-analyzer/rust-analyzer && cd rust-analyzer # install both the language server and VS Code extension $ cargo xtask install -# alternatively, install only the server. Binary name is `ra_lsp_server`. +# alternatively, install only the server. Binary name is `rust-analyzer`. $ cargo xtask install --server ``` diff --git a/crates/ra_db/src/input.rs b/crates/ra_db/src/input.rs index 1f1dcea429..1b4b472159 100644 --- a/crates/ra_db/src/input.rs +++ b/crates/ra_db/src/input.rs @@ -3,7 +3,7 @@ //! derived from this input. //! //! Note that neither this module, nor any other part of the analyzer's core do -//! actual IO. See `vfs` and `project_model` in the `ra_lsp_server` crate for how +//! actual IO. See `vfs` and `project_model` in the `rust-analyzer` crate for how //! actual IO is done and lowered to input. use std::{fmt, str::FromStr}; diff --git a/crates/ra_ide_db/src/feature_flags.rs b/crates/ra_ide_db/src/feature_flags.rs index 1b3cabf4d9..76655f572c 100644 --- a/crates/ra_ide_db/src/feature_flags.rs +++ b/crates/ra_ide_db/src/feature_flags.rs @@ -13,7 +13,7 @@ use rustc_hash::FxHashMap; /// checked at compile time, to keep things simple and flexible. /// /// Also note that, at the moment, `FeatureFlags` also store features for -/// `ra_lsp_server`. This should be benign layering violation. +/// `rust-analyzer`. This should be benign layering violation. #[derive(Debug)] pub struct FeatureFlags { flags: FxHashMap, diff --git a/crates/ra_lsp_server/Cargo.toml b/crates/ra_lsp_server/Cargo.toml index 151ca3da51..3dae43d2a4 100644 --- a/crates/ra_lsp_server/Cargo.toml +++ b/crates/ra_lsp_server/Cargo.toml @@ -1,6 +1,6 @@ [package] edition = "2018" -name = "ra_lsp_server" +name = "rust-analyzer" version = "0.1.0" authors = ["rust-analyzer developers"] autobins = false @@ -9,7 +9,7 @@ autobins = false doctest = false [[bin]] -name = "ra_lsp_server" +name = "rust-analyzer" path = "./src/bin/main.rs" [dependencies] diff --git a/crates/ra_lsp_server/src/bin/args.rs b/crates/ra_lsp_server/src/bin/args.rs index 3890fe13a3..5ad3963a2e 100644 --- a/crates/ra_lsp_server/src/bin/args.rs +++ b/crates/ra_lsp_server/src/bin/args.rs @@ -5,7 +5,7 @@ use anyhow::{bail, Result}; use pico_args::Arguments; -use ra_lsp_server::cli::{BenchWhat, Position, Verbosity}; +use rust_analyzer::cli::{BenchWhat, Position, Verbosity}; use std::{fmt::Write, path::PathBuf}; @@ -74,7 +74,7 @@ impl Args { ra-cli-parse USAGE: - ra_lsp_server parse [FLAGS] + rust-analyzer parse [FLAGS] FLAGS: -h, --help Prints help inforamtion @@ -94,7 +94,7 @@ FLAGS: ra-cli-symbols USAGE: - ra_lsp_server highlight [FLAGS] + rust-analyzer highlight [FLAGS] FLAGS: -h, --help Prints help inforamtion" @@ -113,7 +113,7 @@ FLAGS: ra-cli-highlight USAGE: - ra_lsp_server highlight [FLAGS] + rust-analyzer highlight [FLAGS] FLAGS: -h, --help Prints help information @@ -133,7 +133,7 @@ FLAGS: ra-cli-analysis-stats USAGE: - ra_lsp_server analysis-stats [FLAGS] [OPTIONS] [PATH] + rust-analyzer analysis-stats [FLAGS] [OPTIONS] [PATH] FLAGS: -h, --help Prints help information @@ -168,10 +168,10 @@ ARGS: if matches.contains(["-h", "--help"]) { eprintln!( "\ -ra_lsp_server-analysis-bench +rust-analyzer-analysis-bench USAGE: - ra_lsp_server analysis-bench [FLAGS] [OPTIONS] [PATH] + rust-analyzer analysis-bench [FLAGS] [OPTIONS] [PATH] FLAGS: -h, --help Prints help information @@ -207,7 +207,7 @@ ARGS: ra-cli USAGE: - ra_lsp_server + rust-analyzer FLAGS: -h, --help Prints help information diff --git a/crates/ra_lsp_server/src/bin/main.rs b/crates/ra_lsp_server/src/bin/main.rs index e25d54a0d6..69e709a25c 100644 --- a/crates/ra_lsp_server/src/bin/main.rs +++ b/crates/ra_lsp_server/src/bin/main.rs @@ -4,8 +4,8 @@ mod args; use lsp_server::Connection; -use ra_lsp_server::{cli, from_json, show_message, Result, ServerConfig}; use ra_prof; +use rust_analyzer::{cli, from_json, show_message, Result, ServerConfig}; use crate::args::HelpPrinted; @@ -51,7 +51,7 @@ fn run_server() -> Result<()> { log::info!("lifecycle: server started"); let (connection, io_threads) = Connection::stdio(); - let server_capabilities = serde_json::to_value(ra_lsp_server::server_capabilities()).unwrap(); + let server_capabilities = serde_json::to_value(rust_analyzer::server_capabilities()).unwrap(); let initialize_params = connection.initialize(server_capabilities)?; let initialize_params = @@ -84,7 +84,7 @@ fn run_server() -> Result<()> { }) .unwrap_or_default(); - ra_lsp_server::main_loop( + rust_analyzer::main_loop( workspace_roots, initialize_params.capabilities, server_config, diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs index 67d8a5f6fa..dc16a234da 100644 --- a/crates/ra_lsp_server/src/main_loop.rs +++ b/crates/ra_lsp_server/src/main_loop.rs @@ -1,4 +1,4 @@ -//! The main loop of `ra_lsp_server` responsible for dispatching LSP +//! The main loop of `rust-analyzer` responsible for dispatching LSP //! requests/replies and notifications back to the client. mod handlers; diff --git a/crates/ra_lsp_server/tests/heavy_tests/main.rs b/crates/ra_lsp_server/tests/heavy_tests/main.rs index 9ca31cbcca..3af63d9cf0 100644 --- a/crates/ra_lsp_server/tests/heavy_tests/main.rs +++ b/crates/ra_lsp_server/tests/heavy_tests/main.rs @@ -7,7 +7,7 @@ use lsp_types::{ PartialResultParams, Position, Range, TextDocumentItem, TextDocumentPositionParams, WorkDoneProgressParams, }; -use ra_lsp_server::req::{ +use rust_analyzer::req::{ CodeActionParams, CodeActionRequest, Completion, CompletionParams, DidOpenTextDocument, Formatting, OnEnter, Runnables, RunnablesParams, }; diff --git a/crates/ra_lsp_server/tests/heavy_tests/support.rs b/crates/ra_lsp_server/tests/heavy_tests/support.rs index d5ea52fa95..5b90b32188 100644 --- a/crates/ra_lsp_server/tests/heavy_tests/support.rs +++ b/crates/ra_lsp_server/tests/heavy_tests/support.rs @@ -19,7 +19,7 @@ use serde_json::{to_string_pretty, Value}; use tempfile::TempDir; use test_utils::{find_mismatch, parse_fixture}; -use ra_lsp_server::{main_loop, req, ServerConfig}; +use rust_analyzer::{main_loop, req, ServerConfig}; pub struct Project<'a> { fixture: &'a str, diff --git a/crates/ra_prof/src/lib.rs b/crates/ra_prof/src/lib.rs index 7ff8db58a8..c267bc85fa 100644 --- a/crates/ra_prof/src/lib.rs +++ b/crates/ra_prof/src/lib.rs @@ -351,13 +351,13 @@ impl Drop for Scope { /// 2. Build with `cpu_profiler` feature. /// 3. Tun the code, the *raw* output would be in the `./out.profile` file. /// 4. Install pprof for visualization (https://github.com/google/pprof). -/// 5. Use something like `pprof -svg target/release/ra_lsp_server ./out.profile` to see the results. +/// 5. Use something like `pprof -svg target/release/rust-analyzer ./out.profile` to see the results. /// /// For example, here's how I run profiling on NixOS: /// /// ```bash /// $ nix-shell -p gperftools --run \ -/// 'cargo run --release -p ra_lsp_server -- parse < ~/projects/rustbench/parser.rs > /dev/null' +/// 'cargo run --release -p rust-analyzer -- parse < ~/projects/rustbench/parser.rs > /dev/null' /// ``` #[derive(Debug)] pub struct CpuProfiler { diff --git a/crates/ra_syntax/Cargo.toml b/crates/ra_syntax/Cargo.toml index 83db943fec..cb72972c5d 100644 --- a/crates/ra_syntax/Cargo.toml +++ b/crates/ra_syntax/Cargo.toml @@ -22,7 +22,7 @@ ra_text_edit = { path = "../ra_text_edit" } ra_parser = { path = "../ra_parser" } # This crate transitively depends on `smol_str` via `rowan`. -# ideally, `serde` should be enabled by `ra_lsp_server`, but we enable it here +# ideally, `serde` should be enabled by `rust-analyzer`, but we enable it here # to reduce number of compilations smol_str = { version = "0.1.12", features = ["serde"] } serde = { version = "1", features = ["derive"] } diff --git a/crates/ra_tt/Cargo.toml b/crates/ra_tt/Cargo.toml index b8dceb92a4..c9601fdcc0 100644 --- a/crates/ra_tt/Cargo.toml +++ b/crates/ra_tt/Cargo.toml @@ -8,6 +8,6 @@ authors = ["rust-analyzer developers"] doctest = false [dependencies] -# ideally, `serde` should be enabled by `ra_lsp_server`, but we enable it here +# ideally, `serde` should be enabled by `rust-analyzer`, but we enable it here # to reduce number of compilations smol_str = { version = "0.1.12", features = ["serde"] } diff --git a/docs/dev/README.md b/docs/dev/README.md index ba24524f23..9da2eb0144 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 41c3909f7d..0343b6c81f 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 e6b0821564..bece6a5720 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 Result<()> { } let jemalloc = if opts.jemalloc { "--features jemalloc" } else { "" }; - let res = run!("cargo install --path crates/ra_lsp_server --locked --force {}", jemalloc); + let res = run!("cargo install --path crates/rust-analyzer --locked --force {}", jemalloc); if res.is_err() && old_rust { eprintln!( From c855e36696afa54260773a6bc8a358df67d60dea Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 18 Feb 2020 12:35:44 +0100 Subject: [PATCH 2/3] Rename config value for server Path --- docs/dev/README.md | 2 +- docs/user/readme.adoc | 4 ++-- editors/code/package.json | 2 +- editors/code/src/config.ts | 2 +- editors/code/src/installation/server.ts | 2 +- xtask/src/install.rs | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/dev/README.md b/docs/dev/README.md index 9da2eb0144..8d7e180109 100644 --- a/docs/dev/README.md +++ b/docs/dev/README.md @@ -92,7 +92,7 @@ launch configuration from `launch.json`. Notably, this uses the usual in `setting.json` file: ```json { - "rust-analyzer.raLspServerPath": "rust-analyzer" + "rust-analyzer.serverPath": "rust-analyzer" } ``` After I am done with the fix, I use `cargo diff --git a/docs/user/readme.adoc b/docs/user/readme.adoc index aa1994b492..74fda0abef 100644 --- a/docs/user/readme.adoc +++ b/docs/user/readme.adoc @@ -64,7 +64,7 @@ To make VS Code use the freshly build server, add this to the settings: [source,json] ---- -{ "rust-analyzer.raLspServerPath": "rust-analyzer" } +{ "rust-analyzer.serverPath": "rust-analyzer" } ---- Note that installing via `xtask install` does not work for VS Code Remote, instead you'll need to install the `.vsix` manually. @@ -102,7 +102,7 @@ The are several LSP client implementations for vim: 2. Run `:CocInstall coc-rust-analyzer` to install https://github.com/fannheyward/coc-rust-analyzer[coc-rust-analyzer], this extension implements _most_ of the features supported in the VSCode extension: - * same configurations as VSCode extension, `rust-analyzer.raLspServerPath`, `rust-analyzer.enableCargoWatchOnStartup` etc. + * same configurations as VSCode extension, `rust-analyzer.serverPath`, `rust-analyzer.enableCargoWatchOnStartup` etc. * same commands too, `rust-analyzer.analyzerStatus`, `rust-analyzer.startCargoWatch` etc. * highlighting and inlay_hints are not implemented yet diff --git a/editors/code/package.json b/editors/code/package.json index 2a03043763..c498c14b42 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -179,7 +179,7 @@ "default": {}, "description": "Fine grained feature flags to disable annoying features" }, - "rust-analyzer.raLspServerPath": { + "rust-analyzer.serverPath": { "type": [ "null", "string" diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index 7142f72af2..347c989c45 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -111,7 +111,7 @@ export class Config { } get serverSource(): null | BinarySource { - const serverPath = RA_LSP_DEBUG ?? this.cfg.get("raLspServerPath"); + const serverPath = RA_LSP_DEBUG ?? this.cfg.get("serverPath"); if (serverPath) { return { diff --git a/editors/code/src/installation/server.ts b/editors/code/src/installation/server.ts index 80cb719e36..6e730fbfcb 100644 --- a/editors/code/src/installation/server.ts +++ b/editors/code/src/installation/server.ts @@ -29,7 +29,7 @@ export async function ensureServerBinary(source: null | BinarySource): Promise Date: Tue, 18 Feb 2020 12:37:45 +0100 Subject: [PATCH 3/3] Rename folder --- crates/{ra_lsp_server => rust-analyzer}/Cargo.toml | 0 crates/{ra_lsp_server => rust-analyzer}/build.rs | 0 crates/{ra_lsp_server => rust-analyzer}/src/bin/args.rs | 0 crates/{ra_lsp_server => rust-analyzer}/src/bin/main.rs | 0 crates/{ra_lsp_server => rust-analyzer}/src/caps.rs | 0 crates/{ra_lsp_server => rust-analyzer}/src/cargo_target_spec.rs | 0 crates/{ra_lsp_server => rust-analyzer}/src/cli.rs | 0 crates/{ra_lsp_server => rust-analyzer}/src/cli/analysis_bench.rs | 0 crates/{ra_lsp_server => rust-analyzer}/src/cli/analysis_stats.rs | 0 crates/{ra_lsp_server => rust-analyzer}/src/cli/load_cargo.rs | 0 .../{ra_lsp_server => rust-analyzer}/src/cli/progress_report.rs | 0 crates/{ra_lsp_server => rust-analyzer}/src/config.rs | 0 crates/{ra_lsp_server => rust-analyzer}/src/conv.rs | 0 crates/{ra_lsp_server => rust-analyzer}/src/diagnostics.rs | 0 crates/{ra_lsp_server => rust-analyzer}/src/lib.rs | 0 crates/{ra_lsp_server => rust-analyzer}/src/main_loop.rs | 0 crates/{ra_lsp_server => rust-analyzer}/src/main_loop/handlers.rs | 0 .../src/main_loop/pending_requests.rs | 0 .../src/main_loop/subscriptions.rs | 0 crates/{ra_lsp_server => rust-analyzer}/src/markdown.rs | 0 crates/{ra_lsp_server => rust-analyzer}/src/req.rs | 0 crates/{ra_lsp_server => rust-analyzer}/src/vfs_glob.rs | 0 crates/{ra_lsp_server => rust-analyzer}/src/world.rs | 0 crates/{ra_lsp_server => rust-analyzer}/tests/heavy_tests/main.rs | 0 .../{ra_lsp_server => rust-analyzer}/tests/heavy_tests/support.rs | 0 25 files changed, 0 insertions(+), 0 deletions(-) rename crates/{ra_lsp_server => rust-analyzer}/Cargo.toml (100%) rename crates/{ra_lsp_server => rust-analyzer}/build.rs (100%) rename crates/{ra_lsp_server => rust-analyzer}/src/bin/args.rs (100%) rename crates/{ra_lsp_server => rust-analyzer}/src/bin/main.rs (100%) rename crates/{ra_lsp_server => rust-analyzer}/src/caps.rs (100%) rename crates/{ra_lsp_server => rust-analyzer}/src/cargo_target_spec.rs (100%) rename crates/{ra_lsp_server => rust-analyzer}/src/cli.rs (100%) rename crates/{ra_lsp_server => rust-analyzer}/src/cli/analysis_bench.rs (100%) rename crates/{ra_lsp_server => rust-analyzer}/src/cli/analysis_stats.rs (100%) rename crates/{ra_lsp_server => rust-analyzer}/src/cli/load_cargo.rs (100%) rename crates/{ra_lsp_server => rust-analyzer}/src/cli/progress_report.rs (100%) rename crates/{ra_lsp_server => rust-analyzer}/src/config.rs (100%) rename crates/{ra_lsp_server => rust-analyzer}/src/conv.rs (100%) rename crates/{ra_lsp_server => rust-analyzer}/src/diagnostics.rs (100%) rename crates/{ra_lsp_server => rust-analyzer}/src/lib.rs (100%) rename crates/{ra_lsp_server => rust-analyzer}/src/main_loop.rs (100%) rename crates/{ra_lsp_server => rust-analyzer}/src/main_loop/handlers.rs (100%) rename crates/{ra_lsp_server => rust-analyzer}/src/main_loop/pending_requests.rs (100%) rename crates/{ra_lsp_server => rust-analyzer}/src/main_loop/subscriptions.rs (100%) rename crates/{ra_lsp_server => rust-analyzer}/src/markdown.rs (100%) rename crates/{ra_lsp_server => rust-analyzer}/src/req.rs (100%) rename crates/{ra_lsp_server => rust-analyzer}/src/vfs_glob.rs (100%) rename crates/{ra_lsp_server => rust-analyzer}/src/world.rs (100%) rename crates/{ra_lsp_server => rust-analyzer}/tests/heavy_tests/main.rs (100%) rename crates/{ra_lsp_server => rust-analyzer}/tests/heavy_tests/support.rs (100%) diff --git a/crates/ra_lsp_server/Cargo.toml b/crates/rust-analyzer/Cargo.toml similarity index 100% rename from crates/ra_lsp_server/Cargo.toml rename to crates/rust-analyzer/Cargo.toml diff --git a/crates/ra_lsp_server/build.rs b/crates/rust-analyzer/build.rs similarity index 100% rename from crates/ra_lsp_server/build.rs rename to crates/rust-analyzer/build.rs diff --git a/crates/ra_lsp_server/src/bin/args.rs b/crates/rust-analyzer/src/bin/args.rs similarity index 100% rename from crates/ra_lsp_server/src/bin/args.rs rename to crates/rust-analyzer/src/bin/args.rs diff --git a/crates/ra_lsp_server/src/bin/main.rs b/crates/rust-analyzer/src/bin/main.rs similarity index 100% rename from crates/ra_lsp_server/src/bin/main.rs rename to crates/rust-analyzer/src/bin/main.rs diff --git a/crates/ra_lsp_server/src/caps.rs b/crates/rust-analyzer/src/caps.rs similarity index 100% rename from crates/ra_lsp_server/src/caps.rs rename to crates/rust-analyzer/src/caps.rs diff --git a/crates/ra_lsp_server/src/cargo_target_spec.rs b/crates/rust-analyzer/src/cargo_target_spec.rs similarity index 100% rename from crates/ra_lsp_server/src/cargo_target_spec.rs rename to crates/rust-analyzer/src/cargo_target_spec.rs diff --git a/crates/ra_lsp_server/src/cli.rs b/crates/rust-analyzer/src/cli.rs similarity index 100% rename from crates/ra_lsp_server/src/cli.rs rename to crates/rust-analyzer/src/cli.rs diff --git a/crates/ra_lsp_server/src/cli/analysis_bench.rs b/crates/rust-analyzer/src/cli/analysis_bench.rs similarity index 100% rename from crates/ra_lsp_server/src/cli/analysis_bench.rs rename to crates/rust-analyzer/src/cli/analysis_bench.rs diff --git a/crates/ra_lsp_server/src/cli/analysis_stats.rs b/crates/rust-analyzer/src/cli/analysis_stats.rs similarity index 100% rename from crates/ra_lsp_server/src/cli/analysis_stats.rs rename to crates/rust-analyzer/src/cli/analysis_stats.rs diff --git a/crates/ra_lsp_server/src/cli/load_cargo.rs b/crates/rust-analyzer/src/cli/load_cargo.rs similarity index 100% rename from crates/ra_lsp_server/src/cli/load_cargo.rs rename to crates/rust-analyzer/src/cli/load_cargo.rs diff --git a/crates/ra_lsp_server/src/cli/progress_report.rs b/crates/rust-analyzer/src/cli/progress_report.rs similarity index 100% rename from crates/ra_lsp_server/src/cli/progress_report.rs rename to crates/rust-analyzer/src/cli/progress_report.rs diff --git a/crates/ra_lsp_server/src/config.rs b/crates/rust-analyzer/src/config.rs similarity index 100% rename from crates/ra_lsp_server/src/config.rs rename to crates/rust-analyzer/src/config.rs diff --git a/crates/ra_lsp_server/src/conv.rs b/crates/rust-analyzer/src/conv.rs similarity index 100% rename from crates/ra_lsp_server/src/conv.rs rename to crates/rust-analyzer/src/conv.rs diff --git a/crates/ra_lsp_server/src/diagnostics.rs b/crates/rust-analyzer/src/diagnostics.rs similarity index 100% rename from crates/ra_lsp_server/src/diagnostics.rs rename to crates/rust-analyzer/src/diagnostics.rs diff --git a/crates/ra_lsp_server/src/lib.rs b/crates/rust-analyzer/src/lib.rs similarity index 100% rename from crates/ra_lsp_server/src/lib.rs rename to crates/rust-analyzer/src/lib.rs diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs similarity index 100% rename from crates/ra_lsp_server/src/main_loop.rs rename to crates/rust-analyzer/src/main_loop.rs diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/rust-analyzer/src/main_loop/handlers.rs similarity index 100% rename from crates/ra_lsp_server/src/main_loop/handlers.rs rename to crates/rust-analyzer/src/main_loop/handlers.rs diff --git a/crates/ra_lsp_server/src/main_loop/pending_requests.rs b/crates/rust-analyzer/src/main_loop/pending_requests.rs similarity index 100% rename from crates/ra_lsp_server/src/main_loop/pending_requests.rs rename to crates/rust-analyzer/src/main_loop/pending_requests.rs diff --git a/crates/ra_lsp_server/src/main_loop/subscriptions.rs b/crates/rust-analyzer/src/main_loop/subscriptions.rs similarity index 100% rename from crates/ra_lsp_server/src/main_loop/subscriptions.rs rename to crates/rust-analyzer/src/main_loop/subscriptions.rs diff --git a/crates/ra_lsp_server/src/markdown.rs b/crates/rust-analyzer/src/markdown.rs similarity index 100% rename from crates/ra_lsp_server/src/markdown.rs rename to crates/rust-analyzer/src/markdown.rs diff --git a/crates/ra_lsp_server/src/req.rs b/crates/rust-analyzer/src/req.rs similarity index 100% rename from crates/ra_lsp_server/src/req.rs rename to crates/rust-analyzer/src/req.rs diff --git a/crates/ra_lsp_server/src/vfs_glob.rs b/crates/rust-analyzer/src/vfs_glob.rs similarity index 100% rename from crates/ra_lsp_server/src/vfs_glob.rs rename to crates/rust-analyzer/src/vfs_glob.rs diff --git a/crates/ra_lsp_server/src/world.rs b/crates/rust-analyzer/src/world.rs similarity index 100% rename from crates/ra_lsp_server/src/world.rs rename to crates/rust-analyzer/src/world.rs diff --git a/crates/ra_lsp_server/tests/heavy_tests/main.rs b/crates/rust-analyzer/tests/heavy_tests/main.rs similarity index 100% rename from crates/ra_lsp_server/tests/heavy_tests/main.rs rename to crates/rust-analyzer/tests/heavy_tests/main.rs diff --git a/crates/ra_lsp_server/tests/heavy_tests/support.rs b/crates/rust-analyzer/tests/heavy_tests/support.rs similarity index 100% rename from crates/ra_lsp_server/tests/heavy_tests/support.rs rename to crates/rust-analyzer/tests/heavy_tests/support.rs