zaucy / zed-starlark

Zed Starlark Extension
MIT License
8 stars 5 forks source link

make starpls lsp arguments configurable #5

Open p00f opened 1 month ago

p00f commented 1 month ago

I get this error:

Failed to fetch Bazel configuration! Please check the language server logs for more details. Certain features may not work correctly until the underlying issue is fixed.

It's probably because I use bazelisk. In neovim I can do this:

vim.lsp.start({
    name = "starpls",
    cmd = { "starpls", "server", "--bazel_path=bazelisk" },
})

but doing this in zed doesn't work:

  "lsp": {
    "starpls": {
      "binary": {
        "path": "starpls.exe",
        "arguments": ["server", "--bazel_path=bazelisk"]
      }
    }
  }
p00f commented 1 month ago

I also get an lsp diagnostic for config_setting: "config_setting" is not defined which I don't in neovim

p00f commented 1 month ago

I don't have bazel on PATH

zaucy commented 1 month ago

I would recommend symlinking bazelisk -> bazel on your path generally speaking, but I'll see what I can do to make starpls configurable :+1:

p00f commented 1 month ago

IMO even starpls should try to use bazelisk as a fallback, using bazelisk has got to be a common pattern

zaucy commented 1 month ago

having only bazelisk in your PATH is probably rare configuration. It is recommended to have bazelisk as bazel in your PATH.