Skip to content

Conversation

@JBou
Copy link
Contributor

@JBou JBou commented Jan 3, 2026

Ensure the Kotlin language server is started at the correct Gradle root for multi-project and composite builds.

The root resolution now prioritizes settings.gradle(.kts), followed by the Gradle wrapper, before falling back to module-level build files or Maven projects. This prevents submodules from being incorrectly detected as the workspace root.

Follow up for #6601

Ensure the Kotlin language server is started at the correct Gradle root for multi-project and composite builds.

The root resolution now prioritizes settings.gradle(.kts), followed by
the Gradle wrapper, before falling back to module-level build files or Maven projects. This prevents submodules from being incorrectly detected as the workspace root.
Root detection now correctly handles async NearestRoot resolution.

The previous implementation relied on nullish coalescing, which does not work
with async functions and could incorrectly detect a subproject as the root.
This change resolves roots sequentially using await and early returns.

Priority order:
1. settings.gradle(.kts) for multi-project and included builds
2. Gradle wrapper as a strong root signal
3. build.gradle(.kts) for single-project or module builds
4. pom.xml as a Maven fallback

Also renames `start` to `file` for consistency.
@rekram1-node rekram1-node merged commit da6df3d into anomalyco:dev Jan 3, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants