From 14c167a9f6da07024a5101ffa04bc2f79ce64353 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Sun, 8 Dec 2019 00:54:18 +0200 Subject: Omit default parameter types --- editors/code/package.json | 5 +++++ editors/code/src/config.ts | 6 ++++++ editors/code/src/server.ts | 2 ++ 3 files changed, 13 insertions(+) (limited to 'editors') diff --git a/editors/code/package.json b/editors/code/package.json index f2e8e647e..bda0002b7 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -285,6 +285,11 @@ "default": 20, "description": "Maximum length for inlay hints" }, + "rust-analyzer.showDefaultTypesInInlayHints": { + "type": "boolean", + "default": false, + "description": "Display default types in inlay hints" + }, "rust-analyzer.cargoFeatures.noDefaultFeatures": { "type": "boolean", "default": false, diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index e131f09df..26bf30e7f 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -30,6 +30,7 @@ export class Config { public lruCapacity: null | number = null; public displayInlayHints = true; public maxInlayHintLength: null | number = null; + public showDefaultTypesInInlayHints = false; public excludeGlobs = []; public useClientWatching = true; public featureFlags = {}; @@ -153,6 +154,11 @@ export class Config { 'maxInlayHintLength', ) as number; } + if (config.has('showDefaultTypesInInlayHints')) { + this.showDefaultTypesInInlayHints = config.get( + 'showDefaultTypesInInlayHints', + ) as boolean; + } if (config.has('excludeGlobs')) { this.excludeGlobs = config.get('excludeGlobs') || []; } diff --git a/editors/code/src/server.ts b/editors/code/src/server.ts index 5ace1d0fa..e7d1df943 100644 --- a/editors/code/src/server.ts +++ b/editors/code/src/server.ts @@ -55,6 +55,8 @@ export class Server { publishDecorations: true, lruCapacity: Server.config.lruCapacity, maxInlayHintLength: Server.config.maxInlayHintLength, + showDefaultTypesInInlayHints: + Server.config.showDefaultTypesInInlayHints, excludeGlobs: Server.config.excludeGlobs, useClientWatching: Server.config.useClientWatching, featureFlags: Server.config.featureFlags, -- cgit v1.2.3