From 8b5fc95908aa26710631fbe4a49220e20b5c38a8 Mon Sep 17 00:00:00 2001 From: Fred Bricon Date: Wed, 8 Oct 2025 17:56:20 +0200 Subject: [PATCH] feat: add inlay hints for lambda parameter types Signed-off-by: Fred Bricon --- README.md | 5 +++-- package.json | 6 ++++++ src/telemetry.ts | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c653995bc..4ef2df5bd 100644 --- a/README.md +++ b/README.md @@ -214,6 +214,7 @@ The following settings are supported: * `java.configuration.workspaceCacheLimit` : The number of days (if enabled) to keep unused workspace cache data. Beyond this limit, cached workspace data may be removed. * `java.import.generatesMetadataFilesAtProjectRoot` : Specify whether the project metadata files(.project, .classpath, .factorypath, .settings/) will be generated at the project root. Defaults to `false`. * `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`. +* `java.inlayHints.parameterTypes.enabled`: Enable/disable inlay hints for (lambda) parameter types. Defaults to `false`. * `java.compile.nullAnalysis.nonnull`: Specify the Nonnull annotation types to be used for null analysis. If more than one annotation is specified, then the topmost annotation will be used first if it exists in your project dependencies. This setting will be ignored if `java.compile.nullAnalysis.mode` is set to `disabled`. * `java.compile.nullAnalysis.nullable`: Specify the Nullable annotation types to be used for null analysis. If more than one annotation is specified, then the topmost annotation will be used first if it exists in your project dependencies. This setting will be ignored if `java.compile.nullAnalysis.mode` is set to `disabled`. * `java.compile.nullAnalysis.nonnullbydefault`: Specify the NonNullByDefault annotation types to be used for null analysis. If more than one annotation is specified, then the topmost annotation will be used first if it exists in your project dependencies. This setting will be ignored if `java.compile.nullAnalysis.mode` is set to `disabled`. @@ -259,8 +260,8 @@ The following settings are supported: * `java.references.includeDeclarations`: Include declarations when finding references. Defaults to `true` * `java.jdt.ls.appcds.enabled` : [Experimental] Enable Java AppCDS (Application Class Data Sharing) for improvements to extension activation. When set to `auto`, AppCDS will be enabled in Visual Studio Code - Insiders, and for pre-release versions. -New in 1.46.0 -* `java.inlayHints.variableTypes.enabled`: Enable/disable inlay hints for implicit variable types. +New in 1.47.0 +* `java.inlayHints.parameterTypes.enabled`: Enable/disable inlay hints for (lambda) parameter types. Defaults to `false`. Semantic Highlighting =============== diff --git a/package.json b/package.json index 70aa166e7..6a5072b61 100644 --- a/package.json +++ b/package.json @@ -1519,6 +1519,12 @@ "markdownDescription": "Enable/disable inlay hints for implicit variable types:\n```java\n\nvar foo /* :Path */ = Path.of(\"foo\");\n \n```", "scope": "window" }, + "java.inlayHints.parameterTypes.enabled": { + "type": "boolean", + "default": false, + "markdownDescription": "Enable/disable inlay hints for (lambda) parameter types:\n```java\n\nList.of(1, 2, 3, 4).filter(/*Integer */ n -> n % 2 == 0).toList();\n \n```", + "scope": "window" + }, "java.search.scope": { "type": "string", "enum": [ diff --git a/src/telemetry.ts b/src/telemetry.ts index bc73eef51..80bf8be4b 100644 --- a/src/telemetry.ts +++ b/src/telemetry.ts @@ -62,8 +62,10 @@ export namespace Telemetry { "java.cleanup.actionsOnSave", "java.completion.postfix.enabled", "java.sharedIndexes.enabled", "java.inlayHints.parameterNames.enabled", "java.inlayHints.variableTypes.enabled", + "java.inlayHints.parameterTypes.enabled", "java.server.launchMode", "java.autobuild.enabled" ]; + // settings where we only record their existence const SETTINGS_CUSTOM = [ "java.settings.url", "java.format.settings.url"