Big refactor to use coroutines across the codebase#106
Merged
ryan-rushton merged 3 commits intomainfrom Jun 28, 2025
Merged
Conversation
fd6013e to
b6bb5c5
Compare
ryan-rushton
commented
Jun 21, 2025
ryan-rushton
commented
Jun 21, 2025
ryan-rushton
commented
Jun 21, 2025
ryan-rushton
commented
Jun 21, 2025
src/main/kotlin/com/dprint/services/editorservice/EditorServiceCache.kt
Outdated
Show resolved
Hide resolved
ryan-rushton
commented
Jun 21, 2025
src/main/kotlin/com/dprint/services/editorservice/EditorServiceCache.kt
Outdated
Show resolved
Hide resolved
ryan-rushton
commented
Jun 21, 2025
src/main/kotlin/com/dprint/services/editorservice/EditorServiceTaskQueue.kt
Outdated
Show resolved
Hide resolved
ryan-rushton
commented
Jun 21, 2025
src/main/kotlin/com/dprint/services/editorservice/EditorServiceTaskQueue.kt
Outdated
Show resolved
Hide resolved
ryan-rushton
commented
Jun 21, 2025
src/main/kotlin/com/dprint/services/editorservice/EditorServiceTaskQueue.kt
Outdated
Show resolved
Hide resolved
ryan-rushton
commented
Jun 21, 2025
src/main/kotlin/com/dprint/services/editorservice/EditorServiceTaskQueue.kt
Outdated
Show resolved
Hide resolved
ryan-rushton
commented
Jun 21, 2025
src/main/kotlin/com/dprint/services/editorservice/EditorServiceTaskQueue.kt
Outdated
Show resolved
Hide resolved
ryan-rushton
commented
Jun 21, 2025
ryan-rushton
commented
Jun 21, 2025
src/test/kotlin/com/dprint/services/editorservice/EditorServiceCacheTest.kt
Outdated
Show resolved
Hide resolved
ryan-rushton
commented
Jun 21, 2025
src/test/kotlin/com/dprint/services/editorservice/EditorServiceCacheTest.kt
Outdated
Show resolved
Hide resolved
ryan-rushton
commented
Jun 21, 2025
src/test/kotlin/com/dprint/services/editorservice/EditorServiceCacheTest.kt
Outdated
Show resolved
Hide resolved
ryan-rushton
commented
Jun 21, 2025
src/test/kotlin/com/dprint/services/editorservice/EditorServiceFormatterTest.kt
Outdated
Show resolved
Hide resolved
ryan-rushton
commented
Jun 21, 2025
src/test/kotlin/com/dprint/services/editorservice/EditorServiceFormatterTest.kt
Outdated
Show resolved
Hide resolved
ryan-rushton
commented
Jun 21, 2025
ryan-rushton
commented
Jun 21, 2025
src/test/kotlin/com/dprint/services/editorservice/EditorServiceCacheTest.kt
Outdated
Show resolved
Hide resolved
ryan-rushton
commented
Jun 21, 2025
src/test/kotlin/com/dprint/services/editorservice/EditorServiceCacheTest.kt
Outdated
Show resolved
Hide resolved
ryan-rushton
commented
Jun 21, 2025
src/test/kotlin/com/dprint/services/editorservice/EditorServiceCacheTest.kt
Outdated
Show resolved
Hide resolved
ryan-rushton
commented
Jun 21, 2025
src/test/kotlin/com/dprint/services/editorservice/EditorServiceFormatterTest.kt
Outdated
Show resolved
Hide resolved
ryan-rushton
commented
Jun 21, 2025
src/test/kotlin/com/dprint/services/editorservice/EditorServiceFormatterTest.kt
Outdated
Show resolved
Hide resolved
ryan-rushton
commented
Jun 21, 2025
src/test/kotlin/com/dprint/services/editorservice/EditorServiceFormatterTest.kt
Outdated
Show resolved
Hide resolved
ryan-rushton
commented
Jun 21, 2025
src/test/kotlin/com/dprint/services/editorservice/EditorServiceFormatterTest.kt
Outdated
Show resolved
Hide resolved
ryan-rushton
commented
Jun 21, 2025
src/test/kotlin/com/dprint/services/editorservice/EditorServiceFormatterTest.kt
Outdated
Show resolved
Hide resolved
ryan-rushton
commented
Jun 21, 2025
src/test/kotlin/com/dprint/services/editorservice/EditorServiceFormatterTest.kt
Outdated
Show resolved
Hide resolved
ryan-rushton
commented
Jun 23, 2025
ryan-rushton
commented
Jun 23, 2025
ryan-rushton
commented
Jun 23, 2025
Comment on lines
+252
to
+300
| if (isInitialized.get() || isRestarting.get()) { | ||
| return // Already initialized or in progress | ||
| } |
Collaborator
Author
There was a problem hiding this comment.
Probably don't want this. The queue should ensure that duplicated tasks are not queued. I need to review this manually.
ryan-rushton
commented
Jun 24, 2025
ryan-rushton
commented
Jun 24, 2025
5ff5300 to
6b50c93
Compare
ryan-rushton
commented
Jun 26, 2025
Comment on lines
+153
to
+155
| // In most cases for typical code files, byte offset == character index | ||
| // But for files with multi-byte characters, we need proper conversion | ||
| return minOf(byteOffset, text.length) |
Collaborator
Author
There was a problem hiding this comment.
This isn't correct
fa2ebe5 to
d5033e8
Compare
Add progress Actually make it work with claude fmt Update docs and clenaup unused methods Add tests and some other updates More updates fmt Update lowst IJ version Update listeners to coroutines More cleanup and fix issue with tasks not being removed from the queue Add tests for success cleanup Move to coroutines for the process Method rename Logging Set beta version Cleanup formatter service. Replace pending messages with message channel Cleanup Remove formatter service callbacks Clean up future usage in formatting task Cleanup error name fmt Set up persisted state abstraction Split up editor service Apply suggestions from code review fix Move null service handling to manager Some cleanup Formatting Fix issue with cache prime failing due to inistialisation not being finished yet. Fix buffer issue version bump Fix some cache timing issues Simplify Apply suggestions from code review Cleanup dprint service a bit doc changes Update CHANGELOG.md Update CHANGELOG.md Bump beta version Remove range formatting More range cleanup Add back range stuff More reimplmenting the range buisness Some error handling Fix up git ignore Cleanup verbose errors Cleanup incorrect conversion Improve config file discovery Add reset settings button Update i18n Add lifecycle manager Add tool window icons
507dca8 to
0e9bdc5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This is a big refactor to simplify the codebase and utilise coroutines opposed to threads, processes, futures and callbacks.
It also adds a lot of tests that were previously missing.