Skip to content

feat(lsp): add 20 additional LSP servers from OpenCode reference#51

Merged
amondnet merged 4 commits into
mainfrom
50-add-20-additional-lsp-servers-from-opencode-reference
Dec 21, 2025
Merged

feat(lsp): add 20 additional LSP servers from OpenCode reference#51
amondnet merged 4 commits into
mainfrom
50-add-20-additional-lsp-servers-from-opencode-reference

Conversation

@amondnet

Copy link
Copy Markdown
Contributor

Summary

Add comprehensive LSP server support covering web frameworks, linters, and system languages by referencing the OpenCode implementation.

Phase 1 - Web/Common:

  • Biome: JS/TS/JSON/CSS linter with auto-download
  • Svelte: Svelte language support with auto-download
  • Astro: Astro language support with auto-download
  • YamlLS: YAML language server via npm
  • BashLS: Shell script support via npm
  • DockerfileLS: Dockerfile support via npm

Phase 2 - Additional Languages:

  • Rubocop: Ruby linter (requires gem install)
  • ElixirLS: Elixir language server with Mix build
  • ZLS: Zig language server with GitHub auto-download
  • C#/F#: .NET language support via dotnet tool
  • SourceKit: Swift (macOS system-only)
  • Clangd: C/C++ with GitHub auto-download
  • JDTLS: Java via Eclipse download
  • LuaLS: Lua with GitHub auto-download
  • PHP: Intelephense via npm
  • OCaml: OCaml-LSP (system-only)
  • TerraformLS: HashiCorp Terraform with GitHub auto-download
  • TexLab: LaTeX with GitHub auto-download
  • Gleam: Gleam language (system-only)

All servers follow existing patterns with proper:

  • Exit code validation for archive extraction
  • Cross-platform fs.readdir() instead of shell commands
  • Mix build step error handling for ElixirLS
  • Version tracking with marker files

Closes #50

Test plan

  • TypeScript typecheck passes
  • All 144 existing tests pass (9 skipped, 0 failures)
  • Code quality review completed with fixes applied
  • Manual testing with specific language servers (requires language-specific projects)

Add comprehensive LSP server support covering web frameworks, linters,
and system languages:

Phase 1 - Web/Common:
- Biome: JS/TS/JSON/CSS linter with auto-download
- Svelte: Svelte language support with auto-download
- Astro: Astro language support with auto-download
- YamlLS: YAML language server via npm
- BashLS: Shell script support via npm
- DockerfileLS: Dockerfile support via npm

Phase 2 - Additional Languages:
- Rubocop: Ruby linter (requires gem install)
- ElixirLS: Elixir language server with Mix build
- ZLS: Zig language server with GitHub auto-download
- C#/F#: .NET language support via dotnet tool
- SourceKit: Swift (macOS system-only)
- Clangd: C/C++ with GitHub auto-download
- JDTLS: Java via Eclipse download
- LuaLS: Lua with GitHub auto-download
- PHP: Intelephense via npm
- OCaml: OCaml-LSP (system-only)
- TerraformLS: HashiCorp Terraform with GitHub auto-download
- TexLab: LaTeX with GitHub auto-download
- Gleam: Gleam language (system-only)

All servers follow existing patterns with proper:
- Exit code validation for archive extraction
- Cross-platform fs.readdir() instead of shell commands
- Mix build step error handling for ElixirLS
- Version tracking with marker files

Closes #50
@amondnet amondnet linked an issue Dec 19, 2025 that may be closed by this pull request
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @amondnet, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request dramatically expands the project's Language Server Protocol (LSP) capabilities by integrating support for 20 additional language servers. This enhancement provides richer development experiences for a wider array of programming languages and development tools, covering everything from web technologies and linters to various system and scripting languages, with a focus on reliable auto-installation and platform compatibility.

Highlights

  • Expanded LSP Server Support: Added 20 new Language Server Protocol (LSP) servers, significantly broadening language and tool support across web frameworks, linters, and system languages by referencing the OpenCode implementation.
  • Web and Common Language Servers: Introduced LSP support for Biome (JS/TS/JSON/CSS linter), Svelte, Astro, YAML, Bash, and Dockerfile, all with integrated auto-download capabilities.
  • Additional Language Servers: Integrated LSP servers for a diverse set of languages including Ruby (Rubocop), Elixir (ElixirLS), Zig (ZLS), C#/.NET, F#/.NET, Swift (SourceKit), C/C++ (Clangd), Java (JDTLS), Lua (LuaLS), PHP (Intelephense), OCaml, Terraform, LaTeX (TexLab), and Gleam.
  • Robust Installation and Management: Ensured new servers follow existing patterns for robust installation, including exit code validation for archive extraction, cross-platform file system operations, specific build step error handling (e.g., ElixirLS Mix build), and version tracking using marker files.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request significantly expands the LSP support by adding 20 new language servers, covering a wide range of languages and tools. The implementation for each server follows a consistent pattern of checking for system-installed binaries and falling back to auto-download and setup, which is great for user experience. The code is well-structured, with clear separation for each server's logic.

