diff --git a/CHANGELOG.md b/CHANGELOG.md index dcb2710..d8551cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ # dprint-intellij-plugin Changelog ## [Unreleased] +- Fix issue causing IntelliJ to hang on shutdown ## [0.3.7] - Performance improvements @@ -58,4 +59,4 @@ - Fix issue where the inability to parse the schema would stop a project form opening. ## [0.1.2] -- Release first public version of the plugin. \ No newline at end of file +- Release first public version of the plugin. diff --git a/gradle.properties b/gradle.properties index d066ee7..87506de 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ # -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html pluginGroup=com.dprint.intellij.plugin pluginName=dprint-intellij-plugin -pluginVersion=0.3.7 +pluginVersion=0.3.8 # See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html # for insight into build numbers and IntelliJ Platform versions. pluginSinceBuild=213 diff --git a/src/main/kotlin/com/dprint/services/editorservice/EditorProcess.kt b/src/main/kotlin/com/dprint/services/editorservice/EditorProcess.kt index 7f779b4..1b23d4f 100644 --- a/src/main/kotlin/com/dprint/services/editorservice/EditorProcess.kt +++ b/src/main/kotlin/com/dprint/services/editorservice/EditorProcess.kt @@ -16,7 +16,6 @@ import kotlin.concurrent.thread private const val BUFFER_SIZE = 1024 private const val ZERO = 0 private const val U32_BYTE_SIZE = 4 -private const val SLEEP_TIME = 500L private val LOGGER = logger() @@ -79,9 +78,10 @@ class EditorProcess(private val project: Project) { } catch (e: BufferUnderflowException) { // Happens when the editor service is shut down while this thread is waiting to read output LOGGER.info(e) + return@Runnable } catch (e: Exception) { LogUtils.error("Dprint: stderr reader failed", e, project, LOGGER) - Thread.sleep(SLEEP_TIME) + return@Runnable } } }