A Language Server Protocol (LSP) server implementation for Beancount ledgers.
- Completion: accounts, payees
- Formatting: full file
- Definitions: commodities
- Diagnostics: if
bean-check
is on$PATH
Build the binary
cargo build --release
and copy it to your path, e.g.
cp target/release/beancount-language-server ~/.local/bin
The official nvim-lspconfig plugin is set up for the Javascript-based language
server, so for now you
have to add an alternative configuration entry like this in your init.vim
:
local configs = require 'lspconfig.configs'
local util = require 'lspconfig.util'
configs["beancount_rs"] = {
default_config = {
cmd = {"beancount-language-server"};
filetypes = {"beancount"};
root_dir = function(fname)
return util.find_git_ancestor(fname) or util.path.dirname(fname)
end;
};
docs = {
description = "A Beancount language server";
default_config = {
root_dir = [[root_pattern("elm.json")]];
};
};
}
local nvim_lsp = require('lspconfig')
nvim_lsp.beancount_rs.setup({})
beancount-language-server is licensed under the MIT license, see LICENSE for more information.