feat: add Kotlin/Scala glue file support and fix two bugs - #140
Conversation
- Add kotlin (.kt/.kts) and scala (.scala) to glueExtByLanguageName - Fix: reindex crash when DidChangeConfiguration sends null/malformed settings (params.settings was blindly cast to Settings, causing undefined.reduce() if features/glue were missing — seen with Zed) - Fix: wasmBasePath resolved incorrectly when npm hoists @cucumber/language-service; use require.resolve() instead of the hardcoded __dirname/../node_modules path - Point @cucumber/language-service at marton78/language-service fork Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
f8e69f8 to
ec6b4d4
Compare
|
Independent confirmation of both bug fixes in this PR, from a different client (Zed + Java glue). Environment
Symptom — every step reported as …repeated for every glue file. Root cause — confirms the const wasmBasePath = path.resolve(`${__dirname}/../node_modules/@cucumber/language-service/dist`)With a hoisted install this resolves to Proof that the path is the only problem. Driving the same installed library directly, with Same wasm grammars, same versions — the parser itself is fine. Workaround (verified). Symlinking the hoisted package into the location the hardcoded path expects makes the running server report The second fix reproduces too. Every reindex logs Suggestion: both fixes are independent of the Kotlin/Scala feature and are only a few lines each. Splitting them into their own PR would let them land without waiting on cucumber/language-service#304, which has also been open since June. As it stands, Java step-definition support is completely broken for any client with a hoisted install. 🤖 This comment was generated by Claude Code (AI) |
Summary
kotlin(.kt/.kts) andscala(.scala) toglueExtByLanguageNameso the server discovers step definitions in those filesDidChangeConfigurationsendsnull/malformed settings —params.settingswas blindly cast toSettings, causingundefined.reduce()iffeatures/gluewere missing (observed with Zed)wasmBasePathresolved incorrectly when npm hoists@cucumber/language-service; now usesrequire.resolve()instead of the hardcoded__dirname/../node_modulespathDependency chain
This PR is a part of two, adding Kotlin support:
cucumber/language-service#304 — Kotlin parsing (merge first)Test plan
.ktand.ktsfiles are indexed as glue files.scalafiles are indexed as glue filesDidChangeConfigurationwith null/missing settingswasmBasePathresolves correctly when@cucumber/language-serviceis hoisted by npm