Closed OlliKiljunen closed 4 years ago
More information from a comment in the source code of IDEA's API (DumbService.java
):
* A service managing the IDE's 'dumb' mode: when indexes are updated in the background, and the functionality is very much limited.
* Only the explicitly allowed functionality is available. Usually, it's allowed by implementing {@link DumbAware} interface.<p></p>
* <p>
* "Dumb" mode starts and ends in a {@link com.intellij.openapi.application.WriteAction}, so if you're inside a {@link ReadAction}
* on a background thread, it won't suddenly begin in the middle of your operation. But note that whenever you start
* a top-level read action on a background thread, you should be prepared to anything being changed, including "dumb"
* mode being suddenly on and off. To avoid executing a read action in "dumb" mode, please use {@link #runReadActionInSmartMode} or
* {@link com.intellij.openapi.application.NonBlockingReadAction#inSmartMode}.
* <p>
...and from IndexNotReadyException.java
:
* Thrown on accessing indices in dumb mode. Possible fixes:
* <li> if {@link com.intellij.openapi.actionSystem.AnAction#actionPerformed(com.intellij.openapi.actionSystem.AnActionEvent)} is in stack trace,
* consider making the action not implement {@link com.intellij.openapi.project.DumbAware}.
* <li> if this access is performed from some invokeLater activity, consider replacing it with
* {@link com.intellij.openapi.project.DumbService#smartInvokeLater(Runnable)}
* <li> otherwise, add {@link DumbService#isDumb()} checks where necessary
I suspect ImportProjectSettingsAction
could be dumb aware since it only copies files in to the .idea
directory and reloads the project
check "Import A+ Module" especially, as this would increase the installation speed of multi-module projects
well, why not... ReplAction.scala ?
and Activity
's too :stuck_out_tongue_winking_eye:
Originally posted by @nikke234 in https://github.com/Aalto-LeTech/intellij-plugin/pull/126
One should go through our action classes (some others too?), study which of them could/should be "DumbAware" and change the code accordingly.