-
Notifications
You must be signed in to change notification settings - Fork 357
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
Add spans to the Selector AST #1783
Comments
Even without taking interpolation into account, complex and compound selectors won't have a single span as source (due to the nesting features, and mixins might even make them combine simple selectors from different files). Note that the |
For nested selectors, we'd generally fall back to using the innermost span when necessary. You're right that that does increase the complexity of the translation, though. |
Currently the selector AST used by Sass and exposed by
sass_api
doesn't expose source span information. This information is tricky to determine, because selectors are interpolated in the source file. However, it should be possible to map the source spans from the parsed string back to the original file by tracking where the source offsets of the interpolated sections begin and end, and thereby get accurate spans for the selectors.This would allow us to improve a number of error/deprecation messages, and make the Kythe indexer implementation cleaner.
The text was updated successfully, but these errors were encountered: