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

Commit 900f4a3

Browse files
committed
read custom project config from rust-analyzer.json
1 parent ac226e5 commit 900f4a3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const cp = require("child_process")
22
const os = require("os")
3+
const fs = require("fs")
34
const path = require("path")
45
const { CompositeDisposable, Disposable } = require("atom")
56
const { AutoLanguageClient } = require("atom-languageclient")
@@ -450,6 +451,11 @@ class RustLanguageClient extends AutoLanguageClient {
450451
params.initializationOptions = params.initializationOptions || {}
451452
// Don't build straight after initialize, wait for first `workspace/didChangeConfiguration`
452453
params.initializationOptions.omitInitBuild = true
454+
455+
let rlsConfigPath = path.join(projectPath, "rust-analyzer.json")
456+
let options = fs.readFileSync(rlsConfigPath)
457+
Object.assign(params.initializationOptions, JSON.parse(options))
458+
453459
return params
454460
}
455461

0 commit comments

Comments
 (0)