()
| 194 | |
| 195 | // get a list of all aliases |
| 196 | public async getAllAliases(): Promise<rHelp.Alias[] | undefined> { |
| 197 | // try this.aliases: |
| 198 | if(this.aliases){ |
| 199 | return this.aliases; |
| 200 | } |
| 201 | |
| 202 | // try cached aliases: |
| 203 | const cachedAliases = this.persistentState?.get<rHelp.Alias[]>('r.helpPanel.cachedAliases'); |
| 204 | if(cachedAliases){ |
| 205 | this.aliases = cachedAliases; |
| 206 | return cachedAliases; |
| 207 | } |
| 208 | |
| 209 | // try to make new aliases (returns undefined if unsuccessful): |
| 210 | const newAliases = await this.makeAllAliases(); |
| 211 | this.aliases = newAliases; |
| 212 | await this.persistentState?.update('r.helpPanel.cachedAliases', newAliases); |
| 213 | return newAliases; |
| 214 | } |
| 215 | |
| 216 | // converts aliases grouped by package to a flat list of aliases |
| 217 | private async makeAllAliases(): Promise<rHelp.Alias[] | undefined> { |
nothing calls this directly
no test coverage detected