jeff-hykin / better-shell-syntax

💾 📦 ♻️ An improvement to the shell syntax for VS Code
MIT License
52 stars 4 forks source link

`)` in switch case not being highlighted properly #33

Closed shadichy closed 1 year ago

shadichy commented 1 year ago

image why is the ")" red?

jeff-hykin commented 1 year ago

That will depend on your theme as to why. The ) has a tag of "punctuation.definition.case-pattern" and your theme picks the color for that tag

jeff-hykin commented 1 year ago

As far as I can tell the syntax is highlighting the correct thing, but if you think there's still a problem let me know and I'll open the issue back up

shadichy commented 1 year ago

punctuation.definition.case-pattern

within this extension disabled, image it's white

shadichy commented 1 year ago

also, this doen't highlight variables inside {} like this image while the default theme does

jeff-hykin commented 1 year ago

punctuation.definition.case-pattern

within this extension disabled, image it's white

The built-in VS Code syntax is an older version that I believe doesn't match/tag everything. So your theme probably doesn't know the ) is punctuation, and just colors it white.

jeff-hykin commented 1 year ago

also, this doen't highlight variables inside {} like this image while the default theme does

Here's what it looks like for me with the Material theme:

Screen Shot 2023-02-04 at 3 06 00 PM

And this is what it looks like with the extension disabled:

Screen Shot 2023-02-04 at 3 09 27 PM

If you want to customize/tweak the colors of your current theme, take a look at a tutorial here otherwise I'd suggest trying out some different themes.

shadichy commented 1 year ago

punctuation.definition.case-pattern

within this extension disabled, image it's white

The built-in VS Code syntax is an older version that I believe doesn't match/tag everything. So your theme probably doesn't know the ) is punctuation, and just colors it white.

switched to material, also set image still image

jeff-hykin commented 1 year ago

Ohhh now I actually think it's the bracket-pair-colorizer being confused. It thinks those )'s are part of a pair. There should be a setting for disabling bracket pair colorizing (and it can be done for a specific language)

It became obvious because I don't think that shade of red is even part of the material theme color pallet.

0xjc commented 1 year ago

@jeff-hykin I noticed this issue as well. The unbalancedBracketScopes addition seems related: https://github.com/microsoft/vscode/issues/144736

The default shellscript extension has this:

    "grammars": [
      {
        "language": "shellscript",
        "scopeName": "source.shell",
        "path": "./syntaxes/shell-unix-bash.tmLanguage.json",
        "balancedBracketScopes": [
          "*"
        ],
        "unbalancedBracketScopes": [
          "meta.scope.case-pattern.shell"
        ]
      }
    ],
frypf commented 1 year ago

Was there ever any fix for this? I've just installed this extension (to get around buggy highlighting introduced by VSC 1.76.0), and it only seems to be an issue while it's enabled.

shadichy commented 1 year ago

Was there ever any fix for this? I've just installed this extension (to get around buggy highlighting introduced by VSC 1.76.0), and it only seems to be an issue while it's enabled.

same case here no idea when it will be fixed

jeff-hykin commented 1 year ago

@jeff-hykin I noticed this issue as well. The unbalancedBracketScopes addition seems related: microsoft/vscode#144736

The default shellscript extension has this:

    "grammars": [
      {
        "language": "shellscript",
        "scopeName": "source.shell",
        "path": "./syntaxes/shell-unix-bash.tmLanguage.json",
        "balancedBracketScopes": [
          "*"
        ],
        "unbalancedBracketScopes": [
          "meta.scope.case-pattern.shell"
        ]
      }
    ],

Alright, I've added something similar to see if that fixes the bracket pair issue

shadichy commented 1 year ago

also, the code following the ) is not being highlighted properly image image