MCPcopy Index your code
hub / github.com/REditorSupport/vscode-R / openHelpByAlias

Method openHelpByAlias

src/helpViewer/index.ts:470–492  ·  view source on GitHub ↗
(
        token: string = '',
        preserveFocus: boolean = false,
    )

Source from the content-addressed store, hash-verified

468
469 // quickly open help page by alias
470 public async openHelpByAlias(
471 token: string = '',
472 preserveFocus: boolean = false,
473 ): Promise<boolean> {
474 const matchingAliases = await this.getMatchingAliases(token);
475
476 let pickedAlias: Alias | undefined;
477 if (!matchingAliases?.length) {
478 return false;
479 } else if (matchingAliases.length === 1) {
480 pickedAlias = matchingAliases[0];
481 } else {
482 pickedAlias = await this.pickAlias(matchingAliases);
483 if (!pickedAlias) {
484 // aborted by user -> return successful
485 return true;
486 }
487 }
488 if (pickedAlias) {
489 return await this.showHelpForAlias(pickedAlias, preserveFocus);
490 }
491 return false;
492 }
493
494 public async getMatchingAliases(
495 token: string,

Callers 1

openHelpForSelectionMethod · 0.95

Calls 3

getMatchingAliasesMethod · 0.95
pickAliasMethod · 0.95
showHelpForAliasMethod · 0.95

Tested by

no test coverage detected