|
61 | 61 | import org.openrewrite.InMemoryExecutionContext;
|
62 | 62 | import org.openrewrite.Parser;
|
63 | 63 | import org.openrewrite.Tree;
|
64 |
| -import org.openrewrite.internal.ListUtils; |
65 | 64 | import org.openrewrite.internal.lang.Nullable;
|
66 | 65 | import org.openrewrite.java.JavaParser;
|
67 | 66 | import org.openrewrite.java.internal.JavaTypeCache;
|
68 | 67 | import org.openrewrite.java.marker.JavaSourceSet;
|
69 |
| -import org.openrewrite.java.tree.JavaType; |
70 | 68 | import org.openrewrite.kotlin.internal.KotlinParserVisitor;
|
71 | 69 | import org.openrewrite.kotlin.tree.K;
|
72 | 70 | import org.openrewrite.style.NamedStyles;
|
@@ -187,27 +185,14 @@ public List<K.CompilationUnit> parseInputs(Iterable<Input> sources, @Nullable Pa
|
187 | 185 | }
|
188 | 186 |
|
189 | 187 | Disposer.dispose(disposable);
|
190 |
| - JavaSourceSet sourceSet = getSourceSet(ctx); |
191 |
| - if (!ctx.getMessage(SKIP_SOURCE_SET_TYPE_GENERATION, false)) { |
192 |
| - List<JavaType.FullyQualified> classpath = sourceSet.getClasspath(); |
193 |
| - for (K.CompilationUnit cu : mappedCus) { |
194 |
| - for (JavaType type : cu.getTypesInUse().getTypesInUse()) { |
195 |
| - if (type instanceof JavaType.FullyQualified) { |
196 |
| - classpath.add((JavaType.FullyQualified) type); |
197 |
| - } |
198 |
| - } |
199 |
| - } |
200 |
| - sourceSetProvenance = sourceSet.withClasspath(classpath); |
201 |
| - } |
202 |
| - assert sourceSetProvenance != null; |
203 |
| - return ListUtils.map(mappedCus, cu -> cu.withMarkers(cu.getMarkers().add(sourceSetProvenance))); |
| 188 | + return mappedCus; |
204 | 189 | }
|
205 | 190 |
|
206 | 191 | /**
|
207 | 192 | * @param disposable disposable to use for the compiler environment. THIS MUST BE DISPOSED BY THE CALLER.
|
208 |
| - * @param sources input sources to parse. |
| 193 | + * @param sources input sources to parse. |
209 | 194 | * @param relativeTo path to relativize input paths against.
|
210 |
| - * @param ctx Execution context to use for collecting parsing failures. |
| 195 | + * @param ctx Execution context to use for collecting parsing failures. |
211 | 196 | * @return FirSession associated to type attributing the CompiledKotlinSources.
|
212 | 197 | */
|
213 | 198 | Map<FirSession, List<CompiledKotlinSource>> parseInputsToCompilerAst(Disposable disposable, Iterable<Input> sources, @Nullable Path relativeTo, ExecutionContext ctx) {
|
@@ -372,11 +357,13 @@ public KotlinParser reset() {
|
372 | 357 | return this;
|
373 | 358 | }
|
374 | 359 |
|
| 360 | + @Deprecated//(since = "0.4.0", forRemoval = true) |
375 | 361 | public void setSourceSet(String sourceSet) {
|
376 | 362 | this.sourceSetProvenance = null;
|
377 | 363 | this.sourceSet = sourceSet;
|
378 | 364 | }
|
379 | 365 |
|
| 366 | + @Deprecated//(since = "0.4.0", forRemoval = true) |
380 | 367 | public JavaSourceSet getSourceSet(ExecutionContext ctx) {
|
381 | 368 | if (sourceSetProvenance == null) {
|
382 | 369 | if (ctx.getMessage(SKIP_SOURCE_SET_TYPE_GENERATION, false)) {
|
|
0 commit comments