Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Always send correct end column when formatting #1422

Merged
merged 1 commit into from
Apr 11, 2019

Conversation

Xanewok
Copy link
Member

@Xanewok Xanewok commented Apr 11, 2019

Closes #1421.

Previously we sent u64::max_value() in hope that it'll be supported by editors and to signify a 'line-wide' edit but now we try to always do the right thing and send an accurate diff.

@norru
Copy link

norru commented Apr 11, 2019

Ace, is this going to make it for tonight's nightly?

@Xanewok Xanewok merged commit 40778f5 into rust-lang:master Apr 11, 2019
@Xanewok Xanewok deleted the reformat-range-fix branch April 11, 2019 16:02
@Xanewok
Copy link
Member Author

Xanewok commented Apr 11, 2019

I don't think we'll make it - nightlies are deployed around UTC and the fix probably doesn't warrant bumping the submodules in Rust tree with increased priority. Having said that, I hope it'll make it in tomorrow's nightly; I'll prepare an update PR.

@Xanewok
Copy link
Member Author

Xanewok commented Apr 11, 2019

@norru by the way, does the formatting fail with the "character":<u64::max_value()> or does it just look really strange in the logs? Wasn't sure what's the case, I'd like to verify before sending the Rust PR.

@norru
Copy link

norru commented Apr 11, 2019

No formatting happens.

LSP4E rejects the entire response, as it contains an invalid range, and does nothing.

@norru
Copy link

norru commented Apr 11, 2019

I hereby summon @mickaelistria

@Xanewok
Copy link
Member Author

Xanewok commented Apr 11, 2019

LSP4E rejects the entire response as it contains an invalid range and does nothing.

Alrighty then, makes sense.

@mickaelistria
Copy link

The spec doesn't allow erroneous position. Eclipse LSP4E client fails (an exception happens because of invalid value) and the response triggers no edit on client side; but maybe some other clients may be more tolerant and could deal with it.
But in any case, the spec says that positions have to be accurate, so sending erroneous position is not supposed to be supported in the general case.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Formatting broken in nightly-2019-04-11
3 participants