@@ -19,7 +19,7 @@ import { l10n } from "../localiser";
19
19
import { extCommands , nbCommands } from "./commands" ;
20
20
import { ICommand } from "./types" ;
21
21
import { wrapCommandWithProgress , wrapProjectActionWithProgress } from "./utils" ;
22
- import { workspace } from "vscode" ;
22
+ import { window , workspace } from "vscode" ;
23
23
import * as fs from 'fs' ;
24
24
25
25
const saveFilesInWorkspaceBeforeBuild = async ( callbackFn : Function ) => {
@@ -52,22 +52,31 @@ const cleanWorkspaceHandler = () => {
52
52
}
53
53
54
54
const compileProjectHandler = ( args : any ) => {
55
+ let commandArgs = args ;
56
+ if ( ! commandArgs ) {
57
+ commandArgs = window . activeTextEditor ?. document . uri . toString ( ) ;
58
+ }
59
+
55
60
const compileProjectFunction = ( ) =>
56
61
wrapProjectActionWithProgress ( 'build' ,
57
62
undefined , l10n . value ( 'jdk.extension.command.progress.compilingProject' ) ,
58
63
LOGGER . getOutputChannel ( ) ,
59
- args
64
+ commandArgs
60
65
) ;
61
66
62
67
saveFilesInWorkspaceBeforeBuild ( compileProjectFunction ) ;
63
68
}
64
69
65
70
const cleanProjectHandler = ( args : any ) => {
71
+ let commandArgs = args ;
72
+ if ( ! commandArgs ) {
73
+ commandArgs = window . activeTextEditor ?. document . uri . toString ( ) ;
74
+ }
66
75
const cleanProjectHandler = ( ) => wrapProjectActionWithProgress ( 'clean' ,
67
76
undefined ,
68
77
l10n . value ( 'jdk.extension.command.progress.cleaningProject' ) ,
69
78
LOGGER . getOutputChannel ( ) ,
70
- args
79
+ commandArgs
71
80
) ;
72
81
73
82
saveFilesInWorkspaceBeforeBuild ( cleanProjectHandler ) ;
0 commit comments