aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/config.ts
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-04-02 11:47:58 +0100
committerAleksey Kladov <[email protected]>2020-04-02 11:47:58 +0100
commit48c58309cca718701e902b05221a8e8ec81310db (patch)
tree9f85d9bfb277ca780c2069757a6c11ab6de2229f /editors/code/src/config.ts
parente4cf40a152120c6c3cba1822e56026ae04be63f0 (diff)
Lean onto default implementation of configs
Diffstat (limited to 'editors/code/src/config.ts')
-rw-r--r--editors/code/src/config.ts30
1 files changed, 4 insertions, 26 deletions
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts
index c37c6276b..1f45f1de0 100644
--- a/editors/code/src/config.ts
+++ b/editors/code/src/config.ts
@@ -11,9 +11,8 @@ export class Config {
11 private readonly rootSection = "rust-analyzer"; 11 private readonly rootSection = "rust-analyzer";
12 private readonly requiresReloadOpts = [ 12 private readonly requiresReloadOpts = [
13 "serverPath", 13 "serverPath",
14 "cargoFeatures", 14 "cargo",
15 "excludeGlobs", 15 "files",
16 "useClientWatching",
17 "highlighting", 16 "highlighting",
18 "updates.channel", 17 "updates.channel",
19 ] 18 ]
@@ -71,17 +70,8 @@ export class Config {
71 get channel() { return this.cfg.get<UpdatesChannel>("updates.channel")!; } 70 get channel() { return this.cfg.get<UpdatesChannel>("updates.channel")!; }
72 get askBeforeDownload() { return this.cfg.get<boolean>("updates.askBeforeDownload")!; } 71 get askBeforeDownload() { return this.cfg.get<boolean>("updates.askBeforeDownload")!; }
73 get highlightingSemanticTokens() { return this.cfg.get<boolean>("highlighting.semanticTokens")!; } 72 get highlightingSemanticTokens() { return this.cfg.get<boolean>("highlighting.semanticTokens")!; }
74 get lruCapacity() { return this.cfg.get<null | number>("lruCapacity")!; }
75 get excludeGlobs() { return this.cfg.get<string[]>("excludeGlobs")!; }
76 get useClientWatching() { return this.cfg.get<boolean>("useClientWatching")!; }
77 get featureFlags() { return this.cfg.get<Record<string, boolean>>("featureFlags")!; }
78 get rustfmtArgs() { return this.cfg.get<string[]>("rustfmtArgs")!; }
79 get loadOutDirsFromCheck() { return this.cfg.get<boolean>("loadOutDirsFromCheck")!; }
80 get traceExtension() { return this.cfg.get<boolean>("trace.extension")!; } 73 get traceExtension() { return this.cfg.get<boolean>("trace.extension")!; }
81 74
82 // for internal use
83 get withSysroot() { return this.cfg.get<boolean>("withSysroot", true)!; }
84
85 get inlayHints() { 75 get inlayHints() {
86 return { 76 return {
87 typeHints: this.cfg.get<boolean>("inlayHints.typeHints")!, 77 typeHints: this.cfg.get<boolean>("inlayHints.typeHints")!,
@@ -91,21 +81,9 @@ export class Config {
91 }; 81 };
92 } 82 }
93 83
94 get cargoWatchOptions() { 84 get checkOnSave() {
95 return {
96 enable: this.cfg.get<boolean>("cargo-watch.enable")!,
97 arguments: this.cfg.get<string[]>("cargo-watch.arguments")!,
98 allTargets: this.cfg.get<boolean>("cargo-watch.allTargets")!,
99 command: this.cfg.get<string>("cargo-watch.command")!,
100 };
101 }
102
103 get cargoFeatures() {
104 return { 85 return {
105 noDefaultFeatures: this.cfg.get<boolean>("cargoFeatures.noDefaultFeatures")!, 86 command: this.cfg.get<string>("checkOnSave.command")!,
106 allFeatures: this.cfg.get<boolean>("cargoFeatures.allFeatures")!,
107 features: this.cfg.get<string[]>("cargoFeatures.features")!,
108 loadOutDirsFromCheck: this.cfg.get<boolean>("cargoFeatures.loadOutDirsFromCheck")!,
109 }; 87 };
110 } 88 }
111} 89}