]> git.lizzy.rs Git - rust.git/blobdiff - editors/code/src/config.ts
Introduce `toggle inlay hints` vscode command
[rust.git] / editors / code / src / config.ts
index 110e541800ed8f131c9dc8eb2c36704d23d94c80..e8abf8284eb7380c8f641f369c5c006fcba8c776 100644 (file)
@@ -8,7 +8,7 @@ export const NIGHTLY_TAG = "nightly";
 export class Config {
     readonly extensionId = "matklad.rust-analyzer";
 
-    private readonly rootSection = "rust-analyzer";
+    readonly rootSection = "rust-analyzer";
     private readonly requiresReloadOpts = [
         "serverPath",
         "cargo",
@@ -16,6 +16,10 @@ export class Config {
         "files",
         "highlighting",
         "updates.channel",
+        "lens.enable",
+        "lens.run",
+        "lens.debug",
+        "lens.implementations",
     ]
         .map(opt => `${this.rootSection}.${opt}`);
 
@@ -94,6 +98,7 @@ export class Config {
 
     get inlayHints() {
         return {
+            enable: this.get<boolean>("inlayHints.enable"),
             typeHints: this.get<boolean>("inlayHints.typeHints"),
             parameterHints: this.get<boolean>("inlayHints.parameterHints"),
             chainingHints: this.get<boolean>("inlayHints.chainingHints"),
@@ -108,10 +113,23 @@ export class Config {
     }
 
     get debug() {
+        // "/rustc/<id>" used by suggestions only.
+        const { ["/rustc/<id>"]: _, ...sourceFileMap } = this.get<Record<string, string>>("debug.sourceFileMap");
+
         return {
             engine: this.get<string>("debug.engine"),
-            sourceFileMap: this.get<Record<string, string>>("debug.sourceFileMap"),
+            engineSettings: this.get<object>("debug.engineSettings"),
+            openUpDebugPane: this.get<boolean>("debug.openUpDebugPane"),
+            sourceFileMap: sourceFileMap
         };
     }
 
+    get lens() {
+        return {
+            enable: this.get<boolean>("lens.enable"),
+            run: this.get<boolean>("lens.run"),
+            debug: this.get<boolean>("lens.debug"),
+            implementations: this.get<boolean>("lens.implementations"),
+        };
+    }
 }