diff --git a/build.gradle.kts b/build.gradle.kts index 82e8dc4..8a2ddfd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -13,7 +13,7 @@ version = providers.gradleProperty("pluginVersion").get() // Set the JVM language level used to build the project. kotlin { - jvmToolchain(17) + jvmToolchain(21) } // Configure project's dependencies diff --git a/gradle.properties b/gradle.properties index 60369ed..6ca9206 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,7 +11,7 @@ pluginUntilBuild = 243.* # IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension platformType = WS -platformVersion = 2024.1.1 +platformVersion = 2024.3 # Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html # Example: platformPlugins = com.jetbrains.php:203.4449.22, org.intellij.scala:2023.3.27@EAP diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5672187..a236dfe 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,7 +3,7 @@ junit = "4.13.2" # plugins -intelliJPlatform = "2.0.1" +intelliJPlatform = "2.1.0" kotlin = "1.9.25" [libraries] diff --git a/src/main/kotlin/com/github/biomejs/intellijbiome/lsp/BiomeLspServerSupportProvider.kt b/src/main/kotlin/com/github/biomejs/intellijbiome/lsp/BiomeLspServerSupportProvider.kt index e716e40..59f866f 100644 --- a/src/main/kotlin/com/github/biomejs/intellijbiome/lsp/BiomeLspServerSupportProvider.kt +++ b/src/main/kotlin/com/github/biomejs/intellijbiome/lsp/BiomeLspServerSupportProvider.kt @@ -44,19 +44,6 @@ class BiomeLspServerSupportProvider : LspServerSupportProvider { ) } -@Suppress("UnstableApiUsage") -class BiomeLspServerManagerListener(val project: Project) : LspServerManagerListener { - override fun serverStateChanged(lspServer: LspServer) { - if (lspServer.descriptor is BiomeLspServerDescriptor && lspServer.state == LspServerState.ShutdownUnexpectedly) { - // restart again if the server was shutdown unexpectedly. - // This can be caused by race condition, when we restart LSP server because of config change, - // but Intellij also tried to send a request to it at the same time. - // Unfortunate There is no way prevent IDEA send requests after LSP started. - project.service().restartBiomeServer() - } - } -} - @Suppress("UnstableApiUsage") private class BiomeLspServerDescriptor(project: Project, val executable: String, val configPath: String?) : ProjectWideLspServerDescriptor(project, "Biome") { diff --git a/src/main/kotlin/com/github/biomejs/intellijbiome/services/BiomeServerService.kt b/src/main/kotlin/com/github/biomejs/intellijbiome/services/BiomeServerService.kt index 659e1f0..65dabac 100644 --- a/src/main/kotlin/com/github/biomejs/intellijbiome/services/BiomeServerService.kt +++ b/src/main/kotlin/com/github/biomejs/intellijbiome/services/BiomeServerService.kt @@ -2,14 +2,12 @@ package com.github.biomejs.intellijbiome.services import com.github.biomejs.intellijbiome.BiomeBundle import com.github.biomejs.intellijbiome.listeners.BiomeEditorPanelListener -import com.github.biomejs.intellijbiome.lsp.BiomeLspServerManagerListener import com.github.biomejs.intellijbiome.lsp.BiomeLspServerSupportProvider import com.intellij.notification.NotificationGroupManager import com.intellij.notification.NotificationType import com.intellij.openapi.components.Service import com.intellij.openapi.fileEditor.FileEditorManagerListener import com.intellij.openapi.project.Project -import com.intellij.openapi.util.Disposer import com.intellij.platform.lsp.api.LspServerManager @Service(Service.Level.PROJECT) @@ -17,7 +15,6 @@ class BiomeServerService(private val project: Project) { private val editorPanelListener: BiomeEditorPanelListener init { - addBiomeLspListener() editorPanelListener = BiomeEditorPanelListener(project) project.messageBus.connect().subscribe(FileEditorManagerListener.FILE_EDITOR_MANAGER, editorPanelListener) } @@ -30,11 +27,6 @@ class BiomeServerService(private val project: Project) { LspServerManager.getInstance(project).stopAndRestartIfNeeded(BiomeLspServerSupportProvider::class.java) } - fun addBiomeLspListener() { - LspServerManager.getInstance(project) - .addLspServerManagerListener(BiomeLspServerManagerListener(project), Disposer.newDisposable(), true) - } - fun stopBiomeServer() { LspServerManager.getInstance(project).stopServers(BiomeLspServerSupportProvider::class.java) } diff --git a/src/main/kotlin/com/github/biomejs/intellijbiome/settings/BiomeConfigurable.kt b/src/main/kotlin/com/github/biomejs/intellijbiome/settings/BiomeConfigurable.kt index bc55d15..0556e13 100644 --- a/src/main/kotlin/com/github/biomejs/intellijbiome/settings/BiomeConfigurable.kt +++ b/src/main/kotlin/com/github/biomejs/intellijbiome/settings/BiomeConfigurable.kt @@ -117,9 +117,9 @@ class BiomeConfigurable(internal val project: Project) : row(BiomeBundle.message("biome.config.path.label")) { textFieldWithBrowseButton( - BiomeBundle.message("biome.config.path.label"), - project, FileChooserDescriptorFactory.createSingleFileOrFolderDescriptor() + .withTitle(BiomeBundle.message("biome.config.path.label")), + project, ) { fileChosen(it) } .bindText(settings::configPath) .validationOnInput(validateConfigDir())