File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
compiler/src/dotty/tools/dotc/rewrites Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import Positions.Position
66import core .Contexts .Context
77import collection .mutable
88import scala .annotation .tailrec
9+ import dotty .tools .dotc .reporting .Reporter
910
1011/** Handles rewriting of Scala2 files to Dotty */
1112object Rewrites {
@@ -63,10 +64,11 @@ object Rewrites {
6364 * given by `pos` in `source` by `replacement`
6465 */
6566 def patch (source : SourceFile , pos : Position , replacement : String )(implicit ctx : Context ): Unit =
66- for (rewrites <- ctx.settings.rewrite.value)
67- rewrites.patched
68- .getOrElseUpdate(source, new Patches (source))
69- .addPatch(pos, replacement)
67+ if (ctx.reporter != Reporter .NoReporter ) // NoReporter is used for syntax highlighting
68+ for (rewrites <- ctx.settings.rewrite.value)
69+ rewrites.patched
70+ .getOrElseUpdate(source, new Patches (source))
71+ .addPatch(pos, replacement)
7072
7173 /** Patch position in `ctx.compilationUnit.source`. */
7274 def patch (pos : Position , replacement : String )(implicit ctx : Context ): Unit =
You can’t perform that action at this time.
0 commit comments