Skip to content

Fix @scope parsing to support selector lists#474

Merged
aeschli merged 1 commit intomicrosoft:mainfrom
Arecsu:fix/scope-selector-list
Feb 23, 2026
Merged

Fix @scope parsing to support selector lists#474
aeschli merged 1 commit intomicrosoft:mainfrom
Arecsu:fix/scope-selector-list

Conversation

@Arecsu
Copy link
Contributor

@Arecsu Arecsu commented Jan 27, 2026

The @scope rule parser only accepted a single selector inside the parentheses, causing a false ) expected error when using comma-separated selector lists like @scope (.foo, .bar) { }.

Extract a _parseScopeSelectorList() helper that handles comma-separated selectors, matching the existing pattern used in _parsePseudo() for pseudo-class selector lists.

Fixes microsoft/vscode#290942

@Arecsu
Copy link
Contributor Author

Arecsu commented Jan 27, 2026

@microsoft-github-policy-service agree company="MARTYR X LTD"

@Arecsu Arecsu force-pushed the fix/scope-selector-list branch from 81173ac to c5c2b42 Compare January 27, 2026 19:35
@Arecsu Arecsu changed the title Fix @scope parsing to support selector lists Fix @scope parsing to support selector lists Jan 27, 2026
The `@scope` rule parser only accepted a single selector inside the
parentheses, causing a false `) expected` error when using
comma-separated selector lists like `@scope (.foo, .bar) { }`.

This is valid CSS per the CSS Cascading and Inheritance Level 6
specification, which defines scope-start and scope-end as
<selector-list>.

Extract a _parseScopeSelectorList() helper that handles
comma-separated selectors, matching the existing pattern used
in _parsePseudo() for pseudo-class selector lists.

Fixes microsoft/vscode#290942
@Arecsu Arecsu force-pushed the fix/scope-selector-list branch from c5c2b42 to 6ebfeaa Compare January 28, 2026 05:09
@aeschli aeschli enabled auto-merge (squash) February 23, 2026 14:14
@aeschli
Copy link
Collaborator

aeschli commented Feb 23, 2026

Thanks @Arecsu !

@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 23, 2026
@aeschli aeschli merged commit 39d6045 into microsoft:main Feb 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[scss] @scope rule wrongly expects a parenthesis for multiple selectors

4 participants