mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-25 12:33:33 +00:00
Rename the binary to rust-analyzer
This commit is contained in:
parent
4d307ff802
commit
c0fa5e2246
23 changed files with 107 additions and 107 deletions
22
.github/workflows/release.yaml
vendored
22
.github/workflows/release.yaml
vendored
|
@ -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
|
||||
|
|
4
.vscode/launch.json
vendored
4
.vscode/launch.json
vendored
|
@ -45,7 +45,7 @@
|
|||
"<node_internals>/**/*.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"
|
||||
|
|
2
.vscode/tasks.json
vendored
2
.vscode/tasks.json
vendored
|
@ -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"
|
||||
},
|
||||
]
|
||||
|
|
76
Cargo.lock
generated
76
Cargo.lock
generated
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
```
|
||||
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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<String, bool>,
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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 <SUBCOMMAND>
|
||||
rust-analyzer <SUBCOMMAND>
|
||||
|
||||
FLAGS:
|
||||
-h, --help Prints help information
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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"] }
|
||||
|
|
|
@ -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"] }
|
||||
|
|
|
@ -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
|
||||
```
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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 <kbd>Ctrl+Shift+P</kbd> and run the following command in your `[Extension Development Host]`
|
||||
|
@ -47,13 +47,13 @@ To apply changes to an already running debug process press <kbd>Ctrl+Shift+P</kb
|
|||
debug = 2
|
||||
```
|
||||
|
||||
- Select `Run Extension (Dev Server)` to run your locally built `target/debug/ra_lsp_server`.
|
||||
- Select `Run Extension (Dev Server)` to run your locally built `target/debug/rust-analyzer`.
|
||||
|
||||
- In the original VSCode window once again select the `Attach To Server` debug configuration.
|
||||
|
||||
- A list of running processes should appear. Select the `ra_lsp_server` from this repo.
|
||||
- A list of running processes should appear. Select the `rust-analyzer` from this repo.
|
||||
|
||||
- Navigate to `crates/ra_lsp_server/src/main_loop.rs` and add a breakpoint to the `on_task` function.
|
||||
- Navigate to `crates/rust-analyzer/src/main_loop.rs` and add a breakpoint to the `on_task` function.
|
||||
|
||||
- Go back to the `[Extension Development Host]` instance and hover over a Rust variable and your breakpoint should hit.
|
||||
|
||||
|
@ -64,15 +64,15 @@ To apply changes to an already running debug process press <kbd>Ctrl+Shift+P</kb
|
|||
|
||||
## Troubleshooting
|
||||
|
||||
### Can't find the `ra_lsp_server` process
|
||||
### Can't find the `rust-analyzer` process
|
||||
|
||||
It could be a case of just jumping the gun.
|
||||
|
||||
The `ra_lsp_server` is only started once the `onLanguage:rust` activation.
|
||||
The `rust-analyzer` is only started once the `onLanguage:rust` activation.
|
||||
|
||||
Make sure you open a rust file in the `[Extension Development Host]` and try again.
|
||||
|
||||
### Can't connect to `ra_lsp_server`
|
||||
### Can't connect to `rust-analyzer`
|
||||
|
||||
Make sure you have run `echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope`.
|
||||
|
||||
|
|
|
@ -64,14 +64,14 @@ To make VS Code use the freshly build server, add this to the settings:
|
|||
|
||||
[source,json]
|
||||
----
|
||||
{ "rust-analyzer.raLspServerPath": "ra_lsp_server" }
|
||||
{ "rust-analyzer.raLspServerPath": "rust-analyzer" }
|
||||
----
|
||||
|
||||
Note that installing via `xtask install` does not work for VS Code Remote, instead you'll need to install the `.vsix` manually.
|
||||
|
||||
=== Language Server Binary
|
||||
|
||||
Other editors generally require `ra_lsp_server` binary to be in `$PATH`.
|
||||
Other editors generally require `rust-analyzer` binary to be in `$PATH`.
|
||||
You can download pre-build binary from
|
||||
https://github.com/rust-analyzer/rust-analyzer/releases[releases]
|
||||
page, or you can install it from source using the following command:
|
||||
|
@ -117,7 +117,7 @@ The are several LSP client implementations for vim:
|
|||
[source,vim]
|
||||
----
|
||||
let g:LanguageClient_serverCommands = {
|
||||
\ 'rust': ['ra_lsp_server'],
|
||||
\ 'rust': ['rust-analyzer'],
|
||||
\ }
|
||||
----
|
||||
|
||||
|
@ -142,7 +142,7 @@ Installation:
|
|||
[source,json]
|
||||
----
|
||||
"rust-analyzer": {
|
||||
"command": ["ra_lsp_server"],
|
||||
"command": ["rust-analyzer"],
|
||||
"languageId": "rust",
|
||||
"scopes": ["source.rust"],
|
||||
"syntaxes": [
|
||||
|
|
|
@ -185,7 +185,7 @@
|
|||
"string"
|
||||
],
|
||||
"default": null,
|
||||
"description": "Path to ra_lsp_server executable (points to bundled binary by default)"
|
||||
"description": "Path to rust-analyzer executable (points to bundled binary by default)"
|
||||
},
|
||||
"rust-analyzer.excludeGlobs": {
|
||||
"type": "array",
|
||||
|
@ -245,7 +245,7 @@
|
|||
"Full log"
|
||||
],
|
||||
"default": "off",
|
||||
"description": "Trace requests to the ra_lsp_server"
|
||||
"description": "Trace requests to the rust-analyzer"
|
||||
},
|
||||
"rust-analyzer.lruCapacity": {
|
||||
"type": [
|
||||
|
|
|
@ -76,7 +76,7 @@ export class Config {
|
|||
}
|
||||
|
||||
/**
|
||||
* Name of the binary artifact for `ra_lsp_server` that is published for
|
||||
* Name of the binary artifact for `rust-analyzer` that is published for
|
||||
* `platform` on GitHub releases. (It is also stored under the same name when
|
||||
* downloaded by the extension).
|
||||
*/
|
||||
|
@ -91,12 +91,12 @@ export class Config {
|
|||
case "arm":
|
||||
case "arm64": return null;
|
||||
|
||||
default: return "ra_lsp_server-linux";
|
||||
default: return "rust-analyzer-linux";
|
||||
}
|
||||
}
|
||||
|
||||
case "darwin": return "ra_lsp_server-mac";
|
||||
case "win32": return "ra_lsp_server-windows.exe";
|
||||
case "darwin": return "rust-analyzer-mac";
|
||||
case "win32": return "rust-analyzer-windows.exe";
|
||||
|
||||
// Users on these platforms yet need to manually build from sources
|
||||
case "aix":
|
||||
|
|
|
@ -39,7 +39,7 @@ impl InstallCmd {
|
|||
"
|
||||
Installation complete.
|
||||
|
||||
Add `\"rust-analyzer.raLspServerPath\": \"ra_lsp_server\",` to VS Code settings,
|
||||
Add `\"rust-analyzer.raLspServerPath\": \"rust-analyzer\",` to VS Code settings,
|
||||
otherwise it will use the latest release from GitHub.
|
||||
"
|
||||
)
|
||||
|
@ -142,7 +142,7 @@ fn install_server(opts: ServerOpt) -> 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!(
|
||||
|
|
Loading…
Reference in a new issue