Skip to content

initialize never completes for multi-module Gradle projects with empty root module #189

@h-mergel

Description

@h-mergel

Description

When using the Kotlin LSP standalone (stdio) with a multi-module Gradle project where the root module is a pure aggregator (no source sets), the server never sends an initialize result. The LSP client hangs indefinitely waiting for the response.

Environment

  • Kotlin LSP: v262.4739.0 (standalone, Linux-x64)
  • OS: Linux (WSL2, kernel 6.6.x)
  • Java: bundled JBR 25.0.2+10-b432.38

Project setup

Multi-module Gradle project. The root module is a pure aggregator — no source sets, no source files. All Kotlin source code lives exclusively in submodules.

Observed behavior

Gradle import runs and resolves all dependencies successfully. The server then logs:

INFO - IdeaProjectMapper - <root-module> has an empty set of source sets
INFO - GlobalWorkspaceModel - Project analyzer project is added to the list of initializing and open projects
INFO - ProjectLibraryTableBridgeImpl - Initial load of project-level libraries. There are 405 libraries to load.
INFO - GlobalWorkspaceModel - Project analyzer project is removed from the list of initializing and open projects. Project was disposed.

After this, nothing more happens. The initialize result is never returned.

Expected behavior

The initialize result should be returned once Gradle import completes, even if the root module has no source sets. Language features should be available for source files in submodules.

Additional notes

Pointing rootUri at a submodule directory does not help — the Gradle importer always traverses up to the root settings.gradle.kts and the same sequence occurs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions