From 02a807a0705d049af796e80fcdfe1d17555fbb33 Mon Sep 17 00:00:00 2001 From: Siddharth Srinivasan Date: Fri, 5 Jun 2026 09:53:05 +0530 Subject: [PATCH] Fixed jdkHome config value handler fallback to env vars Fixed handler.ts:jdkHomeValueHandler() to have the promise return the fallback env vars JDK_HOME or JAVA_HOME when no config value is defined. - The config getter returns the default value i.e. null, in such a case. - Thus, the defaultValue parameter cannot be used, since the vscode config getter returns the default value defined in package.json, causing the value to not be `undefined`. - So, a `then()` clause on the promise is needed to check for `null` or `undefined` value, and fallback to the env vars, if so. --- vscode/src/configurations/handlers.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vscode/src/configurations/handlers.ts b/vscode/src/configurations/handlers.ts index 8e225f5d..54c37421 100644 --- a/vscode/src/configurations/handlers.ts +++ b/vscode/src/configurations/handlers.ts @@ -57,10 +57,11 @@ export const inspectConfiguration = (config: string) => { } export const jdkHomeValueHandler = async (): Promise => { - return getConfigurationValueWithVariablesSubstituted(configKeys.jdkHome) || - process.env.JDK_HOME || - process.env.JAVA_HOME || - null; + return getConfigurationValueWithVariablesSubstituted(configKeys.jdkHome) + .then(resolvedValue => resolvedValue || + process.env.JDK_HOME || + process.env.JAVA_HOME || + null); } export const projectJdkHomeValueHandler = async (): Promise => {