Skip to content

Print non-integer number at full precision in inspect mode #2615

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ntkme
Copy link
Contributor

@ntkme ntkme commented Aug 7, 2025

@ntkme ntkme marked this pull request as draft August 7, 2025 22:00
ntkme added a commit to sass-contrib/sass-spec that referenced this pull request Aug 7, 2025
@ntkme ntkme force-pushed the full-precision-inspect-number branch from d6655d8 to 5669090 Compare August 7, 2025 23:04
@ntkme ntkme marked this pull request as ready for review August 7, 2025 23:15
@ntkme
Copy link
Contributor Author

ntkme commented Aug 7, 2025

I did a GitHub search to find out where people are using or abusing meta.inspect. It turns out most of them are just abuses where it can be replaced with interpolation, list append, etc. In those cases this shouldn't really affect the behavior of the output.

It seems that the "legit" real world usage where this proposed change may have a small impact is: https://github.com/oddbird/true/blob/cfcd111acf0c168fd2f02cfa0c2a939dd199c189/sass/data/_details.scss#L127

@mirisuzanne @jgerigmeyer I think this change would actually make the "unpredictable" slightly better, but it would require change to the logic linked above. If you need to support both sass before and after this change, it can be implemented with a feature detection with meta.inspect(1.00000000001) == meta.inspect(1) to see if it supports high precision output for numbers in inspect mode or not.

@nex3 Any thoughts?

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.

Fuzzy equality requires precision of 11 while dart-sass only has precision of 10
1 participant