aboutsummaryrefslogtreecommitdiff
path: root/editors/code/package.json
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-03-24 23:28:57 +0000
committerGitHub <[email protected]>2020-03-24 23:28:57 +0000
commit6ad1a0711631d8017791a6dfe85bbe205d6c7414 (patch)
treece2d6448ff8770c8fe73086eefb85dab38d298d8 /editors/code/package.json
parentfae627174aecae0b4f4d2c087a856eda1a97a1ac (diff)
parent7b35da04bf56a5461321a6dca515dcd29f44b57f (diff)
Merge #3710
3710: Inlay hints for method chaining pattern r=matklad a=M-J-Hooper This PR adds inlay hints on method call chains: ![image](https://user-images.githubusercontent.com/13765376/77472008-8dc2a880-6e13-11ea-9c18-2c2e2b809799.png) It is not only explicit `MethodCall`s where this can be helpful. The heuristic used here is that whenever any expression is followed by a new line and then a dot, it resembles a call chain and type information can be #useful. Changes: - A new `InlayKind` for chaining. - New option for disabling this type of hints. - Tree traversal rules for identifying the chaining hints. - VSCode decorators in the extension layer (and associated types). Notes: - IntelliJ has additional rules and configuration on this topic. Eg. minimum length of chain to start displaying hints and only displaying distinct types in the chain. - I am checking for chaining on every `ast::Expr` in the tree; Are there performance concerns there? This is my first contribution (to RA and to Rust in general) so would appreciate any feedback. The only issue I can find the references this feature is #2741. Co-authored-by: Matt Hooper <[email protected]>
Diffstat (limited to 'editors/code/package.json')
-rw-r--r--editors/code/package.json5
1 files changed, 5 insertions, 0 deletions
diff --git a/editors/code/package.json b/editors/code/package.json
index 1d113ebb6..37e083220 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -333,6 +333,11 @@
333 "default": true, 333 "default": true,
334 "description": "Whether to show inlay type hints" 334 "description": "Whether to show inlay type hints"
335 }, 335 },
336 "rust-analyzer.inlayHints.chainingHints": {
337 "type": "boolean",
338 "default": true,
339 "description": "Whether to show inlay type hints for method chains"
340 },
336 "rust-analyzer.inlayHints.parameterHints": { 341 "rust-analyzer.inlayHints.parameterHints": {
337 "type": "boolean", 342 "type": "boolean",
338 "default": true, 343 "default": true,