Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code extension, how to make case insensitive?

I am building ST language support for VS Code. In my language-configuration.json file I have

"brackets": [
        ["{", "}"],
        ["[", "]"],
        ["VAR", "END_VAR"]
]

This works fine. When i enter any of those I have indentation inside. But only if var and end_var are capital. Can I somehow indicate that this language in case insensitive and this works in both cases?

The same thing in autoClosingPairs

"autoClosingPairs": [
    {"open": "{", "close": "}"},
    {"open": "[", "close": "]"},
    {"open": "(", "close": ")"},
    {"open": "VAR", "close": "END_VAR", "notIn": ["string"]}
]

It close pair but only if I enter it in upper case.

Or I have to create 2 versions?

"autoClosingPairs": [
    {"open": "var", "close": "end_var", "notIn": ["string"]},
    {"open": "VAR", "close": "END_VAR", "notIn": ["string"]}
]

The same thing insyntaxes\st.tmLanguage.json. For instance I have

{
    "name": "keyword.control.conditional.st",
    "match": "\\b(END_)?(IF|CASE|OF|ELSE|ELSIF|THEN)\\b"
}

This also highlights only if I enter upper case. How to indicate case insensitive.

like image 603
Sergey Romanov Avatar asked Oct 24 '25 19:10

Sergey Romanov


1 Answers

For your tmLanguage.json file, it would look like this:

{
    "name": "keyword.control.conditional.st",
    "match": "(?i)\\b(END_)?(IF|CASE|OF|ELSE|ELSIF|THEN)\\b"
}

I found the answer on this site.

As for the other part, I do not have an answer, might need to just create a new version.

like image 89
Dan Jelf Avatar answered Oct 26 '25 09:10

Dan Jelf