in package/src/languageServiceManager/kustoLanguageService.ts [659:679]
private getApplyCodeActions(document: TextDocument, start: number, end: number): k2.ApplyAction[] {
const script = this.parseDocumentV2(document);
let block = this.getAffectedBlocks(this.toArray<k2.CodeBlock>(script.Blocks), [{ start, end }])[0];
const codeActionInfo = block.Service.GetCodeActions(
start,
start,
0,
null,
true,
null,
new Kusto.Language.Utils.CancellationToken()
);
const codeActions = this.toArray(codeActionInfo.Actions);
// Some code actions are of type "MenuAction". We want to flat them out, to show them seperately.
let flatCodeActions: k2.ApplyAction[] = [];
for (let i = 0; i < codeActions.length; i++) {
flatCodeActions.push(...this.flattenCodeActions(codeActions[i], null));
}
return flatCodeActions;
}