Skip to content

Conversation

@sgammon
Copy link
Member

@sgammon sgammon commented Jul 6, 2025

Ready for review Powered by Pull Request Badge

Summary

Adds simple entrypoints for elide lsp and elide mcp. LSP is pretty simple, and MCP only supports stdio for now (servers need Ktor). MCP is preloaded with access to the Elide project config, but not much else yet.

Changelog

feat(cli): implement `elide lsp` command
feat(cli): implement `elide mcp` command
feat(cli): add lsp-specific options to cli
feat(cli): add mcp-specific options to cli

@sgammon sgammon added this to the Release R18: Beta milestone Jul 6, 2025
@sgammon sgammon requested review from a team and Copilot July 6, 2025 19:10
@sgammon sgammon self-assigned this Jul 6, 2025
@sgammon sgammon added feature Large PRs or issues with full-blown features module:cli CLI module issues and features labels Jul 6, 2025
@sgammon sgammon added this to Elide Jul 6, 2025
@sgammon sgammon moved this to Done in Elide Jul 6, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces new CLI entrypoints for elide lsp and elide mcp, extends the project manifest with development and LSP settings, and refactors the engine/context API to support shared vs. isolated contexts.

  • Add dev section with LSP settings to project manifest
  • Refactor GraalVM engine API to accept a shared flag and expose initializeDefaultContext
  • Implement MCP and LSP subcommands, options, and update dependencies

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/tooling/.../ElidePackageManifest.kt Add DevSettings, LspSettings, and ProjectSourceSpec
packages/graalvm/.../GraalVMEngine.kt Refactor createContext to support shared flag
packages/engine/.../AbstractLanguagePlugin.kt Change initializeDefaultContext extension to public
packages/engine/.../PolyglotEngine.kt Add overloads for acquire(shared, ...)
packages/graalvm/api/graalvm.api Update acquire signature for shared parameter
packages/engine/api/engine.api Mirror overloads in the public API
packages/cli/src/main/pkl/Dev.pkl Document LSP settings in Pkl DSL
packages/cli/.../McpOptions.kt Introduce MCP CLI options
packages/cli/.../LspOptions.kt Add LSP CLI options
packages/cli/.../McpCommand.kt Implement mcp command
packages/cli/.../LspCommand.kt Implement lsp command
packages/cli/.../Elide.kt Register LspCommand and McpCommand
packages/cli/.../AbstractSubcommand.kt Extend context resolution with shared and cfg flags
packages/cli/build.gradle.kts Add mcp and GraalVM LSP dependencies
gradle/elide.versions.toml Pin mcp SDK and dependencies
Comments suppressed due to low confidence (2)

packages/cli/src/main/kotlin/elide/tool/cli/options/LspOptions.kt:61

  • [nitpick] The comment above lspDelegates is incorrect (it repeats the internals description). Update it to describe delegate servers (e.g., "Add delegate LSP servers").
  /** Enable internal sources via LSP. */

packages/graalvm/src/main/kotlin/elide/runtime/core/internals/graalvm/GraalVMEngine.kt:76

  • The finalizer parameter is declared but never used; consider invoking finalizer(builder) when constructing the context or removing the unused parameter to keep the API clean.
  private fun createContext(

@codecov
Copy link

codecov bot commented Jul 6, 2025

Codecov Report

Attention: Patch coverage is 16.02210% with 152 lines in your changes missing coverage. Please review.

Project coverage is 40.37%. Comparing base (11fa54b) to head (3a58da9).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...c/main/kotlin/elide/tool/cli/cmd/dev/McpCommand.kt 6.15% 61 Missing ⚠️
...c/main/kotlin/elide/tool/cli/options/LspOptions.kt 5.40% 35 Missing ⚠️
...c/main/kotlin/elide/tool/cli/cmd/dev/LspCommand.kt 10.52% 34 Missing ⚠️
...e/tooling/project/manifest/ElidePackageManifest.kt 7.69% 12 Missing ⚠️
...c/main/kotlin/elide/tool/cli/AbstractSubcommand.kt 55.55% 4 Missing ⚠️
...de/runtime/core/internals/graalvm/GraalVMEngine.kt 75.00% 1 Missing and 2 partials ⚠️
...c/main/kotlin/elide/tool/cli/options/McpOptions.kt 33.33% 2 Missing ⚠️
...c/main/kotlin/elide/runtime/core/PolyglotEngine.kt 66.66% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1523      +/-   ##
==========================================
- Coverage   40.52%   40.37%   -0.15%     
==========================================
  Files         713      717       +4     
  Lines       33291    33463     +172     
  Branches     4624     4646      +22     
==========================================
+ Hits        13491    13511      +20     
- Misses      18225    18375     +150     
- Partials     1575     1577       +2     
Flag Coverage Δ
jvm 40.37% <16.02%> (-0.15%) ⬇️
lib 40.37% <16.02%> (-0.15%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ckages/cli/src/main/kotlin/elide/tool/cli/Elide.kt 32.43% <ø> (ø)
...in/elide/runtime/plugins/AbstractLanguagePlugin.kt 36.59% <100.00%> (ø)
...c/main/kotlin/elide/runtime/core/PolyglotEngine.kt 66.66% <66.66%> (-33.34%) ⬇️
...c/main/kotlin/elide/tool/cli/options/McpOptions.kt 33.33% <33.33%> (ø)
...de/runtime/core/internals/graalvm/GraalVMEngine.kt 52.44% <75.00%> (+0.24%) ⬆️
...c/main/kotlin/elide/tool/cli/AbstractSubcommand.kt 57.29% <55.55%> (-0.37%) ⬇️
...e/tooling/project/manifest/ElidePackageManifest.kt 13.00% <7.69%> (-0.18%) ⬇️
...c/main/kotlin/elide/tool/cli/cmd/dev/LspCommand.kt 10.52% <10.52%> (ø)
...c/main/kotlin/elide/tool/cli/options/LspOptions.kt 5.40% <5.40%> (ø)
...c/main/kotlin/elide/tool/cli/cmd/dev/McpCommand.kt 6.15% <6.15%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 11fa54b...3a58da9. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sgammon sgammon force-pushed the feat/dev-context-servers branch from 886afd2 to f07ec3b Compare July 6, 2025 19:21
feat(cli): implement `elide lsp` command
feat(cli): implement `elide mcp` command
feat(cli): add lsp-specific options to cli
feat(cli): add mcp-specific options to cli

Signed-off-by: Sam Gammon <sam@elide.dev>
@sgammon sgammon force-pushed the feat/dev-context-servers branch from f07ec3b to 3a58da9 Compare July 6, 2025 20:03
@sgammon sgammon merged commit b5fe97d into main Jul 6, 2025
17 checks passed
@elidebot elidebot mentioned this pull request Jul 19, 2025
29 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Large PRs or issues with full-blown features module:cli CLI module issues and features

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants