Skip to content

Add absolute source offsets to parsed selector nodes - #341

Draft
DeepanshuPal wants to merge 4 commits into
postcss:mainfrom
DeepanshuPal:fix/source-offsets-251
Draft

DeepanshuPal wants to merge 4 commits into
postcss:mainfrom
DeepanshuPal:fix/source-offsets-251

Conversation

@DeepanshuPal

Copy link
Copy Markdown

Addresses #251. Parsed nodes now include zero-based UTF-16 source.start.offset and inclusive source.end.offset, derived from the tokenizer's existing positions. The public TypeScript declaration includes the optional offsets.

Tests cover multiline and nested selectors, CRLF, attributes, named combinators, empty pseudos, and words joined from multiple tokens. I claimed the issue after the maintainer welcomed a PR. Opening as a draft for review.

Validation: npm test (804 passed), lint, typecheck and coverage passed; git diff --check passed. format:check fails only on untouched src/__tests__/exceptions.mjs, which fails on the clean HEAD as well. AI assistance was used for investigation and implementation; outputs and tests were reviewed locally.

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.

1 participant