Skip to content

Commit

Permalink
Merge pull request #36 from dprint/fix-shutdown-hangs
Browse files Browse the repository at this point in the history
Fix issue causing IntelliJ shutdown hang.
  • Loading branch information
ryan-rushton committed Jul 12, 2022
2 parents f6fcb41 + e154e47 commit dd93c10
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# dprint-intellij-plugin Changelog

## [Unreleased]
- Fix issue causing IntelliJ to hang on shutdown

## [0.3.7]
- Performance improvements
Expand Down Expand Up @@ -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.
- Release first public version of the plugin.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<EditorProcess>()

Expand Down Expand Up @@ -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
}
}
}
Expand Down

0 comments on commit dd93c10

Please sign in to comment.