codefori / vscode-rpgle

RPGLE language tools for VS Code
MIT License
39 stars 20 forks source link

Variables in lower case. #217

Open sebCIL opened 1 year ago

sebCIL commented 1 year ago

Is your feature request related to a problem? Please describe. Variables are in upper case. I prefer to write in lower case, especially in full-free.

Describe the solution you'd like A parameter in the settings that ask if we want the variables in lower or upper case.

Describe alternatives you've considered None.

Additional context None.

What do you think about it ?

m-tyler commented 5 months ago

@sebCIL You can achieve a partial solution by setting the linter config, "IncorrectVariableCase":true, then you can set the case on the in source variables to the case you want. With VS Code it can be made very simple to change the case of many variables by using the "Multi-Cursor Editor" to select many variable names and then perform the conversion. I made sure the commands, "transformToUpperCase", "transformToLowerCase", and "transformToTitleCase" are set to key bindings, ALT+U, ALT+I, and ALT+T.

I transform the variable in source declarations, let the linter produce the case warnings, then press Shift+Alt+F to format the source. The linter then changes the case of all the other uses of the variable to the case of the declare version.

This solution does not work for external defined variables.