@@ -11,7 +11,7 @@ export function initializeLibraryListView(context: vscode.ExtensionContext) {
11
11
`libraryListView` , {
12
12
treeDataProvider : libraryListView ,
13
13
showCollapseAll : false ,
14
- canSelectMany : false ,
14
+ canSelectMany : true ,
15
15
dragAndDropController : new LibraryListDragAndDrop ( )
16
16
} ) ;
17
17
@@ -170,22 +170,31 @@ export function initializeLibraryListView(context: vscode.ExtensionContext) {
170
170
}
171
171
} ) ,
172
172
173
- vscode . commands . registerCommand ( `code-for-ibmi.removeFromLibraryList` , async ( node : LibraryListNode ) => {
173
+ vscode . commands . registerCommand ( `code-for-ibmi.removeFromLibraryList` , async ( node : LibraryListNode , nodes ?: LibraryListNode [ ] ) => {
174
174
if ( node ) {
175
175
//Running from right click
176
+ nodes = nodes ? nodes : [ node ] ;
176
177
const connection = instance . getConnection ( ) ;
177
178
if ( connection ) {
178
179
const config = connection . getConfig ( ) ;
179
- let libraryList = config . libraryList ;
180
+ const libraryList = config . libraryList ;
180
181
181
- let index = libraryList . findIndex ( library => connection . upperCaseName ( library ) === node . library )
182
- if ( index >= 0 ) {
183
- const removedLib = libraryList [ index ] ;
184
- libraryList . splice ( index , 1 ) ;
182
+ const removedLibs : string [ ] = [ ] ;
183
+ nodes . map ( n => n . library ) . forEach ( lib => {
184
+ const index = libraryList . findIndex ( library => connection . upperCaseName ( library ) === lib )
185
+ if ( index >= 0 ) {
186
+ removedLibs . push ( libraryList [ index ] ) ;
187
+ libraryList . splice ( index , 1 ) ;
188
+ }
189
+ } ) ;
185
190
186
- config . libraryList = libraryList ;
187
- await updateConfig ( config ) ;
188
- vscode . window . showInformationMessage ( l10n . t ( `Library {0} was removed from the library list.` , removedLib ) ) ;
191
+ config . libraryList = libraryList ;
192
+ await updateConfig ( config ) ;
193
+ if ( removedLibs . length === 1 ) {
194
+ vscode . window . showInformationMessage ( l10n . t ( `Library {0} was removed from the library list.` , removedLibs . join ( "" ) ) ) ;
195
+ }
196
+ else {
197
+ vscode . window . showInformationMessage ( l10n . t ( `Libraries {0} were removed from the library list.` , removedLibs . join ( ", " ) ) ) ;
189
198
}
190
199
}
191
200
}
0 commit comments