AdguardTeam / AdguardTeam/VscodeAdblockSyntax

Add `meta.*` category scopes (`comment`, `cosmetic`, `network`) and exception flag to Adblock TextMate grammar

Open
#158 0 comments 0 reactions 1 assignee Assigned to @totadavid95 View on GitHub
Priority: P4 Status: Code Review
Dominant language
TypeScript
Stars
88
Forks
8
PR merge metrics
No merged PRs in 30d

Description

Introduce three category wrapper scopes and one orthogonal exception flag into `adblock.yaml-tmlanguage` using `begin`/`end` blocks around existing patterns (preserving all leaf scopes), then update and extend the grammar test suite with category-aware assertions across all rule families.

**Key changes**:
- Replace top-level `patterns` with `commentRules`, `cosmeticRules`, `networkRules` wrappers carrying `meta..adblock`
- Add `meta.exception.adblock` for allowlist rules (`@@` network, `#@#`/`$@$` cosmetic variants)
- Add scope constants (`META_COMMENT_SCOPE`, `META_COSMETIC_SCOPE`, `META_NETWORK_SCOPE`, `META_EXCEPTION_SCOPE`)
- Update all existing test scope arrays with category scopes
- Add new `category-scopes.test.ts` cross-cutting suite covering every rule family + exception flag

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.