feat(lsp): add Metals LSP support for Scala#12268
Open
YichenLi00 wants to merge 1 commit intoanomalyco:devfrom
Open
feat(lsp): add Metals LSP support for Scala#12268YichenLi00 wants to merge 1 commit intoanomalyco:devfrom
YichenLi00 wants to merge 1 commit intoanomalyco:devfrom
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
- Add .sbt and .sc extension mappings - Auto-download Coursier if not present (macOS, Linux, Windows) - Auto-install Metals via Coursier - Requires Java 11+ - Respects OPENCODE_DISABLE_LSP_DOWNLOAD flag
30cbb96 to
09b64e2
Compare
Author
|
The failing test ( |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.scala,.sbt,.sc)Closes #10685
Implementation Details
.scala,.sbt,.scbuild.sbt,build.sc,.scala-build,project/build.propertiescs install metalsmetals(no arguments needed)statusBarProvider: "log-message",isHttpEnabled: trueWhy these decisions?
Coursier over direct binary download - Metals is distributed via Coursier (the Scala artifact manager). This is the official installation method and handles JVM version compatibility automatically.
Auto-download Coursier if missing - Follows existing patterns (gopls via
go install, csharp-ls viadotnet tool install). Coursier binaries are available for all major platforms.Java 11+ requirement - Metals requires Java 11 or later. The implementation checks for Java availability before attempting installation.
Project detection files - Covers SBT (
build.sbt), Mill (build.sc), Scala CLI (.scala-build), and SBT version file (project/build.properties).Files Changed
packages/opencode/src/lsp/language.ts- Add.sbtand.scextensionspackages/opencode/src/lsp/server.ts- Add Metals LSP serverpackages/web/src/content/docs/lsp.mdx- Update documentation