Rename class breaks code in generic when comments/spaces are involved
Renaming
Note: As soon as #1001932 is fixed, the same example should be considered with
RenameMe
to Ups
intrait RenameMe {
def works1: Map[Int, RenameMe]
def works2: Map[Int, /**/RenameMe]
def works3: Map[/**/ Int/**/, /**/RenameMe /**/ ]
def breaksFormat1: Map[Int,RenameMe]
def breaksCompile1: Map[Int,/**/RenameMe]
def breaksCompile2: Map[Int,/**/ RenameMe]
def breaksCompile3: Map[Int,/**/
RenameMe]
}
yieldstrait Ups {
def works1: Map[Int, Ups]
def works2: Map[Int, /**/Ups]
def works3: Map[/**/ Int/**/, /**/Ups /**/ ]
def breaksFormat1: Map[Int, Ups]
def breaksCompile1: Map[Int, **/Ups]
def breaksCompile2: Map[Int, **/ Ups]
def breaksCompile3: Map[Int /*,
Ups]
}
Note: As soon as #1001932 is fixed, the same example should be considered with
(Int, RenameMe)
instead of Map[Int, RenameMe]
.
Leave a comment
Be more careful when printing type parameter lists
This commit fixes some problems in the code, related to printing type parameter
lists: It is no longer assumed, that the user prefers `A, B` over `A,B`, even
if the original source code uses `A,B`. Also, layout splitting used to mess
with the code, if newlines and comments where involved. This issue is addressed
by adapting a few regular expressions in `LayoutHelper`, as well as by changing
the order in which they are matched.
Note that this commit replaces ", " with "," in quite a few places, since " "
should now be part of the arguments themselves if it is needed. Each of these
changes was motivated by failing unit tests. Since there are still lots of
hard coded ", " in the library, we might see additional replacements of this
type in the future.
Fixes #1002618
Branch: master
Commit: scala-ide:262f85cdeb
This commit fixes some problems in the code, related to printing type parameter
lists: It is no longer assumed, that the user prefers `A, B` over `A,B`, even
if the original source code uses `A,B`. Also, layout splitting used to mess
with the code, if newlines and comments where involved. This issue is addressed
by adapting a few regular expressions in `LayoutHelper`, as well as by changing
the order in which they are matched.
Note that this commit replaces ", " with "," in quite a few places, since " "
should now be part of the arguments themselves if it is needed. Each of these
changes was motivated by failing unit tests. Since there are still lots of
hard coded ", " in the library, we might see additional replacements of this
type in the future.
Fixes #1002618
Branch: master
Commit: scala-ide:262f85cdeb