Skip to content

Commit 6d2ae9f

Browse files
authored
feat: add bacon-ls support (#3160)
Signed-off-by: Bigo <[email protected]>
1 parent a284b14 commit 6d2ae9f

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
local util = require 'lspconfig.util'
2+
3+
return {
4+
default_config = {
5+
cmd = { 'bacon-ls' },
6+
filetypes = { 'rust' },
7+
root_dir = util.root_pattern('.bacon-locations', 'Cargo.toml'),
8+
single_file_support = true,
9+
settings = {},
10+
},
11+
docs = {
12+
description = [[
13+
https://github.com/crisidev/bacon-ls
14+
15+
A Language Server Protocol wrapper for [bacon](https://dystroy.org/bacon/).
16+
It offers textDocument/diagnostic and workspace/diagnostic capabilities for Rust
17+
workspaces using the Bacon export locations file.
18+
19+
It requires `bacon` and `bacon-ls` to be installed on the system using
20+
[mason.nvim](https://github.com/williamboman/mason.nvim) or manually:util
21+
22+
```sh
23+
$ cargo install --locked bacon bacon-ls
24+
```
25+
26+
Settings can be changed using the `settings` dictionary:util
27+
28+
```lua
29+
settings = {
30+
-- Bacon export filename, default .bacon-locations
31+
locationsFile = ".bacon-locations",
32+
-- Maximum time in seconds the LSP server waits for Bacon to update the
33+
-- export file before loading the new diagnostics
34+
waitTimeSeconds = 10
35+
}
36+
```
37+
]],
38+
},
39+
}

0 commit comments

Comments
 (0)