Skip to content

Conditional bracket highlighting in bash-like languages #191870

@spillz

Description

@spillz

I have a language where I have defined the following bracket types:

"brackets": [
    ["(", ")"],
    ["{", "}"],
    ["if", "endif"],
    ["while", "wend"],
    ["for", "next"]
],

The problem is that this is sort of a bash-like language where the if/endif, while/wend, and for/next keyword pairs are only valid as brackets at the start of a line (after an optional amount of whitespace) because in a line that begins with a command, those keywords could appear as command line args, variable names or user text in the command line arguments, throwing off the bracket matching. It would be helpful to have some more control here like being able to set the if/endif using a regex that checks it is the start of a line or specifying that the brackets are valid for only certain names in the language grammar. I don't think either feature exists currently.

Metadata

Metadata

Assignees

Labels

*out-of-scopePosted issue is not in scope of VS Code

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions