-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Syntax and language configuration fixes and improvements #286
Merged
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b7c1629
Fix expressions block not having TSX-like highlight on the brackets
Princesseuh 6dcdef4
Add template literal to surroundingPairs
Princesseuh fc51b20
Add grammar test suite
Princesseuh cbe581b
Add README to test directory, add tests for style tags
Princesseuh 3641423
Add support for `is:raw`, maybe?
Princesseuh f2198d0
Add is:raw for script and style tags, add support for script tags wit…
Princesseuh d94764b
Fix missing dummies, use source.unknown for `is:raw`
Princesseuh 0e770dd
Add auto indent support, add wordPattern regex
Princesseuh f08c276
Add support for more JS-like types, inspired by compiler's TSX
Princesseuh ebe92b7
Add spaces in comment completions
Princesseuh 8fe025a
Add support for is:raw components
Princesseuh 04d3d62
Add changeset
Princesseuh 1154e1e
Remove is:raw on script tags and style tags since it doesn't do anyth…
Princesseuh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,7 @@ | |
"brackets": [ | ||
["<!--", "-->"], | ||
["<", ">"], | ||
["{", "}"], | ||
["(", ")"] | ||
["{", "}"] | ||
], | ||
"autoClosingPairs": [ | ||
{ "open": "{", "close": "}" }, | ||
|
@@ -15,8 +14,9 @@ | |
{ "open": "'", "close": "'" }, | ||
{ "open": "\"", "close": "\"" }, | ||
{ "open": "`", "close": "`" }, | ||
{ "open": "{/*", "close": "*/}", "notIn": ["comment", "string"] }, | ||
{ "open": "<!--", "close": "-->", "notIn": ["comment", "string"] }, | ||
{ "open": "/**", "close": " */", "notIn": ["string"] } | ||
{ "open": "/**", "close": " */", "notIn": ["string", "comment"] } | ||
], | ||
"autoCloseBefore": ";:.,=}])>` \n\t", | ||
"surroundingPairs": [ | ||
|
@@ -33,5 +33,36 @@ | |
"start": "^\\s*<!--\\s*#region\\b.*-->", | ||
"end": "^\\s*<!--\\s*#endregion\\b.*-->" | ||
} | ||
}, | ||
"wordPattern": { | ||
"pattern": "([^\\-\\s]+-[^\\-\\s]+)|(-?\\d*\\.\\d\\w*)|([^\\`\\~\\-\\!\\@\\$\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:'\"\\,\\.\\<\\>\\/\\s]+)" | ||
}, | ||
"onEnterRules": [ | ||
{ | ||
"beforeText": { | ||
"pattern": "<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))([_:\\w][_:\\w\\-.\\d]*)([^/>]*(?!/)>)[^<]*$", | ||
"flags": "i" | ||
}, | ||
"afterText": { | ||
"pattern": "^<\\/([_:\\w][_:\\w-.\\d]*)\\s*>$", | ||
"flags": "i" | ||
}, | ||
"action": { | ||
"indent": "indentOutdent" | ||
} | ||
}, | ||
{ | ||
"beforeText": { | ||
"pattern": "<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))([_:\\w][_:\\w\\-.\\d]*)([^/>]*(?!/)>)[^<]*$", | ||
"flags": "i" | ||
}, | ||
"action": { | ||
"indent": "indent" | ||
} | ||
} | ||
], | ||
"indentationRules": { | ||
"increaseIndentPattern": "<(?!\\?|(?:area|base|br|col|frame|hr|html|img|input|keygen|link|menuitem|meta|param|source|track|wbr)\\b|[^>]*\\/>)([-_\\.A-Za-z0-9]+)(?=\\s|>)\\b[^>]*>(?!.*<\\/\\1>)|<!--(?!.*-->)|\\{[^}\"']*$", | ||
"decreaseIndentPattern": "^\\s*(<\\/(?!html)[-_\\.A-Za-z0-9]+\\b[^>]*>|-->|\\})" | ||
} | ||
Comment on lines
+64
to
67
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wow, this will be great! Nice job |
||
} |
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.
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.
There's no cases where you want parenthesizes to count as brackets in the
source.astro
scope, in contexts where they do matter (ex:source.ts
,source.js
,source.tsx
) the languages used there will add them as brackets