Add ability to specify binary path/args for clangd (#10608)

This uses the language server settings added in #9293 to allow users to
specify the binary path and arguments with which to start up `clangd`.

Example user settings for `clangd`:

```json
{
  "lsp": {
    "clangd": {
      "binary": {
        "path": "/usr/bin/clangd",
        "arguments": ["--log=verbose"]
      },
    }
  }
}
```

Constraints:

* Right now this only allows ABSOLUTE paths.

Release Notes:

- Added ability to specify `clangd` binary `path` (must be absolute) and
`arguments` in user settings. Example: `{"lsp": {"clangd": {"binary":
{"path": "/usr/bin/clangd", "arguments": ["--log=verbose"] }}}}`
This commit is contained in:
Henrique Ferreiro 2024-04-16 18:17:15 +02:00 committed by GitHub
parent 2f00fcbdf6
commit c1c8a74c7f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 45 additions and 16 deletions

View file

@ -88,7 +88,7 @@ impl super::LspAdapter for GoLspAdapter {
})
} else {
let env = delegate.shell_env().await;
let path = delegate.which("gopls".as_ref()).await?;
let path = delegate.which(Self::SERVER_NAME.as_ref()).await?;
Some(LanguageServerBinary {
path,
arguments: server_binary_arguments(),