(config: CompletionConfig)
| 105 | } |
| 106 | |
| 107 | async function setCompletionConfig(config: CompletionConfig): Promise<void> { |
| 108 | const wksp = await getWorkspace('global'); |
| 109 | if (!wksp) { |
| 110 | throw new Error(`Could not find global workspace`); |
| 111 | } |
| 112 | |
| 113 | wksp.extensions['cli'] ??= {}; |
| 114 | const cli = wksp.extensions['cli']; |
| 115 | if (!json.isJsonObject(cli)) { |
| 116 | throw new Error( |
| 117 | `Invalid config found at ${wksp.filePath}. \`extensions.cli\` should be an object.`, |
| 118 | ); |
| 119 | } |
| 120 | cli.completion = config as json.JsonObject; |
| 121 | await wksp.save(); |
| 122 | } |
| 123 | |
| 124 | async function shouldPromptForAutocompletionSetup( |
| 125 | command: string, |
no test coverage detected