X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=editors%2Fcode%2Fsrc%2Fconfig.ts;h=e8abf8284eb7380c8f641f369c5c006fcba8c776;hb=5dab5e737909532e4a65390541393af6ee72f65b;hp=3b2eec8baa70cb3a93d3b93b3f00db7bb5d33736;hpb=8d296be1090b21b60e509c831864ae85feec2490;p=rust.git diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index 3b2eec8baa7..e8abf8284eb 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -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}`); @@ -92,9 +96,9 @@ export class Config { get askBeforeDownload() { return this.get("updates.askBeforeDownload"); } get traceExtension() { return this.get("trace.extension"); } - get inlayHints() { return { + enable: this.get("inlayHints.enable"), typeHints: this.get("inlayHints.typeHints"), parameterHints: this.get("inlayHints.parameterHints"), chainingHints: this.get("inlayHints.chainingHints"), @@ -107,4 +111,25 @@ export class Config { command: this.get("checkOnSave.command"), }; } + + get debug() { + // "/rustc/" used by suggestions only. + const { ["/rustc/"]: _, ...sourceFileMap } = this.get>("debug.sourceFileMap"); + + return { + engine: this.get("debug.engine"), + engineSettings: this.get("debug.engineSettings"), + openUpDebugPane: this.get("debug.openUpDebugPane"), + sourceFileMap: sourceFileMap + }; + } + + get lens() { + return { + enable: this.get("lens.enable"), + run: this.get("lens.run"), + debug: this.get("lens.debug"), + implementations: this.get("lens.implementations"), + }; + } }