-
-
Notifications
You must be signed in to change notification settings - Fork 388
Int maxBound causes non-integer JSON value for outline #726
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
Comments
This bug has been annoying me so I decided to poke at it a bit. |
Is using 1000 as the end line a pragmatic and absolutely fine solution, which doesn't require us to trip into lots of corner cases behaviours? In truth, I think 10 would probably be absolutely fine, and maybe even preferable - the "fall back" behaviour of highlighting the entire file in red squigglies makes it way harder to edit the file for real. |
And the proper solution is to fix GHC, the end position is ignored so that when reading just the header it gives a result, but that is a separate rule in the grammar, so the one parsing the whole file (which we use) could actually populate this properly. But @ndmitchell 's comment is still valid, having a squiggle for the whole file makes the UI unwieldy. |
If others can come to a consensus about what we would like to do here I am happy to put together a patch. |
This is for an outline, and I understand the top-level element needs to completely wrap the children. I may be wrong though. If that is the case, a workaround would be to set the end span to the same as the end span of the last child element in the outline. |
The underlying representation in lsp changed to match lsp spec one so maybe it fixed this, feel free to reopen if you continue hitting the bug |
See emacs-lsp/lsp-mode#2435
It comes about from the following
where the HsModule span does not have a reasonable value, due to the way GHC parses a module.
I think we should either limit it to something that can be represented in JSON without going to floating point, or perhaps leave out this span in the outline. Or get the end from the actual length of the file.
The text was updated successfully, but these errors were encountered: