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

Incorrect range position at end of file in files not ending with whitespace. #5385

Closed
scabug opened this issue Jan 18, 2012 · 4 comments
Closed
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Jan 18, 2012

A source file without blank/newline at the end has incorrect positions for trees that run until the end of the file.

An example: a file class A without a trailing space has the end position 6 for the PackageDef, ClassDef, Template, etc. If I insert a space at the end of the file, the positions correctly end with 7.

I have several workaround for this in the scala-refactoring library, but every few weeks I find another case where I don't handle this properly, so I'd prefer a proper fix in the compiler :-)

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Jan 18, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5385?orig=1
Reporter: Mirko Stocker (misto)
Affected Versions: 2.9.2

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Jun 25, 2012

Mirko Stocker (misto) said:
It looks like Paul has a fix for this:

https://github.com/paulp/scala/commit/4868d655ad8769f58f923154a1a31373ead71a45

Any chance this could be merged into master?

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Jul 10, 2012

@hubertp said:
Should go to 2.10. Paul's fix is probably the way to go.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Jul 24, 2012

@hubertp said:
Fixed in #924.

@scabug scabug closed this Jul 24, 2012
@scabug scabug added the critical label Apr 7, 2017
@scabug scabug added this to the 2.10.0-M5 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.