@@ -112,14 +112,14 @@ object DottyPlugin extends AutoPlugin {
112
112
* corresponding .tasty or .hasTasty file is also deleted.
113
113
*/
114
114
def dottyPatchIncOptions (incOptions : IncOptions ): IncOptions = {
115
- val inheritedNewClassFileManager = ClassFileManagerUtil .getDefaultClassFileManager(incOptions)
116
115
val tastyFileManager = new ClassFileManager {
117
- private [this ] val inherited = inheritedNewClassFileManager
116
+ private [this ] val inherited =
117
+ ClassFileManagerUtil .getDefaultClassFileManager(incOptions)
118
118
119
119
def delete (classes : Array [File ]): Unit = {
120
120
val tastySuffixes = List (" .tasty" , " .hasTasty" )
121
- inherited.delete(classes flatMap { classFile =>
122
- if (classFile.getPath endsWith " .class" ) {
121
+ inherited.delete(classes. flatMap { classFile =>
122
+ if (classFile.getPath. endsWith( " .class" ) ) {
123
123
val prefix = classFile.getAbsolutePath.stripSuffix(" .class" )
124
124
tastySuffixes.map(suffix => new File (prefix + suffix)).filter(_.exists)
125
125
} else Nil
@@ -129,16 +129,10 @@ object DottyPlugin extends AutoPlugin {
129
129
def generated (classes : Array [File ]): Unit = {}
130
130
def complete (success : Boolean ): Unit = {}
131
131
}
132
- val inheritedHooks = incOptions.externalHooks
133
- val externalClassFileManager : Optional [ClassFileManager ] = Option (inheritedHooks.getExternalClassFileManager.orElse(null )) match {
134
- case Some (prevManager) =>
135
- Optional .of(WrappedClassFileManager .of(prevManager, Optional .of(tastyFileManager)))
136
- case None =>
137
- Optional .of(tastyFileManager)
138
- }
139
132
140
- val hooks = new DefaultExternalHooks (inheritedHooks.getExternalLookup, externalClassFileManager)
141
- incOptions.withExternalHooks(hooks)
133
+ val newExternalHooks =
134
+ incOptions.externalHooks.withExternalClassFileManager(tastyFileManager)
135
+ incOptions.withExternalHooks(newExternalHooks)
142
136
}
143
137
144
138
override val globalSettings : Seq [Def .Setting [_]] = Seq (
0 commit comments