Move manual dictionary loading off the EDT - #67
Merged
Merged
Conversation
- Prevent manual SDEF generation and parsing from blocking the UI while preserving file selection and application-name prompts - Serialize cancellable project tasks, publish successful PSI on the EDT under service synchronization, and discard pending work after project disposal - Cover background execution, cache publication, cancellation, FIFO ordering, and disposal Impact: Manual dictionary loading stays responsive without changing cache precedence or partial-success behavior
There was a problem hiding this comment.
Sorry @barad1tos, you have reached your weekly rate limit of 1500000 diff characters.
Please try again later or upgrade to continue using Sourcery
Reviewer's GuideMoves manual AppleScript dictionary loading off the EDT by introducing a per-project background load queue, separating background dictionary initialization from EDT-bound PSI publication, and adding concurrency tests for threading, cancellation, FIFO ordering, and project disposal behavior. Sequence diagram for background dictionary loading off the EDTsequenceDiagram
actor User
participant LoadDictionaryAction
participant DictionaryLoadQueue
participant TaskBackgroundable
participant AppleScriptProjectDictionaryService
participant DaemonCodeAnalyzer
User->>LoadDictionaryAction: actionPerformed
LoadDictionaryAction->>LoadDictionaryAction: loadSelectedDictionaries
LoadDictionaryAction->>AppleScriptProjectDictionaryService: getService
LoadDictionaryAction->>DictionaryLoadQueue: submit(createTask)
DictionaryLoadQueue->>TaskBackgroundable: startTask(queue)
TaskBackgroundable->>TaskBackgroundable: run(indicator)
loop for each DictionaryLoadRequest
TaskBackgroundable->>TaskBackgroundable: indicator.checkCanceled
TaskBackgroundable->>AppleScriptProjectDictionaryService: loadDictionaryInfo
AppleScriptProjectDictionaryService-->>TaskBackgroundable: DictionaryInfo?
end
TaskBackgroundable->>DictionaryLoadQueue: onFinished -> taskFinished
TaskBackgroundable->>AppleScriptProjectDictionaryService: publishDictionaries
AppleScriptProjectDictionaryService->>AppleScriptProjectDictionaryService: createFromLoadedInfo
AppleScriptProjectDictionaryService-->>DaemonCodeAnalyzer: settingsChanged
DictionaryLoadQueue->>DictionaryLoadQueue: startNext
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
- Prove every selected file runs while successful dictionaries still publish - Verify project disposal skips cache publication and daemon restart - Group injectable load effects behind one narrow internal seam Impact: manual loads keep partial successes without leaking post-disposal updates
- Preserve the application name, file path, and original cause when a background manual load fails - Lock the failing request with a two-file mutation-sensitive regression test Impact: Manual dictionary load failures now identify the exact file that interrupted the batch
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.
── Summary ─────────────────────────────────
Manual dictionary loading currently performs SDEF generation, parser initialization, and PSI creation on the event dispatch thread, so a slow application dictionary can freeze the IDE. Move the expensive loading phase into cancellable project background tasks while preserving file selection, application naming, cache precedence, partial-success publication, and request order.
── Changes ─────────────────────────────────
── Validation ──────────────────────────────
./gradlew test koverXmlReport koverVerify verifyPlugin verifyPluginStructure detekt ktlintCheck --rerun-tasks --stacktrace— 529 tests passed; coverage gates passed; plugin compatible with IC 251, IC 252, and IU 261.javap -classpath build/classes/kotlin/main -p com.intellij.plugin.applescript.lang.ide.actions.DictionaryLoadQueue— Platform-instantiable public no-arg JVM constructor present.git diff --check— Passed.── Notes ───────────────────────────────────
Review focus:
DictionaryLoadQueuelifecycle transitions and the split between background dictionary initialization and synchronized EDT PSI publication. Child-process tree termination is intentionally unchanged and remains a separate follow-up.