Skip to content

REPL cannot be started while IDE is indexing #3082

@CrazyCoder

Description

@CrazyCoder

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(...), DumbAware

Related

#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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions