Skip to content

matze/beancount-language-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

beancount-language-server

Rust

A Language Server Protocol (LSP) server implementation for Beancount ledgers.

Features

  • Completion: accounts, payees
  • Formatting: full file
  • Definitions: commodities
  • Diagnostics: if bean-check is on $PATH

Installation

Build the binary

cargo build --release

and copy it to your path, e.g.

cp target/release/beancount-language-server ~/.local/bin

Neovim LSP setup

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({})

License

beancount-language-server is licensed under the MIT license, see LICENSE for more information.

About

Beancount language server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages