Skip to content
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

fix(formatting/#2820): Range overflow when parsing ranges from extension host #2825

Merged
merged 2 commits into from
Dec 12, 2020

Conversation

bryphe
Copy link
Member

@bryphe bryphe commented Dec 12, 2020

Issue: Onivim 2 wasn't correctly handling ranges from the extension host that were created with Number.MAX_VALUE (or, any value with any exponent...). A ParseFailedException("Expected null or:\n while decoding a list:\n element 0:\n in field \"range\":\n in field \"endColumn\":\n Expected an int, but got 1.7976931248623157e+308\n". was being produced.

Defect: Our JSON parsing was only handling integers

Fix: Use the float JSON decoder, which does handle exponents, and cast to an int - handling overflows.

This fixes the parse failure, and allows for some basic formatting - but I'm still seeing some quirks with the ReScript formatter, when updating the buffer and running the formatter again.

Related #2820

@bryphe bryphe merged commit f980d9f into master Dec 12, 2020
@bryphe bryphe deleted the fix/formatting/2820/range-overflow branch December 12, 2020 18:42
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