(cmd: cmdName)
| 479 | } |
| 480 | |
| 481 | public async _handleCommand(cmd: cmdName): Promise<void> { |
| 482 | if(cmd === 'clearCache'){ |
| 483 | // useful e.g. when working on a package |
| 484 | this.wrapper.rHelp.clearCachedFiles(new RegExp(`^/library/${this.pkg.name}/`)); |
| 485 | this.refresh(); |
| 486 | } else if(cmd === 'addToFavorites'){ |
| 487 | this.wrapper.rHelp.packageManager.addFavorite(this.pkg.name); |
| 488 | this.parent.refresh(); |
| 489 | } else if(cmd === 'removeFromFavorites'){ |
| 490 | this.wrapper.rHelp.packageManager.removeFavorite(this.pkg.name); |
| 491 | this.parent.refresh(); |
| 492 | } else if(cmd === 'updatePackage'){ |
| 493 | const success = await this.wrapper.rHelp.packageManager.installPackages([this.pkg.name]); |
| 494 | // only reinstall if user confirmed removing the package (success === true) |
| 495 | // might still refresh if install was attempted but failed |
| 496 | if(success){ |
| 497 | this.parent.refresh(true); |
| 498 | } |
| 499 | } else if(cmd === 'removePackage'){ |
| 500 | const success = await this.wrapper.rHelp.packageManager.removePackage(this.pkg.name); |
| 501 | // only refresh if user confirmed removing the package (success === true) |
| 502 | // might still refresh if removing was attempted but failed |
| 503 | if(success){ |
| 504 | this.parent.refresh(true); |
| 505 | } |
| 506 | } |
| 507 | } |
| 508 | |
| 509 | async makeChildren(forQuickPick: boolean = false): Promise<TopicNode[]> { |
| 510 | const summarizeTopics = ( |
nothing calls this directly
no test coverage detected