feat(lsp): add 20 additional LSP servers from OpenCode reference#51
Conversation
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
Summary of ChangesHello @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
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
- 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.
Codecov Report❌ Patch coverage is 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. 🚀 New features to boost your workflow:
|
Summary
Add comprehensive LSP server support covering web frameworks, linters, and system languages by referencing the OpenCode implementation.
Phase 1 - Web/Common:
Phase 2 - Additional Languages:
All servers follow existing patterns with proper:
Closes #50
Test plan