diff options
author | vsrs <[email protected]> | 2020-05-17 17:51:44 +0100 |
---|---|---|
committer | vsrs <[email protected]> | 2020-05-17 17:51:44 +0100 |
commit | dc217bdf90d555eaa1780041fc3a14e64173994d (patch) | |
tree | 547807df99ad67f5be229ccb600610a376189723 /editors/code | |
parent | 71e94b1d0bf7c58aa377513f010fcb3f56081f5f (diff) |
CodeLens configuration options.
Diffstat (limited to 'editors/code')
-rw-r--r-- | editors/code/package.json | 15 | ||||
-rw-r--r-- | editors/code/src/config.ts | 11 |
2 files changed, 26 insertions, 0 deletions
diff --git a/editors/code/package.json b/editors/code/package.json index 2dbbde852..efed4c7f2 100644 --- a/editors/code/package.json +++ b/editors/code/package.json | |||
@@ -443,6 +443,21 @@ | |||
443 | "type": "object", | 443 | "type": "object", |
444 | "default": {}, | 444 | "default": {}, |
445 | "description": "Optional settings passed to the debug engine. Example:\n{ \"lldb\": { \"terminal\":\"external\"} }" | 445 | "description": "Optional settings passed to the debug engine. Example:\n{ \"lldb\": { \"terminal\":\"external\"} }" |
446 | }, | ||
447 | "rust-analyzer.lens.run": { | ||
448 | "description": "Whether to show Run lens.", | ||
449 | "type": "boolean", | ||
450 | "default": true | ||
451 | }, | ||
452 | "rust-analyzer.lens.debug": { | ||
453 | "description": "Whether to show Debug lens.", | ||
454 | "type": "boolean", | ||
455 | "default": true | ||
456 | }, | ||
457 | "rust-analyzer.lens.implementations": { | ||
458 | "description": "Whether to show Implementations lens.", | ||
459 | "type": "boolean", | ||
460 | "default": true | ||
446 | } | 461 | } |
447 | } | 462 | } |
448 | }, | 463 | }, |
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index 1652827c3..93d9aa160 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts | |||
@@ -16,6 +16,9 @@ export class Config { | |||
16 | "files", | 16 | "files", |
17 | "highlighting", | 17 | "highlighting", |
18 | "updates.channel", | 18 | "updates.channel", |
19 | "lens.run", | ||
20 | "lens.debug", | ||
21 | "lens.implementations", | ||
19 | ] | 22 | ] |
20 | .map(opt => `${this.rootSection}.${opt}`); | 23 | .map(opt => `${this.rootSection}.${opt}`); |
21 | 24 | ||
@@ -119,4 +122,12 @@ export class Config { | |||
119 | sourceFileMap: sourceFileMap | 122 | sourceFileMap: sourceFileMap |
120 | }; | 123 | }; |
121 | } | 124 | } |
125 | |||
126 | get lens() { | ||
127 | return { | ||
128 | run: this.get<boolean>("lens.run"), | ||
129 | debug: this.get<boolean>("lens.debug"), | ||
130 | implementations: this.get<boolean>("lens.implementations"), | ||
131 | }; | ||
132 | } | ||
122 | } | 133 | } |