Skip to content

feat: Automatic LSP configuration for Copilot CLI (#74)#84

Merged
GordonBeeming merged 2 commits intomainfrom
add-lsp-support-images
Mar 24, 2026
Merged

feat: Automatic LSP configuration for Copilot CLI (#74)#84
GordonBeeming merged 2 commits intomainfrom
add-lsp-support-images

Conversation

@GordonBeeming
Copy link
Owner

Automatically configure Language Server Protocol (LSP) servers in container
images so Copilot CLI gets code intelligence out of the box.

  • Add lsp-typescript snippet: installs typescript-language-server for all images
  • Add lsp-csharp snippet: installs csharp-ls for dotnet images with .NET 10 SDK
    (csharp-ls v0.22.0 only ships net10.0 TFM, so dotnet-8/9 excluded)
  • Add lsp-rust snippet: adds rust-analyzer via rustup for rust images
  • Add lsp-golang snippet: installs gopls for golang images
  • Each snippet writes a config fragment to /etc/copilot/lsp-config.d/
  • Entrypoint merges fragments into ~/.copilot/lsp-config.json at startup
    (skipped if user provides their own)
  • Update images.json and regenerate all Dockerfiles

Closes #74

Co-authored-by: Claude Opus 4.6 (1M context) noreply@anthropic.com
Co-authored-by: GitButler gitbutler@gitbutler.com

Automatically configure Language Server Protocol (LSP) servers in container
images so Copilot CLI gets code intelligence out of the box.

- Add lsp-typescript snippet: installs typescript-language-server for all images
- Add lsp-csharp snippet: installs csharp-ls for dotnet images with .NET 10 SDK
  (csharp-ls v0.22.0 only ships net10.0 TFM, so dotnet-8/9 excluded)
- Add lsp-rust snippet: adds rust-analyzer via rustup for rust images
- Add lsp-golang snippet: installs gopls for golang images
- Each snippet writes a config fragment to /etc/copilot/lsp-config.d/
- Entrypoint merges fragments into ~/.copilot/lsp-config.json at startup
  (skipped if user provides their own)
- Update images.json and regenerate all Dockerfiles

Closes #74

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: GitButler <gitbutler@gitbutler.com>
@GordonBeeming GordonBeeming marked this pull request as ready for review March 24, 2026 19:28
Copilot AI review requested due to automatic review settings March 24, 2026 19:28
Copy link
Contributor

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

Adds automatic, image-baked LSP server configuration for GitHub Copilot CLI by installing language servers in relevant container images and generating a unified ~/.copilot/lsp-config.json at container startup from drop-in fragments.

Changes:

  • Add Docker snippet(s) to install LSP servers (TypeScript, Rust, Go, C#) and write per-language config fragments to /etc/copilot/lsp-config.d/.
  • Update the container entrypoint to merge fragment JSON files into ~/.copilot/lsp-config.json when the user hasn’t provided their own.
  • Update docker/images.json to include the new snippets across image variants and regenerate Dockerfiles.

Reviewed changes

Copilot reviewed 7 out of 17 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
docker/snippets/lsp-typescript.Dockerfile Installs TypeScript LSP and writes TypeScript LSP config fragment.
docker/snippets/lsp-rust.Dockerfile Installs Rust Analyzer and writes Rust LSP config fragment.
docker/snippets/lsp-golang.Dockerfile Installs gopls and writes Go LSP config fragment.
docker/snippets/lsp-csharp.Dockerfile Installs csharp-ls and writes C# LSP config fragment.
docker/shared/entrypoint.sh Merges /etc/copilot/lsp-config.d/*.json into ~/.copilot/lsp-config.json on startup if not user-provided.
docker/images.json Adds LSP snippets to the relevant image definitions so they’re included in generated Dockerfiles.
docker/generated/Dockerfile.default Regenerated to include TypeScript LSP snippet.
docker/generated/Dockerfile.playwright Regenerated to include TypeScript LSP snippet.
docker/generated/Dockerfile.dotnet Regenerated to include TypeScript + C# LSP snippets.
docker/generated/Dockerfile.dotnet-8 Regenerated to include TypeScript LSP snippet.
docker/generated/Dockerfile.dotnet-9 Regenerated to include TypeScript LSP snippet.
docker/generated/Dockerfile.dotnet-10 Regenerated to include TypeScript + C# LSP snippets.
docker/generated/Dockerfile.golang Regenerated to include TypeScript + Go LSP snippets.
docker/generated/Dockerfile.rust Regenerated to include TypeScript + Rust LSP snippets.
docker/generated/Dockerfile.dotnet-playwright Regenerated to include TypeScript + C# LSP snippets.
docker/generated/Dockerfile.dotnet-rust Regenerated to include TypeScript + C# + Rust LSP snippets.
.github/copilot-instructions.md Updates versioning instructions to reflect deriving CopilotHereVersion from VERSION and adds bump script guidance.

Address PR review feedback:
- Add ARG for typescript, typescript-language-server versions (default: latest)
- Add ARG for csharp-ls version (default: latest)
- Add ARG for gopls version (default: latest)
- Use --tool-path for csharp-ls instead of -g + symlink
- Add try/catch per LSP config fragment in entrypoint to prevent
  malformed JSON from bricking container startup
- Regenerate all Dockerfiles

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: GitButler <gitbutler@gitbutler.com>
@GordonBeeming GordonBeeming merged commit 3d2e852 into main Mar 24, 2026
29 checks passed
@GordonBeeming GordonBeeming deleted the add-lsp-support-images branch March 24, 2026 22:22
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.

Feature request: Automatic configure GitHub Copilot CLI for Language Server Protocol

2 participants