Serhioromano / vscode-st

Extension for VS Code to support Structured Text language.

Home Page:https://marketplace.visualstudio.com/items?itemName=Serhioromano.vscode-st#overview

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VAR/END_VAR scope when as parts of other identifiers

msftrncs opened this issue · comments

VAR and END_VAR incorrectly scope when run in to other identifiers in certain orders

image

VAR does not validate word break at end, END_VAR does not validate work break at either end.

VAR_x seem to be same as VAR

Looks like the \b is missing from the end of both the begin and end clauses.

If you put all in one line not sure it is fixable. Scope is defined with JSON file, and basically as I understand it, VS Code takes care of scopes, open\close brackets.

"begin": "\\b(?:VAR(?:_(?:INPUT|OUTPUT|IN_OUT|TEMP|GLOBAL|ACCESS|EXTERNAL))?|STRUCT|UNION|PUBLIC|PRIVATE|PROTECTED)",
"beginCaptures": {
"0": {
"name": "entity.name.type.st"
}
},
"end": "(?:END_(?:VAR|STRUCT|UNION))",

"begin": "\\b(?:VAR(?:_(?:INPUT|OUTPUT|IN_OUT|TEMP|GLOBAL|ACCESS|EXTERNAL))?|STRUCT|UNION|PUBLIC|PRIVATE|PROTECTED)\\b", 
"end": "\\b(?:END_(?:VAR|STRUCT|UNION))\\b",

(different coloring here, but now the keywords run together are no longer 'keywords')
image

(different coloring here, but now the keywords run together are no longer 'keywords')
image

Is that how it supposed to behave? Looks correct to me. You can PR this change.

After Appling correction:

image