diff --git a/packages/cursorless-vscode/src/migrateSnippets.ts b/packages/cursorless-vscode/src/migrateSnippets.ts index 429b43c4f7..fb6e77be98 100644 --- a/packages/cursorless-vscode/src/migrateSnippets.ts +++ b/packages/cursorless-vscode/src/migrateSnippets.ts @@ -141,7 +141,7 @@ function parseVariables( wrapperPhrases: phrase ? [phrase] : undefined, wrapperScope: variable.wrapperScopeType, insertionFormatters: variable.formatter - ? [variable.formatter] + ? getFormatter(variable.formatter) : undefined, // SKIP: variable.description }; @@ -149,6 +149,22 @@ function parseVariables( ); } +// Convert Cursorless formatters to Talon community formatters +function getFormatter(formatter: string): string[] { + switch (formatter) { + case "camelCase": + return ["PRIVATE_CAMEL_CASE"]; + case "pascalCase": + return ["PUBLIC_CAMEL_CASE"]; + case "snakeCase": + return ["SNAKE_CASE"]; + case "upperSnakeCase": + return ["ALL_CAPS", "SNAKE_CASE"]; + default: + return [formatter]; + } +} + async function openResultDocument( result: Result, sourceDirectory: string,