| 373 | public summarizeTopics: boolean = true; |
| 374 | |
| 375 | async _handleCommand(cmd: cmdName){ |
| 376 | if(cmd === 'clearCache'){ |
| 377 | // used e.g. after manually installing/removing a package |
| 378 | this.refresh(true); |
| 379 | } else if(cmd === 'showOnlyFavorites'){ |
| 380 | this.showOnlyFavorites = true; |
| 381 | this.iconPath = new vscode.ThemeIcon('star-full'); |
| 382 | this.replaceContextValue('showOnlyFavorites', 'showAllPackages'); |
| 383 | this.refresh(); |
| 384 | } else if(cmd === 'showAllPackages'){ |
| 385 | this.showOnlyFavorites = false; |
| 386 | this.iconPath = new vscode.ThemeIcon('list-unordered'); |
| 387 | this.replaceContextValue('showAllPackages', 'showOnlyFavorites'); |
| 388 | this.refresh(); |
| 389 | } else if(cmd === 'filterPackages'){ |
| 390 | // use validation function to continuously update filtered packages |
| 391 | const validateInput = (value: string) => { |
| 392 | this.filterText = value; |
| 393 | this.refresh(); |
| 394 | return ''; |
| 395 | }; |
| 396 | // let user input filter text |
| 397 | this.filterText = await vscode.window.showInputBox({ |
| 398 | validateInput: validateInput, |
| 399 | value: this.filterText, |
| 400 | }); |
| 401 | this.description = (this.filterText ? `"${this.filterText}"` : ''); |
| 402 | this.refresh(); |
| 403 | } else if(cmd === 'unsummarizeTopics'){ |
| 404 | this.summarizeTopics = false; |
| 405 | this.replaceContextValue('unsummarizeTopics', 'summarizeTopics'); |
| 406 | this.refreshChildren(); // clears the 'grandchildren' |
| 407 | this.refresh(false, false); |
| 408 | } else if(cmd === 'summarizeTopics'){ |
| 409 | this.summarizeTopics = true; |
| 410 | this.replaceContextValue('summarizeTopics', 'unsummarizeTopics'); |
| 411 | this.refreshChildren(); // clears the 'grandchildren' |
| 412 | this.refresh(false, false); |
| 413 | } |
| 414 | } |
| 415 | |
| 416 | refresh(clearCache: boolean = false, refreshChildren: boolean = true){ |
| 417 | if(clearCache){ |