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

Range miscalculation when using Let expressions #63

Closed
jfmengels opened this issue Jun 16, 2020 · 0 comments
Closed

Range miscalculation when using Let expressions #63

jfmengels opened this issue Jun 16, 2020 · 0 comments

Comments

@jfmengels
Copy link
Collaborator

module TestModule exposing (..)

a =
  let
    c = 1
  in
  2
  
-- hello

b = 3

In the code above, the range for a is considered to be

{ start = { row = 3, column = 1 }
, end = { row = 11, column = 1 }
}

This is incorrect, as that would mean that a's range ends where b starts. Also, that means that removing the a node means deleting the comment in between a and b (which is how I noticed the problem).

If the let expression is removed, like here:

a =
  2
  
-- hello

b = 3

then a's range is correct and equal to

{ start = { row = 3, column = 1 }
, end = { row = 4, column = 4 }
}

Interactive Ellie with it at: https://ellie-app.com/99hdDGwS24La1

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

No branches or pull requests

1 participant