TextMate Preferences: Refactor Syntax#381
Merged
FichteFoll merged 19 commits intoSublimeText:masterfrom Sep 2, 2022
deathaxe:pr/refactor-tmpreferences
Merged
TextMate Preferences: Refactor Syntax#381FichteFoll merged 19 commits intoSublimeText:masterfrom deathaxe:pr/refactor-tmpreferences
FichteFoll merged 19 commits intoSublimeText:masterfrom
deathaxe:pr/refactor-tmpreferences
Conversation
This commit adds support for the following tmPreferences keys - indentationFoldingEnabled - scopeFoldingEnabled - foldScopes Some effort has been made to avoid highlighting the whole file invalid in various incomplete code scenarios.
This commit removes some unnecessary push-pop operations from tmPreferneces files.
1. Adds missing `array-end` context 2. renames `end-of-array` to `inside-array` and moves right next to `inside-outer-dict.
`inside-dict-key` is terminated by that context already.
1. Converts anonymous into named contexts 2. Updates to sublime-syntax version 2 3. Avoid backrefs for closing tags 4. Fix closing `</plist>` being scoped `meta.inside-plist` 5. Reorganize contexts logically
1. Some syntax changes require selector adjustments. 2. Some broken selectors are fixed. 3. Use `keyword` rather than `snippet` kind for (in-key) completions. 4. Add foldScopes related completions and snippets.
Enable auto completions everywhere but in values, except shell variables and scope selectors.
Only highlight tag name invalid.
1. Handle incomplete opening tags as if they were closed normally. => Push target context onto stack 2. Match incomplete or illegal closing property list tags and pop contexts normally then to avoid breaking syntax highlighting of subsequent elements. 3. Only highlight one whitespace in front of next tag illegal instead of the whole content. By doing so the syntax follows core XML more closely.
ST's `close_tag` requires an incomplete closing tag not to be scoped `meta.tag` to perform its job.
Avoid adding extra `<` if user started typing `<` followed by `plist` to add the snippet. It follows the scheme used by core HTML syntax for `html` snippet.
Until this commit & after groups caused following selector segments
to be scoped invalid:
( ... ) & illegal-highighted-but-valid-selector
With this commit they are handled well:
( ... ) & selector
jrappen
reviewed
Aug 23, 2022
jrappen
reviewed
Aug 23, 2022
jrappen
reviewed
Aug 23, 2022
jrappen
reviewed
Aug 23, 2022
FichteFoll
approved these changes
Sep 2, 2022
Member
FichteFoll
left a comment
There was a problem hiding this comment.
Thanks for the addition of foldScopes as well as the refactoring in general.
I have added a few fixes on top (like changing the "entry" snippet triggers back to e as we do for all other resource files and adding an exit condition for scope selectors inside CDATA), but please refer to the individual commits for details.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #377
This PR ...
Note: Majority of scopes is kept unchanged or tweaked only a little bit as many packages/color schemes seem to rely on them.