Skip to content

Commit 01d07b9

Browse files
authored
Support exclusion list for inlay hints (#2468)
* Support exclusion list for inlay hints Signed-off-by: sheche <sheche@microsoft.com>
1 parent 97b29fa commit 01d07b9

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,14 @@ The following settings are supported:
201201
* `java.import.generatesMetadataFilesAtProjectRoot` : Specify whether the project metadata files(.project, .classpath, .factorypath, .settings/) will be generated at the project root. Defaults to `false`.
202202
* `java.inlayHints.parameterNames.enabled`: Enable/disable inlay hints for parameter names. Supported values are: `none`(disable parameter name hints), `literals`(Enable parameter name hints only for literal arguments) and `all`(Enable parameter name hints for literal and non-literal arguments). Defaults to `literals`.
203203

204+
New in 1.7.0
205+
* `java.inlayHints.parameterNames.exclusions`: The patterns for the methods that will be disabled to show the inlay hints. Supported pattern examples:
206+
- `java.lang.Math.*` - All the methods from java.lang.Math.
207+
- `*.Arrays.asList` - Methods named as 'asList' in the types named as 'Arrays'.
208+
- `*.println(*)` - Methods named as 'println'.
209+
- `(from, to)` - Methods with two parameters named as 'from' and 'to'.
210+
- `(arg*)` - Methods with one parameter whose name starts with 'arg'.
211+
204212
Semantic Highlighting
205213
===============
206214
[Semantic Highlighting](https://github.com/redhat-developer/vscode-java/wiki/Semantic-Highlighting) fixes numerous syntax highlighting issues with the default Java Textmate grammar. However, you might experience a few minor issues, particularly a delay when it kicks in, as it needs to be computed by the Java Language server, when opening a new file or when typing. Semantic highlighting can be disabled for all languages using the `editor.semanticHighlighting.enabled` setting, or for Java only using [language-specific editor settings](https://code.visualstudio.com/docs/getstarted/settings#_languagespecific-editor-settings).

package.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,16 @@
872872
"Enable parameter name hints for literal and non-literal arguments"
873873
],
874874
"default": "literals",
875-
"markdownDescription": "Enable/disable inlay hints for parameter names:\n```java\n\nInteger.valueOf(/* s: */ '123', /* radix: */ 10)\n \n```\n",
875+
"markdownDescription": "Enable/disable inlay hints for parameter names:\n```java\n\nInteger.valueOf(/* s: */ '123', /* radix: */ 10)\n \n```\n `#java.inlayHints.parameterNames.exclusions#` can be used to disable the inlay hints for methods.",
876+
"scope": "window"
877+
},
878+
"java.inlayHints.parameterNames.exclusions": {
879+
"type": "array",
880+
"items": {
881+
"type": "string"
882+
},
883+
"default": [],
884+
"markdownDescription": "The patterns for the methods that will be disabled to show the inlay hints. Supported pattern examples:\n - `java.lang.Math.*` - All the methods from java.lang.Math.\n - `*.Arrays.asList` - Methods named as 'asList' in the types named as 'Arrays'.\n - `*.println(*)` - Methods named as 'println'.\n - `(from, to)` - Methods with two parameters named as 'from' and 'to'.\n - `(arg*)` - Methods with one parameter whose name starts with 'arg'.",
876885
"scope": "window"
877886
},
878887
"java.project.encoding": {

0 commit comments

Comments
 (0)