scalameta / metals-zed

Zed plugin for Metals
Apache License 2.0
56 stars 12 forks source link

Metals configuration enhancements #19

Closed mprihoda closed 2 months ago

mprihoda commented 2 months ago

The following changes allow to configure initial_options and server properties of Metals, and enable metals.http by default. This change launches the Metal's HTTP server on http://localhost:5031 which exposes Metals custom commands, so you don't have to launch VS Code every time you need to switch BSP server.

Also, it is possible to enable Metals' "best effort compilation" for Scala 3.5.0 by setting the argument in Zed's settings:

{
  ...
  "lsp": {
    "metals": {
      "binary": {
        "arguments": ["-Dmetals.http=on", "-Dmetals.enable-best-effort=true"]
      },
   ...
  }
}

There are 2 more unrelated tiny commits I'm lazy to split into separate PRs, will do if necessary. - adding grammars folder to ignore list, as it is generated by the compilation and updating to newer tree-sitter-scala version.

mprihoda commented 2 months ago

This will also provide an option for #16 - with the Metals' HTTP server the "Import build" can be triggered manually, if needed.

Snímek obrazovky 2024-08-27 v 15 29 56