-
Notifications
You must be signed in to change notification settings - Fork 5k
Replace Shell grammar with better-shell-syntax (VS Code's grammar source) #7794
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
base: main
Are you sure you want to change the base?
Replace Shell grammar with better-shell-syntax (VS Code's grammar source) #7794
Conversation
9efef42 to
41a5e19
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 98 to 99 in e51c227
| > [!IMPORTANT] | |
| > Pull requests will not be reviewed if the template is not used or not filled in. |
This PR is also invalid as you/AI did not followed the instructions in the CONTRIBUTING.md file for replacing a grammar.
|
I did use Step 1 The grammar compiler doesn't recognize the Step 2 After that one line fix, rebuilding the compiler ( It compiles and passes. The warnings are just VS Code metadata keys ( So this wasn't "not following instructions". The script cannot handle this grammar without the I can close this PR if you'd prefer to keep the archived Atom grammar. This issue has been open for years and I'm starting to understand why. |
I have no problems with replacing the grammar with one that is maintained and makes things better (I'm assuming this is the case here) and I welcome the PR. However the PR isn't complete.
Line 135 in e51c227
Lines 123 to 126 in e51c227
The first four are probably due to things being in an inconsistent state due to the failures that necessitated the changes to the The first four issues would also have been picked up by the tests. |
41a5e19 to
e4239fa
Compare
Description
Replaces the archived
language-shellscript(Atom) grammar withbetter-shell-syntaxby Jeff Hykin, which is actively maintained and used by VS Code.The old grammar provided two scopes:
source.shellandtext.shell-session. Sincebetter-shell-syntaxonly coverssource.shell, thetext.shell-sessiongrammar has been extracted into a standalone repo (shell-session-syntax) and added as a separate submodule.The grammar source uses an
autogenerated/directory for its tmLanguage files, which required adding"autogenerated"toGrammarsInNonStdPathindata.goso the grammar compiler can locate them.The
better-shell-syntaxsubmodule currently points to my fork which includes a fix for variable-length lookbehind assertions (converted to fixed-length PCRE-compatible form). The upstream PR for this fix is pending: jeff-hykin/better-shell-syntax#128. Once merged, the submodule URL can be updated to point to the upstream repo.Ref: #5831
Checklist:
I am changing the source of a syntax highlighting grammar
source.shell) + https://github.com/Chocapikk/shell-session-syntax (text.shell-session)I am adding new or changing current functionality
"autogenerated"toGrammarsInNonStdPathintools/grammars/compiler/data.goto support grammars that store their tmLanguage files in non-standard directories.