Update Swift grammar and upstream repository #197470
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
👋 Hi! I'm the maintainer of the Swift language grammar at textmate/swift.tmbundle. Recently, I've migrated development of the grammar over to a new repo under my account at jtbandes/swift-tmlanguage.
This PR changes the
update-grammar
script to point at the new repo, and to update from the .json directly rather than the plist (my repo now includes a .json pre-generated from the canonical .yaml).I've also just implemented some much-needed updates to the grammar, including support for new language features like regular expression literals and macros, as well as improved VS Code compatibility, such as fixes for #134616 & swiftlang/vscode-swift#366 and workarounds for microsoft/vscode-textmate#164 & microsoft/vscode-textmate#140.
I usually do manual testing against my grammar-test.swift file which tries to exercise most of the grammar's features — but let me know if there are any other ways this should be tested before merging.
(One issue I'm aware of is that the Swift language server in the vscode-swift extension uses different scopes for some things, leading to significant color changes when the language server is enabled or disabled. I'm not sure if this is considered a major issue, or perhaps it's common among languages that have both a LSP implementation and a "fallback" extension with a TextMate grammar? Let me know if that's something you'd like me to address or bring up with the vscode-swift extension authors 🙂)