File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed
packages/cursorless-vscode/src Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -140,15 +140,32 @@ function parseVariables(
140140 name,
141141 wrapperPhrases : phrase ? [ phrase ] : undefined ,
142142 wrapperScope : variable . wrapperScopeType ,
143- insertionFormatters : variable . formatter
144- ? [ variable . formatter ]
145- : undefined ,
143+ insertionFormatters : getFormatter ( variable . formatter ) ,
146144 // SKIP: variable.description
147145 } ;
148146 } ,
149147 ) ;
150148}
151149
150+ // Convert Cursorless formatters to Talon community formatters
151+ function getFormatter ( formatter ?: string ) : string [ ] | undefined {
152+ if ( ! formatter ) {
153+ return undefined ;
154+ }
155+ switch ( formatter ) {
156+ case "camelCase" :
157+ return [ "PRIVATE_CAMEL_CASE" ] ;
158+ case "pascalCase" :
159+ return [ "PUBLIC_CAMEL_CASE" ] ;
160+ case "snakeCase" :
161+ return [ "SNAKE_CASE" ] ;
162+ case "upperSnakeCase" :
163+ return [ "ALL_CAPS" , "SNAKE_CASE" ] ;
164+ default :
165+ return [ formatter ] ;
166+ }
167+ }
168+
152169async function openResultDocument (
153170 result : Result ,
154171 sourceDirectory : string ,
You can’t perform that action at this time.
0 commit comments