From e3adfad8e1eaea675343b92b1c74bb4256d5de99 Mon Sep 17 00:00:00 2001 From: Achal Talati Date: Tue, 15 Jul 2025 12:22:44 +0530 Subject: [PATCH] Fixed project clean and project compile commands in the command palette --- vscode/src/commands/buildOperations.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/vscode/src/commands/buildOperations.ts b/vscode/src/commands/buildOperations.ts index 28c8d81..a79b27d 100644 --- a/vscode/src/commands/buildOperations.ts +++ b/vscode/src/commands/buildOperations.ts @@ -19,7 +19,7 @@ import { l10n } from "../localiser"; import { extCommands, nbCommands } from "./commands"; import { ICommand } from "./types"; import { wrapCommandWithProgress, wrapProjectActionWithProgress } from "./utils"; -import { workspace } from "vscode"; +import { window, workspace } from "vscode"; import * as fs from 'fs'; const saveFilesInWorkspaceBeforeBuild = async (callbackFn: Function) => { @@ -52,22 +52,31 @@ const cleanWorkspaceHandler = () => { } const compileProjectHandler = (args: any) => { + let commandArgs = args; + if (!commandArgs) { + commandArgs = window.activeTextEditor?.document.uri.toString(); + } + const compileProjectFunction = () => wrapProjectActionWithProgress('build', undefined, l10n.value('jdk.extension.command.progress.compilingProject'), LOGGER.getOutputChannel(), - args + commandArgs ); saveFilesInWorkspaceBeforeBuild(compileProjectFunction); } const cleanProjectHandler = (args: any) => { + let commandArgs = args; + if (!commandArgs) { + commandArgs = window.activeTextEditor?.document.uri.toString(); + } const cleanProjectHandler = () => wrapProjectActionWithProgress('clean', undefined, l10n.value('jdk.extension.command.progress.cleaningProject'), LOGGER.getOutputChannel(), - args + commandArgs ); saveFilesInWorkspaceBeforeBuild(cleanProjectHandler);