Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brackets in language configuration #169

Open
hankhsu1996 opened this issue Jun 29, 2022 · 1 comment
Open

Brackets in language configuration #169

hankhsu1996 opened this issue Jun 29, 2022 · 1 comment

Comments

@hankhsu1996
Copy link

When I wrote assert property like this:

assert property (!(Read && Write));

The property is recognized as the start of a parenthesis pair, which is defined in language-configuration.json. Therefore, it is highlighted with red color to indicate a non-closed parenthesis pair.

The thing is some of the start bracket may exist alone, which is not usually the case in (), [], {} but in keyword pairs. I'm thinking maybe it's better not add keyword pairs to the bracket list. The bracket is used for bracket highlighting, go to bracket and select to bracket.

For bracket highlighting, because the keyword pairs do not have a contiguous property, it's not a big problem. In contrast, there might be complex structures of ()[]{} such as {(A+(B+C))'(d*(e[x[y]]+f))} so you need the bracket highlighting.

For go to bracket and select to bracket, because the keyword pair usually lies in different lines of the code, and in the fact that people usually use indentation to tell the scope, it is also not a big problem.

So I'm suggesting that we can remove keyword pairs in bracket in language-configuration.json.

@Zekfoo
Copy link

Zekfoo commented Sep 21, 2022

Seconded.
assert property ();, with no closing endproperty, is a common SVA syntax.
In the case of assert property (); statements with "editor.bracketPairColorization.enabled": true, the property's detection as an opening bracket also affects the coloring of all following bracket pairs in the file.

Please adjust this behavior so that property only receives bracket highlighting if a matching endproperty is present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants