jeff-hykin / better-shell-syntax

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

`sed` is colored differently, `grep is not #21

Closed CodingMarkus closed 1 year ago

CodingMarkus commented 2 years ago

While sed gets colored differently in commands, grep does not. Turns out hat is because of this entry:

    "sed_command": {
      "match": "(\\bsed\\b)(?:\\s++(\\-)(\\w+))*\\s+('s\\/)((?:\\\\.|[^\\/])*)(\\/)((?:\\\\.|[^\\/])*)(\\/\\w{0,4}\\')",
      "captures": {
        "1": {
          "name": "support.function.builtin.shell"
        },

But why does such an entry only exist for sed and not for any other standard POSIX command? Also why is sed tagged as shell builtin? I don't know of any shell where sed would be a builtin.

jeff-hykin commented 2 years ago

It was a special rule to provide regex highlighting.

But it doesn't work as intended, the regex highlighting is a mess and yeah it's not a built-in function.

PR's are welcome! The whole shell syntax could use a rewrite.

jeff-hykin commented 1 year ago

should be fixed with v1.2.1, sed is now treated like any other command