richjyoung / vscode-modern-vhdl

Modern VSCode VHDL Support
MIT License
30 stars 12 forks source link

[Bug] formatting incorrect in enumeration declaration of enumeration litterals with upper case letters #24

Closed pvanschendel closed 4 years ago

pvanschendel commented 4 years ago

Hello Rich,

Thanks for, unlike many extensions out there, maintaining your vscode extension. I have been using its grammar for some time now, found a few bugs, and would like to help fixing these. I thought it is best to post an issue for each of them, if you would like to get them together, please let me know.

This first has pull request https://github.com/richjyoung/vscode-modern-vhdl/pull/22 open to fix it.

bug_captials_in_enum_literal

pvanschendel commented 4 years ago

The solution in pull request https://github.com/richjyoung/vscode-modern-vhdl/pull/27 is probably better than the one in pull request https://github.com/richjyoung/vscode-modern-vhdl/pull/22.

richjyoung commented 4 years ago

See comments on #27 regarding this, basically you are both correct and #27 needs changing to not conflict with #22.

pvanschendel commented 4 years ago

Hi I thought to not color the enumeration literals at all, so that it has the same coloring as when assigning a literal to a constant/signal/variable. Coloring the enumeration literal in the assignment would not be possible/easy because there is no lexical differnece between an enumeration literal and a signal name.

But if you prefer it the way it was, I will do the merge ASAP.

richjyoung commented 4 years ago

I agree you can't colour the literal in assignment, but you can in the definition and I'd rather the existing colouring is not removed. There are many language grammars that suffer the same problem of ambiguous context, and usually where the context is deterministic then the appropriate colouring is applied, even if it differs later in the same file.

pvanschendel commented 4 years ago

OK