-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Problem
When IntelliJ is indexing (after opening a project, switching branches, etc.), the REPL run configuration cannot be started. It just silently waits until indexing finishes. On large projects or setups with many git worktrees this means waiting several minutes before you can even begin working in the REPL.
Starting a REPL is just launching an external JVM process over nREPL. It does not need code indexes.
Based on a user report on X: https://x.com/PetrusTheron/status/2029596897435079133
Root cause
This is on the Cursive side, not IntelliJ. The platform's ExecutionManagerImpl checks whether the ConfigurationType is DumbAware before allowing a run configuration to start during indexing:
// ExecutionManagerImpl.kt:566
if (settings != null && !settings.type.isDumbAware && DumbService.isDumb(project)) {
DumbService.getInstance(project).runWhenSmart(startRunnable)
}ConfigurationType extends PossiblyDumbAware, which defaults to return this instanceof DumbAware. Cursive's ReplConfigurationType extends ConfigurationTypeBase, which does not implement DumbAware. So the platform defers the REPL launch until indexing is done.
The tool window factory (REPLToolWindowFactory) and actions (ClojureActionBase) already implement DumbAware, so only the configuration type is missing it.
Suggested fix
Add the DumbAware marker interface to ReplConfigurationType:
class ReplConfigurationType : ConfigurationTypeBase(...), DumbAwareRelated
#1311 is a different but related problem: REPL actions like "Load File in REPL" throwing IndexNotReadyException when the REPL is already running. That one is about index access in namespace_names at runtime. This issue is about the platform blocking the REPL from starting in the first place.