diff options
author | awy <awy@awy.one> | 2025-10-14 18:27:29 +0300 |
---|---|---|
committer | awy <awy@awy.one> | 2025-10-14 18:27:29 +0300 |
commit | de009fd679e10d053fdcc10785f91ad5317449ea (patch) | |
tree | 60918a488b579588596cf4d509fde298dccbf15d /.config/nvim/lsp/bacon_ls.lua | |
parent | 9ea6cf81adb5d6abc59843de1db45913210f9320 (diff) | |
download | hyprdots-de009fd679e10d053fdcc10785f91ad5317449ea.tar.gz |
nvim revamp
Diffstat (limited to '.config/nvim/lsp/bacon_ls.lua')
-rw-r--r-- | .config/nvim/lsp/bacon_ls.lua | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/.config/nvim/lsp/bacon_ls.lua b/.config/nvim/lsp/bacon_ls.lua new file mode 100644 index 0000000..44c5697 --- /dev/null +++ b/.config/nvim/lsp/bacon_ls.lua @@ -0,0 +1,47 @@ +---@brief +--- +--- https://github.com/crisidev/bacon-ls +--- +--- A Language Server Protocol wrapper for [bacon](https://dystroy.org/bacon/). +--- It offers textDocument/diagnostic and workspace/diagnostic capabilities for Rust +--- workspaces using the Bacon export locations file. +--- +--- It requires `bacon` and `bacon-ls` to be installed on the system using +--- [mason.nvim](https://github.com/williamboman/mason.nvim) or manually +--- +--- ```sh +--- $ cargo install --locked bacon bacon-ls +--- ``` +--- +--- Settings can be changed using the `init_options` dictionary:util +--- +--- ```lua +--- init_options = { +--- -- Bacon export filename (default: .bacon-locations). +--- locationsFile = ".bacon-locations", +--- -- Try to update diagnostics every time the file is saved (default: true). +--- updateOnSave = true, +--- -- How many milliseconds to wait before updating diagnostics after a save (default: 1000). +--- updateOnSaveWaitMillis = 1000, +--- -- Try to update diagnostics every time the file changes (default: true). +--- updateOnChange = true, +--- -- Try to validate that bacon preferences are setup correctly to work with bacon-ls (default: true). +--- validateBaconPreferences = true, +--- -- f no bacon preferences file is found, create a new preferences file with the bacon-ls job definition (default: true). +--- createBaconPreferencesFile = true, +--- -- Run bacon in background for the bacon-ls job (default: true) +--- runBaconInBackground = true, +--- -- Command line arguments to pass to bacon running in background (default "--headless -j bacon-ls") +--- runBaconInBackgroundCommandArguments = "--headless -j bacon-ls", +--- -- How many milliseconds to wait between background diagnostics check to synchronize all open files (default: 2000). +--- synchronizeAllOpenFilesWaitMillis = 2000, +--- } +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'bacon-ls' }, + filetypes = { 'rust' }, + root_markers = { '.bacon-locations', 'Cargo.toml' }, + init_options = {}, +} |