Browse Source

CMP-6806 fix warnings and deprecations

(cherry picked from commit e1caeade8a)
pull/5189/head
Victor Kropp 2 months ago
parent
commit
c36d9cbce6
  1. 2
      gradle-plugins/preview-rpc/src/main/kotlin/org/jetbrains/compose/desktop/ui/tooling/preview/rpc/PreviewManager.kt
  2. 4
      gradle-plugins/preview-rpc/src/main/kotlin/org/jetbrains/compose/desktop/ui/tooling/preview/rpc/RemotePreviewHost.kt
  3. 1
      idea-plugin/.gitignore
  4. 7
      idea-plugin/build.gradle.kts
  5. 3
      idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/ide/preview/PreviewToolWindow.kt

2
gradle-plugins/preview-rpc/src/main/kotlin/org/jetbrains/compose/desktop/ui/tooling/preview/rpc/PreviewManager.kt

@ -290,7 +290,7 @@ class PreviewManagerImpl(
}
}
}.also {
it.uncaughtExceptionHandler = Thread.UncaughtExceptionHandler { thread, e ->
it.uncaughtExceptionHandler = Thread.UncaughtExceptionHandler { _, e ->
onError(e)
}
threads.add(it)

4
gradle-plugins/preview-rpc/src/main/kotlin/org/jetbrains/compose/desktop/ui/tooling/preview/rpc/RemotePreviewHost.kt

@ -101,7 +101,7 @@ internal class PreviewHost(private val log: PreviewLogger, connection: RemoteCon
}.setUpUnhandledExceptionHandler(ExitCodes.RECEIVER_FATAL_ERROR)
private fun Thread.setUpUnhandledExceptionHandler(exitCode: Int): Thread = apply {
uncaughtExceptionHandler = Thread.UncaughtExceptionHandler { t, e ->
uncaughtExceptionHandler = Thread.UncaughtExceptionHandler { _, e ->
try {
System.err.println()
System.err.println(PREVIEW_START_OF_STACKTRACE_MARKER)
@ -151,7 +151,7 @@ internal class PreviewHost(private val log: PreviewLogger, connection: RemoteCon
val possibleCandidates = previewFacade.methods.filter { it.name == "render" }
throw RuntimeException("Could not find method '$signature'. Possible candidates: \n${possibleCandidates.joinToString("\n") { "* ${it}" }}", e)
}
val (id, fqName, frameConfig) = request
val (_, fqName, frameConfig) = request
val scaledWidth = frameConfig.scaledWidth
val scaledHeight = frameConfig.scaledHeight
val scale = frameConfig.scale

1
idea-plugin/.gitignore vendored

@ -1,3 +1,4 @@
build/
.gradle/
.idea
.intellijPlatform

7
idea-plugin/build.gradle.kts

@ -26,6 +26,7 @@ dependencies {
intellijPlatform {
intellijIdeaCommunity(libs.versions.idea)
instrumentationTools()
pluginVerifier()
bundledPlugins("com.intellij.java", "org.jetbrains.kotlin", "com.intellij.gradle")
}
@ -41,7 +42,11 @@ intellijPlatform {
channels = projectProperties.pluginChannels
}
pluginVerification { ides { recommended() } }
pluginVerification {
ides {
recommended()
}
}
}
tasks {

3
idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/ide/preview/PreviewToolWindow.kt

@ -15,9 +15,6 @@ import java.awt.BorderLayout
import org.jetbrains.compose.desktop.ide.preview.ui.PreviewPanel
class PreviewToolWindow : ToolWindowFactory, DumbAware {
@Deprecated("Use isApplicableAsync")
override fun isApplicable(project: Project): Boolean = isPreviewCompatible(project)
override suspend fun isApplicableAsync(project: Project): Boolean = isPreviewCompatible(project)
override fun init(toolWindow: ToolWindow) {

Loading…
Cancel
Save