From e98aff109a1c4bda6a05f16981898425c302aa0c Mon Sep 17 00:00:00 2001 From: Steffen Lyngbaek Date: Tue, 10 Mar 2020 00:55:46 -0700 Subject: Parameter inlay hint separate from variable type inlay? #2876 Add setting to allow enabling either type inlay hints or parameter inlay hints or both. Group the the max inlay hint length option into the object. - Add a new type for the inlayHint options. - Add tests to ensure the inlays don't happen on the server side --- editors/code/package.json | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'editors/code/package.json') diff --git a/editors/code/package.json b/editors/code/package.json index 512885454..6f2275062 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -307,12 +307,24 @@ "exclusiveMinimum": true, "description": "Number of syntax trees rust-analyzer keeps in memory" }, - "rust-analyzer.displayInlayHints": { - "type": "boolean", - "default": true, + "rust-analyzer.inlayHintOpts.displayType": { + "type": "string", + "enum": [ + "off", + "typeHints", + "parameterHints", + "full" + ], + "enumDescriptions": [ + "No type inlay hints", + "Type inlays hints only", + "Parameter inlays hints only", + "All inlay hints types" + ], + "default": "full", "description": "Display additional type and parameter information in the editor" }, - "rust-analyzer.maxInlayHintLength": { + "rust-analyzer.inlayHintOpts.maxLength": { "type": [ "null", "integer" -- cgit v1.2.3 From 58248e24cd45adcbfd7bfd00e1487df196b4a8c6 Mon Sep 17 00:00:00 2001 From: Steffen Lyngbaek Date: Wed, 11 Mar 2020 20:14:39 -0700 Subject: Switch from Vec to object with props - Instead of a single object type, use several individual nested types to allow toggling from the settings GUI - Remove unused struct definitions - Install and test that the toggles work --- editors/code/package.json | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) (limited to 'editors/code/package.json') diff --git a/editors/code/package.json b/editors/code/package.json index 6f2275062..296d6fe8e 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -307,28 +307,18 @@ "exclusiveMinimum": true, "description": "Number of syntax trees rust-analyzer keeps in memory" }, - "rust-analyzer.inlayHintOpts.displayType": { - "type": "string", - "enum": [ - "off", - "typeHints", - "parameterHints", - "full" - ], - "enumDescriptions": [ - "No type inlay hints", - "Type inlays hints only", - "Parameter inlays hints only", - "All inlay hints types" - ], - "default": "full", - "description": "Display additional type and parameter information in the editor" + "rust-analyzer.inlayHints.typeHints": { + "type": "boolean", + "default": true, + "description": "Whether to show inlay type hints" }, - "rust-analyzer.inlayHintOpts.maxLength": { - "type": [ - "null", - "integer" - ], + "rust-analyzer.inlayHints.parameterHints": { + "type": "boolean", + "default": true, + "description": "Whether to show function parameter name inlay hints at the call site" + }, + "rust-analyzer.inlayHints.maxLength": { + "type": "integer", "default": 20, "minimum": 0, "exclusiveMinimum": true, -- cgit v1.2.3 From a153b9087520012b5f815b4df6c3657d490b30c8 Mon Sep 17 00:00:00 2001 From: Steffen Lyngbaek Date: Thu, 12 Mar 2020 08:43:07 -0700 Subject: Make maxLength nullable again --- editors/code/package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'editors/code/package.json') diff --git a/editors/code/package.json b/editors/code/package.json index 296d6fe8e..78f3539e9 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -318,7 +318,10 @@ "description": "Whether to show function parameter name inlay hints at the call site" }, "rust-analyzer.inlayHints.maxLength": { - "type": "integer", + "type": [ + "null", + "integer" + ], "default": 20, "minimum": 0, "exclusiveMinimum": true, -- cgit v1.2.3