diff --git a/typescript/src/codeActions/custom/changeStringReplaceToRegex.ts b/typescript/src/codeActions/custom/changeStringReplaceToRegex.ts index f0148b42..f6e58398 100644 --- a/typescript/src/codeActions/custom/changeStringReplaceToRegex.ts +++ b/typescript/src/codeActions/custom/changeStringReplaceToRegex.ts @@ -9,6 +9,7 @@ const nodeToSpan = (node: ts.Node): ts.TextSpan => { export default { id: 'changeStringReplaceToRegex', name: 'Change to Regex', + kind: 'refactor.rewrite.stringToRegex', tryToApply(sourceFile, position, _range, node) { if (!node || !position) return // requires full explicit object selection (be aware of comma) to not be annoying with suggestion diff --git a/typescript/src/codeActions/custom/objectSwapKeysAndValues.ts b/typescript/src/codeActions/custom/objectSwapKeysAndValues.ts index 443ac996..a7ff77a6 100644 --- a/typescript/src/codeActions/custom/objectSwapKeysAndValues.ts +++ b/typescript/src/codeActions/custom/objectSwapKeysAndValues.ts @@ -23,6 +23,7 @@ export const printNodeForObjectKey = (node: ts.Node) => { export default { id: 'objectSwapKeysAndValues', name: 'Swap Keys and Values in Object', + kind: 'refactor.rewrite.object.swapKeysAndValues', tryToApply(sourceFile, _position, range, node) { if (!range || !node) return // requires full explicit object selection (be aware of comma) to not be annoying with suggestion diff --git a/typescript/src/codeActions/getCodeActions.ts b/typescript/src/codeActions/getCodeActions.ts index bbab2e63..cf400056 100644 --- a/typescript/src/codeActions/getCodeActions.ts +++ b/typescript/src/codeActions/getCodeActions.ts @@ -22,6 +22,8 @@ export type ApplyCodeAction = ( export type CodeAction = { name: string id: string + /** Base kind https://github.com/microsoft/vscode/blob/main/src/vscode-dts/vscode.d.ts#L2236 */ + kind: string tryToApply: ApplyCodeAction } @@ -72,8 +74,9 @@ export default ( return { info: (appliableCodeActions.length && { - actions: appliableCodeActions.map(({ id, name }) => ({ + actions: appliableCodeActions.map(({ id, name, kind }) => ({ description: name, + kind, name: id, })), // anyway not visible in ui