{{ message }}
Fix the behavior of Lexer.get_column#978
Merged
Merged
Conversation
e77b303 to
e29d371
Compare
Contributor
Contributor
Author
|
I ran all of the |
Contributor
|
Did you remove the Is my understanding right, that that's obsolete now? |
Contributor
Author
|
Yeah, tests pass without that. |
Contributor
Author
|
Actually, without that check, one of the example files in |
Contributor
|
Will have to check, I just realized, that I never added the examples (elm-tooling/elm-language-server#527 (comment)) to our test suite. I probably thought, it's fixed now and we will never move that code again 😆 |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #516
Fixes #589
Closes #640
Fixes #144
This PR finally makes the
Lexer.get_column(needed for languages like Haskell, Elm) API work properly.get_column, using a test fixture language with Haskell-like layout rules.get_column()get_columnso that it returns a byte count, not a character countRegarding this last item - We originally returned a character count from
get_columnbecause it seemed more technically correct, since GHC counted the unicode characters (as opposed to the bytes) in its implementation of layout. But this adds so much complexity (and perf cost) to our code that I really don't think it's worth it. There could be some slightly incorrect layout-parsing if somebody uses a mixture of different non-ascii whitespace characters for their layout, but this seems like a very uncommon situation./cc @razzeee @tek @bglgwyng @banacorn