File tree 2 files changed +11
-3
lines changed
2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change
1
+ import vscode from 'vscode'
2
+
1
3
import BaseCommand from './BaseCommand'
2
4
3
5
import { Container } from '../container'
@@ -10,7 +12,7 @@ export enum CommandIdentifiers {
10
12
11
13
export default class SelectReport extends BaseCommand {
12
14
container : Container
13
-
15
+
14
16
constructor ( container : Container ) {
15
17
super ( )
16
18
this . container = container
@@ -34,7 +36,12 @@ export default class SelectReport extends BaseCommand {
34
36
}
35
37
} )
36
38
}
37
- const quickPick = new QuickPick ( quickPickOptions )
39
+ const placeholder = `Select Project Report (${ quickPickOptions . size } Report${ quickPickOptions . size > 1 ? 's' : '' } Available)`
40
+ const quickPick = new QuickPick ( quickPickOptions , placeholder )
41
+ if ( quickPickOptions . size === 0 ) {
42
+ vscode . window . showInformationMessage ( 'Oaklean: No Project Reports Available' )
43
+ return
44
+ }
38
45
quickPick . show ( )
39
46
}
40
47
}
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export default class QuickPick {
8
8
vsCodeComponent : vscode . QuickPick < vscode . QuickPickItem >
9
9
optionsWithCallBacks : QuickPickOptions
10
10
11
- constructor ( options : QuickPickOptions ) {
11
+ constructor ( options : QuickPickOptions , placeholder ?: string ) {
12
12
this . optionsWithCallBacks = options
13
13
14
14
const quickPick = vscode . window . createQuickPick ( )
@@ -19,6 +19,7 @@ export default class QuickPick {
19
19
} )
20
20
}
21
21
quickPick . items = labels
22
+ quickPick . placeholder = placeholder
22
23
quickPick . onDidChangeSelection ( selection => {
23
24
if ( selection [ 0 ] && this . optionsWithCallBacks . has ( selection [ 0 ] . label ) ) {
24
25
this . optionsWithCallBacks . get ( selection [ 0 ] . label ) ?. selectionCallback ( )
You can’t perform that action at this time.
0 commit comments