Browse Source

CMP-6806 fix warnings and deprecations

pull/1738/merge
Victor Kropp 2 weeks ago
parent
commit
e1caeade8a
  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. 3
      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 { }.also {
it.uncaughtExceptionHandler = Thread.UncaughtExceptionHandler { thread, e -> it.uncaughtExceptionHandler = Thread.UncaughtExceptionHandler { _, e ->
onError(e) onError(e)
} }
threads.add(it) 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) }.setUpUnhandledExceptionHandler(ExitCodes.RECEIVER_FATAL_ERROR)
private fun Thread.setUpUnhandledExceptionHandler(exitCode: Int): Thread = apply { private fun Thread.setUpUnhandledExceptionHandler(exitCode: Int): Thread = apply {
uncaughtExceptionHandler = Thread.UncaughtExceptionHandler { t, e -> uncaughtExceptionHandler = Thread.UncaughtExceptionHandler { _, e ->
try { try {
System.err.println() System.err.println()
System.err.println(PREVIEW_START_OF_STACKTRACE_MARKER) 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" } val possibleCandidates = previewFacade.methods.filter { it.name == "render" }
throw RuntimeException("Could not find method '$signature'. Possible candidates: \n${possibleCandidates.joinToString("\n") { "* ${it}" }}", e) 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 scaledWidth = frameConfig.scaledWidth
val scaledHeight = frameConfig.scaledHeight val scaledHeight = frameConfig.scaledHeight
val scale = frameConfig.scale val scale = frameConfig.scale

3
idea-plugin/.gitignore vendored

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

7
idea-plugin/build.gradle.kts

@ -26,6 +26,7 @@ dependencies {
intellijPlatform { intellijPlatform {
intellijIdeaCommunity(libs.versions.idea) intellijIdeaCommunity(libs.versions.idea)
instrumentationTools() instrumentationTools()
pluginVerifier()
bundledPlugins("com.intellij.java", "org.jetbrains.kotlin", "com.intellij.gradle") bundledPlugins("com.intellij.java", "org.jetbrains.kotlin", "com.intellij.gradle")
} }
@ -41,7 +42,11 @@ intellijPlatform {
channels = projectProperties.pluginChannels channels = projectProperties.pluginChannels
} }
pluginVerification { ides { recommended() } } pluginVerification {
ides {
recommended()
}
}
} }
tasks { 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 import org.jetbrains.compose.desktop.ide.preview.ui.PreviewPanel
class PreviewToolWindow : ToolWindowFactory, DumbAware { 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 suspend fun isApplicableAsync(project: Project): Boolean = isPreviewCompatible(project)
override fun init(toolWindow: ToolWindow) { override fun init(toolWindow: ToolWindow) {

Loading…
Cancel
Save