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
6
6
import core .Contexts .Context
7
7
import collection .mutable
8
8
import scala .annotation .tailrec
9
+ import dotty .tools .dotc .reporting .Reporter
9
10
10
11
/** Handles rewriting of Scala2 files to Dotty */
11
12
object Rewrites {
@@ -63,10 +64,11 @@ object Rewrites {
63
64
* given by `pos` in `source` by `replacement`
64
65
*/
65
66
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)
70
72
71
73
/** Patch position in `ctx.compilationUnit.source`. */
72
74
def patch (pos : Position , replacement : String )(implicit ctx : Context ): Unit =
You can’t perform that action at this time.
0 commit comments