My review focuses on improving maintainability by reducing code duplication, increasing the stability of the auto-download mechanism by pinning to specific versions, and fixing a few bugs in the setup process for some servers. I've also identified several inconsistencies in the documentation that should be addressed. Overall, this is a fantastic contribution that greatly enhances the capabilities of the tool.

Comment thread packages/lsp/src/server.ts Outdated
Comment thread packages/lsp/src/server.ts Outdated
Comment thread packages/lsp/src/server.ts Outdated
Comment thread packages/lsp/src/server.ts Outdated
Comment thread packages/lsp/CLAUDE.md Outdated
Comment thread packages/lsp/src/server.ts Outdated
Comment thread packages/lsp/src/server.ts Outdated
Comment thread packages/lsp/src/server.ts Outdated
- Pin ElixirLS to stable release tag instead of master branch
- Pin JDTLS to specific milestone version (1.40.0) for stability
- Replace curl with downloadFile helper for JDTLS download
- Remove redundant clangd direct path check (binary is always in versioned subdir)
- Remove redundant fetch call in ElixirLS setup
Critical fixes:
- Fix ElixirLS binary path mismatch - scan versioned directories
- Fix LuaLS version tag format (remove 'v' prefix for asset names)
- Add filename matching for Dockerfile/Containerfile
- Add getServersForFile() and getServersForFilename() utilities

Important fixes:
- Add logging to all spawn() functions that return undefined
- Enhance GitHub API failure logging with status codes
- Fix JDTLS Java version regex for various formats
- Sync CLAUDE.md documentation with implementation

Documentation updates:
- Update Biome extensions (.mjs, .cjs, .mts, .cts, .jsonc, .graphql, .gql)
- Update root detection files for multiple servers
- Add note about Dockerfile filename matching
- Add new server utility functions
Split the monolithic server.ts (3,525 lines) into modular files in the
server/ directory for better maintainability.

- Create server/types.ts with shared interfaces (LSPServerHandle,
  LSPServerInfo, RootFunction, PlatformId)
- Create server/utils.ts with shared utilities (getPlatformId,
  downloadFile, extractZip, downloadAndExtract, attachLSPProcessHandlers,
  nearestRoot, log)
- Create 31 individual server files (typescript, deno, pyright, gopls,
  rust-analyzer, oxlint, kotlin, dart, vue, svelte, astro, prisma,
  eslint, biome, yaml, bash, dockerfile, rubocop, elixir, zls, csharp,
  fsharp, sourcekit, clangd, jdtls, lua, php, ocaml, terraform, texlab,
  gleam)
- Create server/index.ts with LSP_SERVERS array and lookup functions
- Update server.ts to re-export from server/index for backward
  compatibility

Also fix flaky test in lsp-provider.test.ts by using non-matching
file extension to avoid triggering TypeScript LSP server spawn.
@amondnet amondnet self-assigned this Dec 21, 2025
@codecov

codecov Bot commented Dec 21, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 22.88998% with 2348 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.82%. Comparing base (c78da98) to head (539b524).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/lsp/src/server/kotlin.ts 25.62% 148 Missing ⚠️
packages/lsp/src/server/eslint.ts 12.34% 142 Missing ⚠️
packages/lsp/src/server/vue.ts 21.97% 142 Missing ⚠️
packages/lsp/src/server/elixir.ts 9.23% 118 Missing ⚠️
packages/lsp/src/server/clangd.ts 9.60% 113 Missing ⚠️
packages/lsp/src/server/jdtls.ts 9.60% 113 Missing ⚠️
packages/lsp/src/server/astro.ts 20.89% 106 Missing ⚠️
packages/lsp/src/server/prisma.ts 15.51% 98 Missing ⚠️
packages/lsp/src/server/dart.ts 27.61% 97 Missing ⚠️
packages/lsp/src/server/lua.ts 17.54% 94 Missing ⚠️
... and 23 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #51      +/-   ##
==========================================
- Coverage   48.76%   39.82%   -8.94%     
==========================================
  Files          22       55      +33     
  Lines        4561     6345    +1784     
==========================================
+ Hits         2224     2527     +303     
- Misses       2337     3818    +1481     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@amondnet
amondnet merged commit bd66e30 into main Dec 21, 2025
6 of 9 checks passed
@amondnet
amondnet deleted the 50-add-20-additional-lsp-servers-from-opencode-reference branch December 21, 2025 07:39
@passionfactory-bot passionfactory-bot Bot mentioned this pull request Dec 21, 2025
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.

Add 20 additional LSP servers from OpenCode reference

1 participant