Skip to content

fix: point at the kotlin extension's first-run setup instead of a reload failure - #21

Merged
Sam Gammon (sgammon) merged 1 commit into
mainfrom
fix/kotlin-first-run-setup
Oct 13, 2026
Merged

Sam Gammon (sgammon) merged 1 commit into
mainfrom
fix/kotlin-first-run-setup

Conversation

@sgammon

@sgammon Sam Gammon (sgammon) commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

What

The extension now detects when JetBrains' Kotlin extension is waiting on its first-run setup and says so. Previously every sync reported "Kotlin LSP did not reload".

Why

JetBrains.kotlin-server (0.0.13) activates normally but holds its language server back until a region and a data-sharing choice are recorded and its terms are accepted. Until then it never calls activateExtension, so jetbrains.kotlin.reloadWorkspace and jetbrains.kotlin.restartLsp are never registered. reloadKotlinLsp treated the missing commands as a reload failure. The Kotlin extension's own gate (from its bundled sources, consent.ts and eula.ts) reads the user values of intellij.region and intellij.dataSharing, where not_set (the default) means unanswered.

How

  • @elide/ide-core: unansweredKotlinSetupSteps and kotlinSetupPendingMessage (kotlinSetup.ts), with unit tests.
  • jetbrains.ts: pendingKotlinSetup() reports the setup as pending when either:
    • intellij.region or intellij.dataSharing is unanswered, or
    • the extension is active, its setup command jetbrains.showLicenseSetup is registered, and none of its server commands are. This covers the terms, which live in its private state.
  • While setup is pending, reloadKotlinLsp throws KotlinSetupPendingError instead of the generic error.
  • Each sync logs the state. A warning with an "Open Kotlin Setup" button appears once per window; the button runs jetbrains.showLicenseSetup, or opens the two settings if that command is missing. The language server imports workspace.json itself when it starts after setup, so nothing else is needed.
  • "Debug with Elide" with the intellij adapter shows the same warning instead of starting an Elide process for a debugger that is not running.

Verified

  • bun run build, bun run --filter elide typecheck, bun run test (144 pass).
  • VS Code 1.141.0 under Xvfb with the real JetBrains.kotlin-server 0.0.13, Elide 1.6.0-rc.2 and a fresh profile without intellij.region / intellij.dataSharing:
    • After the startup sync, the output shows Kotlin LSP not started: the Kotlin extension is waiting for its first-run setup (region, data sharing); … and one warning with "Open Kotlin Setup" appears, next to the Kotlin extension's own "initial setup is incomplete" notice.
    • A second elide.sync logs the same line and shows no second warning.
    • Debug with Elide shows the warning and starts nothing.
  • With both settings answered, the existing path is unchanged: reload runs through jetbrains.kotlin.reloadWorkspace.

Closes #16

…oad failure

JetBrains.kotlin-server activates but registers none of its server
commands until its region, terms and data-sharing prompts are answered,
so every sync reported "Kotlin LSP did not reload". Detect that state
from its intellij.region and intellij.dataSharing settings and the
missing server commands, show one notice per window with a button to its
setup page, and say the same when Debug with Elide would attach to its
debugger.

Signed-off-by: Sam Gammon <sam@elide.dev>
@sgammon
Sam Gammon (sgammon) merged commit de66dbf into main Oct 13, 2026
4 checks passed
@sgammon
Sam Gammon (sgammon) deleted the fix/kotlin-first-run-setup branch October 13, 2026 02:16
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.

"Kotlin LSP did not reload" while the Kotlin extension's first-run prompts are pending

1 participant