Scala Programming Language
  1. Scala Programming Language
  2. SI-5385

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: Scala 2.9.2
    • Fix Version/s: Scala 2.10.0-M5
    • Component/s: Misc Compiler
    • Labels:
      None

      Description

      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

        Activity

        Hide
        Mirko Stocker added a comment -

        It looks like Paul has a fix for this:

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

        Any chance this could be merged into master?

        Show
        Mirko Stocker added a comment - It looks like Paul has a fix for this: https://github.com/paulp/scala/commit/4868d655ad8769f58f923154a1a31373ead71a45 Any chance this could be merged into master?
        Hide
        Hubert Plociniczak added a comment -

        Should go to 2.10. Paul's fix is probably the way to go.

        Show
        Hubert Plociniczak added a comment - Should go to 2.10. Paul's fix is probably the way to go.
        Hide
        Hubert Plociniczak added a comment -

        Fixed in #924.

        Show
        Hubert Plociniczak added a comment - Fixed in #924.

          People

          • Assignee:
            Hubert Plociniczak
            Reporter:
            Mirko Stocker
          • Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development