From cc4c1f553d4355b4ea6c2c467db038ab089b38db Mon Sep 17 00:00:00 2001 From: Fred Bricon Date: Mon, 29 Sep 2025 14:28:49 +0200 Subject: [PATCH] feat: add inlay hints for implicit variables Signed-off-by: Fred Bricon --- README.md | 4 ++++ package.json | 6 ++++++ src/telemetry.ts | 1 + 3 files changed, 11 insertions(+) diff --git a/README.md b/README.md index 9a6eab9680..c653995bc8 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ Features * Diagnostic tags * Call Hierarchy * Type Hierarchy +* Inlay Hints To launch and debug your Java programs, it's recommended you install *[Java Debug Extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-debug)*. @@ -258,6 +259,9 @@ 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. + Semantic Highlighting =============== [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). diff --git a/package.json b/package.json index 05e4213be6..5fd88e9c8f 100644 --- a/package.json +++ b/package.json @@ -1510,6 +1510,12 @@ "scope": "window", "order": 90 }, + "java.inlayHints.variableTypes.enabled": { + "type": "boolean", + "default": false, + "markdownDescription": "Enable/disable inlay hints for implicit variable types:\n```java\n\nvar foo /* :Path */ = Path.of(\"foo\");\n \n```", + "scope": "window" + }, "java.search.scope": { "type": "string", "enum": [ diff --git a/src/telemetry.ts b/src/telemetry.ts index 9b0b6c351d..bc73eef517 100644 --- a/src/telemetry.ts +++ b/src/telemetry.ts @@ -61,6 +61,7 @@ export namespace Telemetry { "java.completion.collapseCompletionItems", "java.completion.guessMethodArguments", "java.cleanup.actionsOnSave", "java.completion.postfix.enabled", "java.sharedIndexes.enabled", "java.inlayHints.parameterNames.enabled", + "java.inlayHints.variableTypes.enabled", "java.server.launchMode", "java.autobuild.enabled" ]; // settings where we only record their existence