diff options
-rw-r--r-- | docs/dev/README.md | 2 | ||||
-rw-r--r-- | docs/user/manual.adoc | 4 | ||||
-rw-r--r-- | editors/code/src/main.ts | 7 |
3 files changed, 9 insertions, 4 deletions
diff --git a/docs/dev/README.md b/docs/dev/README.md index 55527bab0..dd2bfc493 100644 --- a/docs/dev/README.md +++ b/docs/dev/README.md | |||
@@ -77,7 +77,7 @@ Notably, this uses the usual `rust-analyzer` binary from `PATH`. | |||
77 | For this, it is important to have the following in your `settings.json` file: | 77 | For this, it is important to have the following in your `settings.json` file: |
78 | ```json | 78 | ```json |
79 | { | 79 | { |
80 | "rust-analyzer.serverPath": "rust-analyzer" | 80 | "rust-analyzer.server.path": "rust-analyzer" |
81 | } | 81 | } |
82 | ``` | 82 | ``` |
83 | After I am done with the fix, I use `cargo xtask install --client` to try the new extension for real. | 83 | After I am done with the fix, I use `cargo xtask install --client` to try the new extension for real. |
diff --git a/docs/user/manual.adoc b/docs/user/manual.adoc index 266baffa1..990b11859 100644 --- a/docs/user/manual.adoc +++ b/docs/user/manual.adoc | |||
@@ -115,7 +115,7 @@ $ code --install-extension /path/to/rust-analyzer.vsix | |||
115 | Copy the `rust-analyzer-{platform}` binary anywhere, then add the path to your settings.json, for example: | 115 | Copy the `rust-analyzer-{platform}` binary anywhere, then add the path to your settings.json, for example: |
116 | [source,json] | 116 | [source,json] |
117 | ---- | 117 | ---- |
118 | { "rust-analyzer.serverPath": "~/.local/bin/rust-analyzer-linux" } | 118 | { "rust-analyzer.server.path": "~/.local/bin/rust-analyzer-linux" } |
119 | ---- | 119 | ---- |
120 | 120 | ||
121 | ==== Building From Source | 121 | ==== Building From Source |
@@ -219,7 +219,7 @@ The are several LSP client implementations for vim or neovim: | |||
219 | https://github.com/fannheyward/coc-rust-analyzer[coc-rust-analyzer], | 219 | https://github.com/fannheyward/coc-rust-analyzer[coc-rust-analyzer], |
220 | this extension implements _most_ of the features supported in the VSCode extension: | 220 | this extension implements _most_ of the features supported in the VSCode extension: |
221 | * automatically install and upgrade stable/nightly releases | 221 | * automatically install and upgrade stable/nightly releases |
222 | * same configurations as VSCode extension, `rust-analyzer.serverPath`, `rust-analyzer.cargo.features` etc. | 222 | * same configurations as VSCode extension, `rust-analyzer.server.path`, `rust-analyzer.cargo.features` etc. |
223 | * same commands too, `rust-analyzer.analyzerStatus`, `rust-analyzer.ssr` etc. | 223 | * same commands too, `rust-analyzer.analyzerStatus`, `rust-analyzer.ssr` etc. |
224 | * inlay hints for variables and method chaining, _Neovim Only_ | 224 | * inlay hints for variables and method chaining, _Neovim Only_ |
225 | * semantic highlighting is not implemented yet | 225 | * semantic highlighting is not implemented yet |
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 4c132cabe..694da9409 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts | |||
@@ -167,6 +167,7 @@ async function bootstrapExtension(config: Config, state: PersistentState): Promi | |||
167 | } | 167 | } |
168 | return; | 168 | return; |
169 | }; | 169 | }; |
170 | if (serverPath(config) !== null) return; | ||
170 | 171 | ||
171 | const now = Date.now(); | 172 | const now = Date.now(); |
172 | if (config.package.releaseTag === NIGHTLY_TAG) { | 173 | if (config.package.releaseTag === NIGHTLY_TAG) { |
@@ -278,7 +279,7 @@ async function patchelf(dest: PathLike): Promise<void> { | |||
278 | } | 279 | } |
279 | 280 | ||
280 | async function getServer(config: Config, state: PersistentState): Promise<string | undefined> { | 281 | async function getServer(config: Config, state: PersistentState): Promise<string | undefined> { |
281 | const explicitPath = process.env.__RA_LSP_SERVER_DEBUG ?? config.serverPath; | 282 | const explicitPath = serverPath(config); |
282 | if (explicitPath) { | 283 | if (explicitPath) { |
283 | if (explicitPath.startsWith("~/")) { | 284 | if (explicitPath.startsWith("~/")) { |
284 | return os.homedir() + explicitPath.slice("~".length); | 285 | return os.homedir() + explicitPath.slice("~".length); |
@@ -351,6 +352,10 @@ async function getServer(config: Config, state: PersistentState): Promise<string | |||
351 | return dest; | 352 | return dest; |
352 | } | 353 | } |
353 | 354 | ||
355 | function serverPath(config: Config): string | null { | ||
356 | return process.env.__RA_LSP_SERVER_DEBUG ?? config.serverPath; | ||
357 | } | ||
358 | |||
354 | async function isNixOs(): Promise<boolean> { | 359 | async function isNixOs(): Promise<boolean> { |
355 | try { | 360 | try { |
356 | const contents = await fs.readFile("/etc/os-release"); | 361 | const contents = await fs.readFile("/etc/os-release"); |