Serhioromano / vscode-st

Extension for VS Code to support Structured Text language.
https://marketplace.visualstudio.com/items?itemName=Serhioromano.vscode-st#overview
MIT License
142 stars 28 forks source link

Add support for lowercase keywords #45

Closed AndersHogqvist closed 2 years ago

AndersHogqvist commented 2 years ago

Even though we are supposed to use capital letters in keywords such as IF, ELSIF etc we have a lot of files where these are written in lower case (if, elseif...). However the syntax highlighting only check for these words in capital letters.

github-actions[bot] commented 2 years ago

Welcome!

Thank you for finding time to write an issue and make this extension better. I`ll appreciate if you find some time to rate this extension here.

I`ll get back to your ASAP.

AndersHogqvist commented 2 years ago

The only thing that needs to be done is to add (?i) at the beginning of all regex patterns in st.tmLanguage.json. Example: "match": "(?i)\\b(?:END_)?(?:IF|CASE|OF|ELSE|ELSIF|THEN|__TRY|__CATCH|__FINALLY|__ENDTRY)\\b"

Serhioromano commented 2 years ago

Or you can click Shift+Alt+F and this extension will capitalize all needed keywords. This way is much better because although ST is not case sensitive, it would be nicer to have those keywords capitalized for code convention.

AndersHogqvist commented 2 years ago

Or you can click Shift+Alt+F and this extension will capitalize all needed keywords. This way is much better because although ST is not case sensitive, it would be nicer to have those keywords capitalized for code convention.

Oh, didn't know about that. Thanks!

Serhioromano commented 2 years ago

@AndersHogqvist Please I will very appreciate if you rate this extension here https://marketplace.visualstudio.com/items?itemName=Serhioromano.vscode-st&ssr=false#review-details