Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit 7e8c377

Browse files
authored
Merge pull request #207 from Green-Avocado/move-analyzer-config [skip ci]
2 parents eae23cf + b59f04a commit 7e8c377

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,30 @@ NOTE: On Windows, you can install it using [choco](https://chocolatey.org/instal
3434
No other packages or manual setup is required as these will be handled with user prompts after install.
3535
However, you may wish to install `rustup` with your OS package manager instead of following prompts to install via [rustup.rs](https://rustup.rs).
3636

37+
## Configure rust-analyzer
38+
39+
**rust-analyzer** settings can be stored in a JSON file in the project directory.
40+
41+
It first looks for `rust-analyzer.json`.
42+
If the file does not exists, it then checks `.config/rust-analyzer.json`.
43+
44+
### Example
45+
46+
`.config/rust-analyzer.json`
47+
48+
```json
49+
{
50+
"cargo": {
51+
"loadOutDirsFromCheck": true,
52+
},
53+
"procMacro": {
54+
"enable": true,
55+
}
56+
}
57+
```
58+
59+
Refer to the [rust-analyzer User Manual](https://rust-analyzer.github.io/manual.html#configuration) for the supported config options.
60+
3761
## Commands
3862

3963
- `ide-rust:restart-all-language-servers` Restart all currently active Rls processes

lib/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,10 @@ class RustLanguageClient extends AutoLanguageClient {
474474

475475
let rlsConfigPath = path.join(projectPath, "rust-analyzer.json")
476476

477+
if (!fs.existsSync(rlsConfigPath)) {
478+
rlsConfigPath = path.join(projectPath, ".config/rust-analyzer.json")
479+
}
480+
477481
if (fs.existsSync(rlsConfigPath)) {
478482
try {
479483
let options = fs.readFileSync(rlsConfigPath)

0 commit comments

Comments
 (0)