Grammar fixes: "the EDT" -> "EDT"

This commit is contained in:
Karol Lewandowski 2024-04-10 10:01:37 +02:00
parent 0ff33149f0
commit 7462c85c9b
2 changed files with 4 additions and 4 deletions

View File

@ -57,7 +57,7 @@ suspend fun readDataFromFile(): Data {
## EDT Dispatcher ## EDT Dispatcher
The [`Dispatchers.EDT`](%gh-ic%/platform/core-api/src/com/intellij/openapi/application/coroutines.kt) dispatcher is used for executing UI actions on the Swing Event Dispatch Thread. The [`Dispatchers.EDT`](%gh-ic%/platform/core-api/src/com/intellij/openapi/application/coroutines.kt) dispatcher is used for executing UI actions on the Swing Event Dispatch Thread.
`Dispatchers.EDT` dispatches onto the EDT within the context [modality state](general_threading_rules.md#modality-and-invokelater). `Dispatchers.EDT` dispatches onto EDT within the context [modality state](general_threading_rules.md#modality-and-invokelater).
### `Dispatchers.Main` vs. `Dispatchers.EDT` ### `Dispatchers.Main` vs. `Dispatchers.EDT`
@ -107,7 +107,7 @@ The code is executed as follows:
1. `suspendingTask` is started and partially executed on **Thread 2**. 1. `suspendingTask` is started and partially executed on **Thread 2**.
2. `suspendingTask` is suspended when it waits for data fetched from the internet. 2. `suspendingTask` is suspended when it waits for data fetched from the internet.
3. After receiving data, `suspendingTask` is resumed, but now it is executed on **Thread 1**. 3. After receiving data, `suspendingTask` is resumed, but now it is executed on **Thread 1**.
4. Execution explicitly switches to the EDT Dispatcher and `updateUI` is executed on the UI thread. 4. Execution explicitly switches to the EDT dispatcher and `updateUI` is executed on the UI thread.
> This behavior can result in unexpected consequences for code that relies on thread-specific data and assumes it will execute consistently on the same thread. > This behavior can result in unexpected consequences for code that relies on thread-specific data and assumes it will execute consistently on the same thread.

View File

@ -51,11 +51,11 @@ Every IntelliJ Platform action should override `AnAction.update()` and must over
The preferred method is to run the update on the BGT, which has the advantage of guaranteeing application-wide read access to The preferred method is to run the update on the BGT, which has the advantage of guaranteeing application-wide read access to
[PSI](psi.md), [the virtual file system](virtual_file_system.md) (VFS), or [project models](project_structure.md). [PSI](psi.md), [the virtual file system](virtual_file_system.md) (VFS), or [project models](project_structure.md).
Actions that run the update session on the BGT should not access the Swing component hierarchy directly. Actions that run the update session on the BGT should not access the Swing component hierarchy directly.
Conversely, actions that specify to run their update on the EDT must not access PSI, VFS, or project data but have access to Swing components and other UI models. Conversely, actions that specify to run their update on EDT must not access PSI, VFS, or project data but have access to Swing components and other UI models.
All accessible data is provided by the `DataContext` as explained in [](#determining-the-action-context). All accessible data is provided by the `DataContext` as explained in [](#determining-the-action-context).
When switching from BGT to EDT is absolutely necessary, actions can use `AnActionEvent.getUpdateSession()` to When switching from BGT to EDT is absolutely necessary, actions can use `AnActionEvent.getUpdateSession()` to
access the [`UpdateSession`](%gh-ic%/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/UpdateSession.java) and access the [`UpdateSession`](%gh-ic%/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/UpdateSession.java) and
then call `UpdateSession.compute()` to run a function on the EDT. then call `UpdateSession.compute()` to run a function on EDT.
Inspection <ui-path>Plugin DevKit | Code | ActionUpdateThread is missing</ui-path> highlights missing implementation of Inspection <ui-path>Plugin DevKit | Code | ActionUpdateThread is missing</ui-path> highlights missing implementation of
`AnAction.getActionUpdateThread()` (2022.3+). `AnAction.getActionUpdateThread()` (2022.3+).
* An action's method `AnAction.actionPerformed()` is called by the IntelliJ Platform if available and selected by the user. * An action's method `AnAction.actionPerformed()` is called by the IntelliJ Platform if available and selected by the user.