Skip to content

Commit

Permalink
CMP-6806 fix warnings and deprecations
Browse files Browse the repository at this point in the history
(cherry picked from commit e1caead)
  • Loading branch information
kropp committed Dec 12, 2024
1 parent 0d971b1 commit c36d9cb
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ class PreviewManagerImpl(
}
}
}.also {
it.uncaughtExceptionHandler = Thread.UncaughtExceptionHandler { thread, e ->
it.uncaughtExceptionHandler = Thread.UncaughtExceptionHandler { _, e ->
onError(e)
}
threads.add(it)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion idea-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build/
.gradle/
.idea
.idea
.intellijPlatform
7 changes: 6 additions & 1 deletion idea-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dependencies {
intellijPlatform {
intellijIdeaCommunity(libs.versions.idea)
instrumentationTools()
pluginVerifier()

bundledPlugins("com.intellij.java", "org.jetbrains.kotlin", "com.intellij.gradle")
}
Expand All @@ -41,7 +42,11 @@ intellijPlatform {
channels = projectProperties.pluginChannels
}

pluginVerification { ides { recommended() } }
pluginVerification {
ides {
recommended()
}
}
}

tasks {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c36d9cb

Please sign in to comment.