forked from sublimehq/Packages
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Merge in upstream changes #1
Merged
Merged
Conversation
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
…r latest dev version
…one for correct JavaScript.
[JavaScript] Remove Mustache templating from JavaScript syntax.
use the same scope for parameter separators in lambdas as for normal methods, for consistent highlighting, and fix bug with lambdas with multiple parameters and no curly braces
Add `border-box`, `text-before-edge`, `text-after-edge`, `ruby-base`, `ruby-text`, `run-in`, `ruby-base-container`, and `ruby-text-container` to CSS syntax for correct highlighting and add `user-select` to completions
…or more consistent color schemes
Numeric accessors used to be matched as constants. Now all invalid accessors (e.g. `abc.123` or `abc.+-`) are highlighted as such.
Define {{digitpart}} as described in the lexical analytics section of the Python documentation. Specifically: Don't allow trailing underscores.
Add support for "repeated N times" in array preamble and improve robustness by matching unexpected nested braces.
...by correcting `((example)+)*` style patterns to `((example)+)?`
[Markdown] improve backtracking on non-sregex engines like Oniguruma
[LaTeX] Improve support for array package
[Python] Do better at matching numbers
[XML] fix comments in doctype international subset
[C#] support object/collection initializers on a separate line
[HTML] support self-closing other/custom tags
[C#] correctly scope casts with namespaces
[CSS] Update missing values/properties
[php] Adds @api to phpdoc highlighting
[C#] make lambda parameter separator scope more specific
[XML] support xml-model preprocessor instructions
[C#] add support for composite string placeholder formatting
[C#] fix catch with generic type and no variable name
[R] major update
[CSS] support nested parens in calc function call
[JavaScript][HTML] Removed HTML comments from JavaScript.
…mpilation [JavaScript] Removed IE conditional compilation. Added test to cover old bug.
[Diff] Handle non-existant files
[CSS][Add] Scope for RGBA hexadecimal
Thom1729
pushed a commit
that referenced
this pull request
Nov 12, 2020
* [CSS] Update to sublime-syntax version 2 This commit contains the minimal required changes to update the syntax definition to version 2 including proposed order of main contexts in the header section and replacement of `pop: true` by `pop: 1` According to existing syntax tests it seems there are no backward compatibility issues. * [CSS] Reorganize color values contexts This commit... 1. creates a CONSTANTS section 2. moves color-values context into the new section 3. organizes color value patterns in variables Note: May need further steps as `color-functions` included by `color-values` feels not logical at this state. * [CSS] Rename color constant scopes This commit renames color-constant scopes to improve consistency. Before this commit color constants are scoped inconsistently: - `w3c-standard-color-name` => name - `w3c-extended-color-keywords` => keywords - `w3c-special-color-keyword` => keyword A "keyword" in a "constant" scope is odd. Mixed plural and singular ... . All of those colors can now be addressed by `support.constant.color.w3c` and further distinguished by [standard|extended|special] sub scopes. * [CSS] Add operators and punctuation sections Adding logical structures goes on. * [CSS] Reorganize property values in variable All pattern lists are organized in variables step by step to be independent from indentation and don't let such lists disturb readability of normal pattern rules. * [CSS] Move unicode-range context Adding logical structures goes on. It is a constant. * [CSS] Reorganize property names in variable All pattern lists are organized in variables step by step to be independent from indentation and don't let such lists disturb readability of normal pattern rules. * [CSS] Move and rename custom-property context Adding logical structures goes on. * [CSS] Refactor selectors section This commit... 1. creates a SELECTORS section 2. moves related contexts into that section 3. organizes constant lists in variables 4. renames the `selector` context to plural to express non-popping behavior 5. cleans unnecessary quotes from patterns 6. turns some anonymous into named contexts * [CSS] Create builtin functions section Just adds the header and fixes comment alignment. The contexts itself stay unchanged at this point. * [CSS] Reorganize property list and values This commit creates two sections 1. PROERTY LIST 2. PROPERTY VALUES to organize property related contexts. * [CSS] Create at-rules section * [CSS] Update comments 1. Create section 2. add `begin` and `end` sub-scopes 3. Include all `*` into punctuation for consistent highlighting. * [CSS] Move selectors section at-rules and selectors are siblings and therefore are organized next to each other. * [CSS] Cleanup at-rules contexts 1. Remove quotes 2. Remove `\s*` where appropriate 3. Remove dangling captures 4. Sort contexts * [CSS] Add named at-rules-content contexts * [CSS] Add missing comments includes * [CSS] Refactor pseudo-class and pseudo-elements This commit ... 1. interprets pseudo-classes and -elements as member-access: div:nth-child(odd) ^ accessor ^^^^^^^^^^^^^^ member a) replace `punctuation.definition.entity` by `punctuation.accessor` b) accessors are no longer scoped `meta.function-call` 2. introduces meta.function-call.[identifier|arguments] scopes 3. optimizes function-call arguments context switches using `set` and by avoiding lookaheads. * [CSS] Refactor selector context part 2 This commit... 1. Improves matching incomplete `#id` and `.class` selectors in cases when only `#` or `.` are present. Note: Pushes a context for identifier matching onto stack, because of a) better performance b) help inherit syntax definitions to inject tags into the selector such as `.<% print(element); %>` without loosing meta scopes. 2. Sorts patterns logically a) common stuff b) html tags c) attribute selectors d) pseudo classes and elements e) combining operators 3. Scope html tags as `entity.name.tag.html.css` * [CSS] Rename qualified-name and vendor-prefix Use plural to express non-popping behavior. * [CSS] Refactor strings and attribute-selector-value This commit ... 1. renames `literal-string` context to `quoted-strings` 2. adds a popping `quoted-string` 3. organizes common quoted-string content in named contexts. 4. uses `quoted-string` in `attribute-selector-value` context in order to support leading whitespace in selector values. * [CSS] Add illegal highlighting in attribute-selectors This commit extends attribute-selector contexts in order to highlight illegal patterns rather than failing with weird broken highlighting. * [CSS] Rename attribute-selector's logical operator scope This commit intents to introduce a more common operator scope, which complies with scope naming guidelines. * [CSS] Rename at-supports logical operator scopes This commit renames the `.logic` scope to `.logical` for consistency reasons and to make it comply with scope naming guidelines. * [CSS] Rename combinators scope This commit turns `combinators` into `keyword.operators` because: a) they express some kind of logical relation to form a query b) such operators are scoped `keyword.operator` in PackageDev's selector syntax as well, which may be compared to CSS selectors. c) it seems more logical as attribute-selectors use this scope, too. * [CSS] Add column-combinator Adds `||` operator see: https://drafts.csswg.org/selectors-4/#the-column-combinator * [CSS] Rename attribute-selector punctuation scopes This commit scopes `[` and `]` as punctuation.section.attribute-selector to comply with scope naming guidelines. * [CSS] Refactor property identifiers This commit... 1. converts several property identifier related contexts into named ones 2. makes use of push->set->set->pop strategy to organize contexts 3. simplifies some patterns * [CSS] Refactor property values This commit... 1. organizes all property-values (counter, font, other) in the property values section 2. simplifies patterns in property value related contexts 3. fixes an issue which caused predefined font-names not to be highlighted correctly, when followed by `!important`. * [CSS] Rename counter name scope This comment changes counter identifier scope to `entity.other.counter-name.css` for consistency reasons as it is already being used in counter functions. * [CSS] Refactor builtin function contexts This commit... 1. applies the same push->set->set-pop strategy for function arguments after the scheme of pseudo-classes. 2. scopes function calls `meta.function-call.[identifier|arguments]`. 3. removes unnecessary quotes 4. renames all function contexts to plural for consistency reasons and to express their non-popping behavior. * [CSS] Update comma-delimiters context This commit... 1. removes unnecessary whitespace patterns and capture groups from the `comma-delimiters` context. 2. renames the `comma-delimiter` to `comma-delimiters` to express non-popping behavior. * [CSS] Tweak illegal-operator scope * [CSS] Rename group punctuation scopes This commit renames `punctuation.definition.group` to `punctuation.section.group` to comply with scope naming guidelines. * [CSS] Rename block punctuation scopes This commit ... 1. adds `meta.block` to `meta.property-lists` 2. renames all braces scopes to `punctuation.section.block.[begin|end]` The goal is to ensure consistent highlighting of all braces. Note: Maybe replacing `meta.property-list` by `meta.mapping` would be more appropriate here, but as that change would also require changes to completions etc. it feels like out of scope at this point. * [CSS] Consistent comma scopes * [CSS] Organize vendor-prefix patterns in a variable * [CSS] Fix custom element chars pattern According to HTML.sublime-syntax and whatwg.org custom elements may contain `.` chars. The current implementation contains an `\\\.` which makes no sense and was fixed in HTML.sublime-syntax before. As fixing the pattern (copy from HTML.sublime-syntax) breaks selectors, this commit simply removes the faulty escaped dot. * [CSS] Rename line-names scopes This commit... 1. removes unnecessary quotes from patterns 2. adds `meta.line-names.css meta.brackets.css` scope 3. renames punctuation to `punctuation.section.brackets` * [CSS] Refactor custom-property contexts This commit ... 1. splits custom-property definitions and references 2. scopes definitions as `entity.other.custom-property` as `support.type` is not appropriate because these are user defined variables. 3. scopes references as `variable.other.custom-property` as this is what they are. 4. removes stacked scopes (except `invalid.deprecated`). 3. renames `keyword.other...prefix` to `entity.other...prefix` as the whole word should be addressable by `entity.other.custom-property`. The editor uses invalid.deprecated only anyway, so this shouldn't change much. 5. Enable 'Goto Definition' and 'Goto Reference' for custom properties. * [CSS] Remove dash from word_separators Many selectors contain `-` thus it feels like removing it is logical. * [CSS] Add meta.string.css scopes This commit adds `meta.string.css` in order to support interpolation. * [CSS] Rename unicode-range context Use plural to express non-popping behavior. * [CSS] Reorganize values/functions/constants This commit ... 1. renames `-type` contexts to `-constants` as this is what those contexts contain. Specs name it `type`, which is correct as those constants are of certain kind, but it reads as those would contain type definitions. 2. adds sections for string- and numeric- constants 3. Contexts which may contain functions and constants are named `-values`. 4. All non-popping contexts use plural names. 5. Sort some context imports to achieve the same order everywhere. This commit doesn't change the overall behavior of the syntax. * [CSS] Sort constants sections alphabetically * [CSS] Rename at-supports-parens to -groups This commit... 1. renames at-supports-parens to match the meta.group scope name 2. swaps groups and operators includes as it is a habit to always have groups and blocks first in a context. * [CSS] Fix HTML and PHP syntax tests * [CSS] Use meta.brackets in attribute-selectors This commit... 1. stacks `meta.brackets` onto `meta.attribute.selector` 2. renames `punctuation.section` accordingly. The goals: 1. Common scopes for brackets to ensure consistent highlighting. 2. Improve compliance with scope naming guidelines. * [CSS] Rename qualified-names context to namespace-prefixes This commit renames the context as it doesn't contain patterns for qualified names, but only namespaces used to form the former ones. * [CSS] Tweak attr function This commit introduces a popping `var-function` context being used in `attr-functions` arguments. It is to ensure to correctly pop the first context after matching the first pattern. * [CSS] Move operators/punctuation sections This commit moves operators and punctuation section to the end of the document and adds a prototypes section to follow the scheme of other syntax definitions. * [CSS] Remove quotes from variables * [CSS] Add some bailouts to help with incomplete groups * [CSS] Add missing meta.group in at-media context * [CSS] Simplify at-keyframe-names context Remove unnecessary context switches. * [CSS] Simplify media-query context Remove unnecessary context switches. * [CSS] Tweak unicode-ranges scope This commit follows the CSS3 package and scopes unicode-ranges `constant.numeric` * [CSS] Add named context for line-names-content * [CSS] Move unicode-ranges to numeric constants section * [CSS] Workaround for core issue sublimehq#3666 see: sublimehq/sublime_text#3666 * [CSS] Add more named contexts This commit turns remaining anonymous at-rule contexts into named ones to be prepared for inheritance. * [CSS] Fix at-rule termination This commit uses `at-rule-end` as prototype in all at-rule contexts and makes sure to pop only if `;`, `{` or `}` are matched. The last one is additionally matched to handle incomplete code blocks. Source: https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule At-rules are CSS statements that instructs CSS how to behave. They begin with an at sign, '@' (U+0040 COMMERCIAL AT), followed by an identifier and includes everything up to the next semicolon, ';' (U+003B SEMICOLON), or the next CSS block, whichever comes first. * [CSS] Add at-namespace-identifier context Another workaround for sublimehq/sublime_text#3666 * [CSS] Add at-page-identifier context Another workaround for sublimehq/sublime_text#3666 * [CSS] Remove capture group from at-font-face context Makes it comply with the other contexts. * [CSS] Add at-rule keyword punctuation tests This commit is to ensure keyword and punctuation.definition scopes of all at-rule keywords to be stacked in correct order. * [CSS] Tweak at-rule-end As `;` is matched in main context the capturing rule-terminator context is replaced by a lookahead. Hence `;` no longer receives `meta.at-rule` scope as it does not receive `meta.property-value` in property lists. This is to increase consistency of meta scopes. * [CSS] Add at-rule meta scope tests This commit adds various meta scope related tests to ensure rule, group and block boundaries are matched correctly and to clarify the difference between at-block and rule-list usages. * [CSS] Remove rule-terminator context Globally match all `;` in property lists using `rule-terminators` to ensure to highlight them all properly. As a result the consuming `rule-terminator` context is obsolete. Notes: 1. It is not intended to highlight stray semicolons as they no real syntax errors and don't prevent proper evaluation. 2. This commit doesn't change the behavior as `meta.property-value` is assigned via `meta_content_scope` directive and thus wasn't assigned to the `;` before. * [CSS] Remove obsolete eol-pop context * [CSS] Add various at-rule spec links * [CSS] Improve media-queries context This commit applies parsing rules from https://drafts.csswg.org/mediaqueries-5/#media It adds... 1. range operators <, >, <=, >= and = as keyword.operator.comparison 2. allows nested groups according to https://drafts.csswg.org/mediaqueries-5/#mq-syntax * [CSS] Add MEDIA QUERIES section Media queries are used in several at-rules and consist of various contexts. Both justify a dedicated section for logical grouping. * [CSS] Add at-rule other fallback context Completions may want to see a `meta.at-rule` and we might not want to fail on unknown/experimental/new at-rules even though special constants can't be highlighted then. This commit therefore adds a general `at-other` context which fulfills the least syntactical rules to highlight at-rules according to https://www.w3.org/TR/css-syntax-3/#at-rule Note: Any `@<ident> ... [ {} | ; ]` is valid syntax even though the rule might not (yet) be implemented. A syntax definition is to highlight proper syntax. It should not be used for linting too much. This is what all the various LSP plugins or SublimeLinter can do. * [CSS] Fix #id tokens This commit introduces a `name` variable and uses it instead of `{{nmchar}}+` in various situations. This is to improve compliance with CSS tokenization specification. The `name` is defined at https://www.w3.org/TR/css3-selectors/#lex and is matched in HASH (after `#`) and IDENT (after `--`). The main goal is to fix `#id` selector highlighting if the id is of numeric type. * [CSS] Tweak nmstart and nmchar variables This commit modifies the `nonascii` part of `nmstart` and `nmchar` to make it match the specification see: https://www.w3.org/TR/css3-selectors/#lex The spec says: "nonascii [^\0-\177]" In short: A name or identifier may consist of all unicode code points which are not part of ASCII. Related rules: ident [-]?{nmstart}{nmchar}* name {nmchar}+ nmstart [_a-z]|{nonascii}|{escape} nonascii [^\0-\177] unicode \\[0-9a-f]{1,6}(\r\n|[ \n\r\t\f])? escape {unicode}|\\[^\n\r\f0-9a-f] nmchar [_a-z0-9-]|{nonascii}|{escape} * [CSS] Add custom-media-identifier Adapted from CSS3 package as the token has existed in syntax tests without scope. * [CSS] Tweak at-charset pattern This commit moves `scope:` to capture group `0:` as this is the way patterns of all the other at-rules are implemented. * [CSS] Enforce identifier break With regards to {{nmchar}} variable \b is not a sufficient pattern to match identifier or name boundaries. This commit therefore replaces all trailing \b by a custom pattern. As using (?!{{nmchar}}) doubles parsing time an optimized alternative is implemented as {{break}}. Note: To be able to remove leading \b we'd need to ensure to match all tokens in all contexts, which look like names or identifiers. * [CSS] Update known html tags This commit updates the `html_tag_names` variable with categorized html tags from https://developer.mozilla.org/en-US/docs/Web/HTML/Element Note: Some of the existing tag names seem to be svg tags. They are maintained in a dedicated `svg_tags` variable to avoid breaking things. * [CSS] Add at-page-margin contexts This comment adds support for page margin at-rules. see: https://www.w3.org/TR/css-page-3/#margin-at-rule * [CSS] Add missing comments context includes * [CSS] Fix attribute-selector wildcard attribute name * [CSS] Add `disc` and css-wide keywords to invalid counter-style names That's what the specs say about it. * [CSS] Update counter-style-system property This commit adds a dedicated context for @counter-style { system: ; } in order to properly support `extends: <counter-style-name>`. Note: 1. This may be useful for goto definition / goto reference in future. 2. goto definition/reference may need to scope the identifier as variable. I kept `entity.other` unchanged for compatibility reasons at this point. Scope names may need further discussions. * [CSS] Reorganize counter-property in dedicated section * [CSS] Reorganize font-property in dedicated section * [CSS] Add counter-style-speak-as property * [CSS] Reorganize font-name-constants in a variable * [CSS] Consolidate counter-style test cases Move and extends counter-style attribute tests to the existing block which already contains a bunch of those and remove the obsolete blacknwhite counter-style rule. * [CSS] Add var() highlighting to speak-as values * [CSS] Reorganize builtin property values * [CSS] Handle illegal blocks in property lists Highlight illegal braces according to https://www.w3.org/TR/CSS22/syndata.html#parsing-errors * [CSS] Handle unknown at-rules Unknown at-rule keywords are to be ignored, while maintaining bracket and terminator balancing; see: https://www.w3.org/TR/CSS22/syndata.html#parsing-errors At-rules with unknown at-keywords. User agents must ignore an invalid at-keyword together with everything following it, up to the end of the block that contains the invalid at-keyword, or up to and including the next semicolon (;), or up to and including the next block ({...}), whichever comes first. * [CSS] Reusable block-end context * [CSS] Update media queries This commit... 1. adds support for `var()` and `calc()` functions 2. creates a dedicated `ration-constants` context 3. highlights vendor prefixes the same way as in other places without stacking `support.type.property-name` 4. adds missing level 4 and 5 property names 5. adds missing level 4 and 5 property values and some comments about the properties they belong to * [CSS] Compact unicode-range pattern * [CSS] Consistent case insensitive patterns This commit turns all into case insensitive patterns. Some patterns already were, others not. According to CSS specs all tokens are to be matched case insensitive. May not be the best style but doesn't create parse errors in browsers. Note: This causes lexing times to increase, so we are where we started. The original test file requires 16ms (was 17ms). * [CSS] Fix counter-style name highlighting Only in context of a counter-style prelude several constants and keywords are considered illegal. This is fixed here. This commit also 1. removes `counter_styles` from common `property-values` as those tokens are already matched in all proper contexts. 2. adds `none` to the list of predefined `counter_styles` to simplify word boundary handling. * [CSS] Scope at-rule keywords as keyword.control.directive From reading specifications at-rules some of them may be compared to preprocessor directives. Some are used to import rules, others are of conditional meaning which cause certain selectors/rules to be applied only if certain criteria are matched. Hence this commit applies `keyword.control.directive` for all at-rule related keywords. This scope is a) used in Erlang b) is the most recent agreed scope for such things c) shouldn't impact highlighting too much as `keyword.control` is maintained. The keyword's name is removed from scope as it doesn't seem to make much sense and it can be addressed by the meta scope if needed. e.c.: meta.at-rule.charset keyword.control.directive * [CSS] Common scope for all wildcards Notes: - Another `entity` might not be useful. - `keyword.operator` is used by other syntaxes but might lead to confusion with logical operators easily. - An asterisk might be a `constant.other.placeholder` - Decided for `variable.language` as we also use that for `_` (python) to denote such special variables. * [CSS] Fix custom element tags patterns Custom elements consist of lowercase characters only according to the specs. So revert those case-insensitive changes for them. * [CSS] Add some reserved custom element tags According to the specs several tags looking like custom-elements are reserved for use by SVG and MathML. This commit adds those to the list of svg tags. * [CSS] Highlight counter-style-names in fallback property May be used to drive goto reference/goto definition in future. * [CSS] Consolidate counter/style idents This commit... 1. reuses `counter-identifier` and `counter-style-identifier` contexts in properties and function arguments to ensure consistent scope names. 2. adds patterns to highlight predefined counter-styles in appropriate contexts. 3. moves counter related functions into a separate context. 4. adds some tests to ensure incomplete counter function statements to behave correctly. * [CSS] Fix misc counter-style related tests * [CSS] Rename other-property to builtin-property `other` sounds like unspecified or user defined, but this context actually matches builtin property names. * [CSS] Add illegal-groups context Fixes sublimehq#1100 This commit adds an `illegal-groups` context in order to keep bracket balancing intact when detecting an unexpected parenthesis. It follows the `illegal-blocks` context to fulfill the behavior described at https://www.w3.org/TR/CSS22/syndata.html#parsing-errors Parentheses are unexpected ... 1. outside of blocks / property-lists 2. within selectors 3. within other groups after `var()` was matched. Note: `var()` functions are to be supported in all property-value like situations. Hence the context is already included in most/all property value and function call argument contexts. Including `illegal-groups` in `var-functions` therefore enables correct matching to hopefully all appropriate contexts without further efforts. It is expected to match valid parentheses before `var-functions` contexts are included. * [CSS] Move var-functions contexts Sort builtin-functions contexts alphabetically. * [CSS] Move calc-functions contexts Sort builtin-functions contexts alphabetically. * [CSS] Move attr-functions contexts Sort builtin-functions contexts alphabetically. * [CSS] Move color-functions contexts Sort builtin-functions contexts logical and alphabetically. Seems to belong next to filters. * [CSS] Move crossfade-functions contexts Sort builtin-functions contexts logical and alphabetically. * [CSS] Create context for repeat() * [CSS] Rename minmax-functions Rename it to make clear it belongs to grids. * [CSS] Add tests for uppercase tags and properties Fixes sublimehq#1017 Ensures fixes for the mentioned issue. * [CSS] Add missing test rules * [CSS] Remove special scope for media properties This commit removes `.media` sub scope from `support.type.property-name` within @media rules. It is the only use case of such a special case and adding those for all kinds of properties to provide consistency is too much of effort. * [CSS] Highlight utf8 percent characters in urls This commit follows commit e12b971 and adds ridge url highlighting by scoping utf-8 percent characters in url strings. specs: https://url.spec.whatwg.org/#userinfo-percent-encode-set Notes: 1. The intention is to provide consistent url highlighting in HTML/CSS. 2. The implementation follows the one in HTML and adds `meta.path.url` to the string content. It is injected before `meta.string` for the same reasons: Ensure `meta.path` is maintained even if string scopes are cleared for interpolation reasons by 3rd party syntaxes. * [CSS] Add common function arguments context This commit adds `function-arguments-common` context which takes common arguments patterns and cleans up `group-end` to only contain the primary `\)` pattern such as `block-end2`. This is to enable special handling of secondary bailouts, if needed. * [CSS] Tweak media query group bailout Media queries are separated by `,` but groups may not contain them. Hence `,` is added to the list of bailout patterns to maintain highlighting in case of missing `)`. * [CSS] Remove special scope for media operators This commit follows the removal of special scopes for property names and does so for logical operators in media queries as well. * [CSS] Add import test to verify media queries * [CSS] Keyframe names may be quoted strings * [CSS] Limit supported keyframe seletors This commit replaces `main` by only supported contexts in keyframe declaration block. * [CSS] Fix from,to keyword scopes 1st and 2nd level should only contain agreed scopes according to naming guidelines. * [CSS] Scope keyframe selectors meta.selector.css * [CSS] Reorganize media-queries contexts This commit... 1. renames the main context to `media-queries` as the `-content` suffix indicates a required opening pattern, which does not exist. 2. renames `media-query-types` to `media-query-media-types`. 4. adds named contexts for property names and values to help inherited syntaxes to override or extend them. * [CSS] Rescope pseudo class argument constants Those are normal predefined constants. No special keywords with certain functionality. We might want to express that by using common scopes. * [CSS] Scope dir() arguments as constants Only `ltr` and `rtl` should be matched within :dir() pseudo classes. * [CSS] Highlight invalid keyframes identifiers Globally reserved words may not be used as custom-identifier. See: https://www.w3.org/TR/css-values-4/#custom-idents * [CSS] Use common invalid identifier scope everywhere * [CSS] Add named at-counter-style-names context May help inheritance. * [CSS] Add named at-page-names context May help inheritance. * [CSS] Exclude prototypes in function calls This commit prevents inherited syntax definitions from injecting prototypes between function identifiers and arguments groups. * [CSS] Add :nth-col and :nth-last-col pseudo classes * [CSS] Reorganize pseudo-class contexts Splits them into several named contexts per pattern to help extending them by inherited syntaxes. * [CSS] Reorganize common selector contexts Don't fit into pseudo-class section, so moves them out. * [CSS] Add dedicated lang-pseudo-class context This commit handles `:lang()` pseudo-class special, as its arguments may contain a comma-separated list of language-range identifiers, which may be quoted or unquoted strings. The latter ones may contain wildcards. see: https://drafts.csswg.org/selectors-4/#the-lang-pseudo * [CSS] Add support for functional pseudo-elements * [CSS] Group rational constants under scalars A rational value (e.g. 21/9) without unit is a scalar value same as a scalar float but with a different representation. This commit... 1. renames and moves the context accordingly 2. scopes rational numbers as such. We know it from Ruby. * [CSS] Tweak legacy pseudo-elements handling This commit... 1. updates some comments about pseudo classes and elements. 2. leaves `pseudo-element-css2` context include after `:` only as those patterns are already matched by `pseudo-element-regular` after `::`. It doesn't change parsing behavior/result. * [CSS] Remove :drop() pseudo class This commit removes the special context for `:drop()` pseudo class, as 1. it can't be found at https://drafts.csswg.org 2. it is not listed at caniuse.com 3. the only reference found at stackoverflow seems dead 4. the only thing lost by removing it is special highlighting of argument constants like `active`. Seems to be a feature which never matured beyond draft state. * [CSS] Create one token for :// in urls Propably helps ligatures and reduces amount of tokens from 3 to 1. * [CSS] Tweak unquoted url-token patterns This commit implements unquoted url token parsing according to specs at csswg.org Matching single or double quotes or opening parentheses causes a bad-url-token to be returned. It would normally mean to highlight everything as illegal, but I don't want to start branching at this point. * [CSS] Stricter functional pseudo-class patterns Only add meta.function-call scope if a pseudo-class looks like that. * [CSS] Move language-ranges into the correct section It's an unquoted string. * [CSS] Enhance cross-fade(), image() and image-set() functions This commit implements those functions according to the specification. Thay are still highly experimental and rarely supported by browsers, but have existed in this syntax before. The `string-unquoted` is removed as those functions don't support them. The `quoted-strings` context is replaced by `quoted-urls` as all quoted strings contain urls in those functions. * [CSS] Reorganize page-margin at-rule names in a variable. May help inherited syntaxes * [CSS] Revert punctuation.accessor to punctuation.definition CSS denotes the different kinds of selectors by the opening punctuation. The concept of accessor would either need to be applied to all those elements or to nothing. With the usage of stand-alone pseudo classes as identifier of a page at-rule, it feels more appropriate to keep going with `punctuation.definition` in all situations. * [CSS] Update generic-font-families variable Adds more level 4 constants. * [CSS] Remove scalars from keyframe selectors We prefer to use the syntax for validation purposes, instead of maintaining highlighting of incomplete expressions. * [CSS] Consolidate font property tests * [CSS] Handle vendor-prefixes in pseudo-classes/elements This commit ensures to handle vendor prefixed pseudo classes and elements the same way as other properties and constants and to scope those in any kind of token. * [CSS] Fix property-name word boundaries * [CSS] Consolidate identifiers Any custom CSS identifier may look like `--1dent`, `-name1` or `name2`. In some situations only the first one is appropriate, in others we might only match the latter two as the first one is handled separately. See custom-property for instance. This commit splits `ident` variable into those two major groups to be used where needed. `punctuation.definition` is removed from custom properties for consistency reasons. To keep it there would mean to add it to any other custom property, which includes quite a number of patterns to customize, which felt not worth it at this point. The class #id must consist of a valid custom identifier so `#1` is not valid. * [CSS] Start grouping builtin property value constants * [CSS] Fix meda-queries property values The `hover` property-value was highlighted as property-name before. * [CSS] Fix property-value word boundaries Consume unknown identifiers to prevent tokens to be partly highlighted as something known in the middle of a word. * [CSS] Add justify-items and justify-self property * [CSS] Rename at-block to at-rule-block The name `at-block` looks like a context name of an `@block`. To avoid that this commit follows `at-rule-end` and renames `at-block` to `at-rule-block`. * [CSS] Remove obsolete bailout Possible due to 93bffe9 * [CSS] Fix local() function arguments This commit adds support to highlight all kinds of font-family names in `local()` arguments groups. * [CSS] Refactor var() fallback values This commit makes use of multi-set statement to... 1. match the first identifier as custom property name reference, only. (This is to comply with other use-cases this strategy is already applied to.) 2. add support for unquoted strings in default values. The `font-property-value-content` context is used which includes the `font-family-names` context. This causes a space separated list of identifiers to be scoped `string.unquoted`. * [CSS] Revert grid-...-functions context names The `grid-` prefix doesn't match the naming scheme somehow. * [CSS] Second approach to reorganize builtin functions This commit organizes builtin function contexts in sections to group them by "library" or logical/functional context. It doesn't change a pattern. * [CSS] Add other-functions context This commit attempts to avoid breaking syntax highlighting due to unknown functions being called. Using `variable.function` should enable color schemes to distinguish them from valid builtins. * [CSS] Scope unknown constants as constant.other This commit attempts to avoid breaking syntax highlighting due to unknown constants being used. Using `constant.other` should enable color schemes to distinguish them from valid builtins. * [CSS] Offer property completions in property-lists only This commit limits property name completions to property lists and incomplete property names. 1. `meta.property-list` Immediately suggest properties via ctrl+space in { } blocks. 2. `meta.property-name` Suggest in inline html style tags or whenever the syntax started detecting a property name. We might not want properties suggested in at-rules or outside of blocks. * [CSS] Don't append semicolon in groups If property value completions are provided within groups, a trailing semicolon is to be omitted as it breaks syntax. Examples: @media screen and (min-with: |) {} must not result in @media screen and (min-with: 10px;) {} but @media screen and (min-with: 10px) {} The caret is represented by `|` * [CSS] Organize grid constants in named context Avoids duplicate definitions. * [CSS] Organize direction constants in named context Avoids duplicate definitions. * [CSS] Add some spec references * [CSS] Consolidate keywords under keyword.other Replaces `support.keyword` and names scopes according to usage. * [CSS] Replace remaining unquoted string
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.
No description provided.