Skip to content

Commit 948aa20

Browse files
committed
Fixed processChunk in KotlinPluginsExceptionReporterImpl
TODO: - Unsafe fallback option - Better file watcher (watch the whole local repo) - Check how exceptions are handled while in checkers - Store matched stacktrace with the exception for highlighting
1 parent a196904 commit 948aa20

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/main/kotlin/com/github/mr3zee/kotlinPlugins/KotlinPluginsExceptionReporter.kt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ class KotlinPluginsExceptionReporterImpl(
8484

8585
private val statusPublisher by lazy { project.messageBus.syncPublisher(KotlinPluginStatusUpdater.TOPIC) }
8686

87+
private val discoveryHandler = DiscoveryHandler()
88+
8789
inner class State(
8890
private val job: Job,
8991
) {
@@ -95,7 +97,7 @@ class KotlinPluginsExceptionReporterImpl(
9597
}
9698

9799
val connection = project.messageBus.connect()
98-
connection.subscribe(KotlinPluginDiscoveryUpdater.TOPIC, DiscoveryHandler())
100+
connection.subscribe(KotlinPluginDiscoveryUpdater.TOPIC, discoveryHandler)
99101
connection
100102
}
101103

@@ -203,13 +205,7 @@ class KotlinPluginsExceptionReporterImpl(
203205

204206
private fun processChunk(chunk: List<KotlinPluginDiscoveryUpdater.Discovery>) {
205207
chunk.forEach { discovery ->
206-
val jarId = JarId(discovery.pluginName, discovery.mavenId, discovery.version)
207-
208-
metadata.compute(jarId) { _, old ->
209-
computeMetadata(old, discovery)
210-
}
211-
212-
processDiscovery(discovery)
208+
discoveryHandler.discoveredSync(discovery)
213209
}
214210

215211
logger.debug("Finished processing chunk of ${chunk.size} jars: ${chunk.map { "${it.pluginName} (${it.mavenId})" }}")

0 commit comments

Comments
 (0)