hledger-lsp

module
v0.2.38 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2026 License: MIT

README ΒΆ

hledger-lsp

Go Version License Release coverage

A Language Server Protocol (LSP) implementation for hledger journal files. Provides IDE features like completions, diagnostics, formatting, and more for any LSP-compatible editor.

🎯 Features

Completions
  • Accounts β€” Fuzzy matching with frequency-based ranking
  • Payees β€” From transaction history with usage counts
  • Commodities β€” From directives and usage
  • Tags β€” Name and value completion from existing tags
  • Dates β€” today/yesterday/tomorrow + historical dates from file
Navigation
  • Go to Definition β€” Jump to account/commodity/payee declaration
  • Find References β€” Find all usages across workspace
  • Rename β€” Refactor accounts, commodities, and payees across files
  • Workspace Symbol β€” Quick search for accounts, commodities, payees
Diagnostics
  • Real-time validation of transactions
  • Balance checks and syntax errors
Other
  • Formatting β€” Automatic alignment of amounts (right-aligned or decimal-point aligned)
  • Hover β€” Account balances on hover
  • Semantic Tokens β€” Syntax highlighting with delta support
  • Document Symbols β€” Outline navigation
  • Folding Ranges β€” Collapse transactions and directives
  • Document Links β€” Clickable include file paths
  • Include Support β€” Multi-file journals with cycle detection

πŸ“¦ Installation

From Releases

Download the latest binary for your platform from GitHub Releases.

# macOS (Apple Silicon)
curl -L https://github.com/juev/hledger-lsp/releases/latest/download/hledger-lsp_darwin_arm64 -o hledger-lsp
chmod +x hledger-lsp
sudo mv hledger-lsp /usr/local/bin/

# macOS (Intel)
curl -L https://github.com/juev/hledger-lsp/releases/latest/download/hledger-lsp_darwin_amd64 -o hledger-lsp
chmod +x hledger-lsp
sudo mv hledger-lsp /usr/local/bin/

# Linux (x86_64)
curl -L https://github.com/juev/hledger-lsp/releases/latest/download/hledger-lsp_linux_amd64 -o hledger-lsp
chmod +x hledger-lsp
sudo mv hledger-lsp /usr/local/bin/
From Source
go install github.com/juev/hledger-lsp/cmd/hledger-lsp@latest
Verify Installation
hledger-lsp --version

πŸš€ Quick Start

  1. Install hledger-lsp (see above)
  2. Configure your editor (see below)
  3. Open a .journal, .hledger, or .prices file
  4. Start typing and enjoy completions!
2024-01-15 * grocery store
    expenses:food  $50.00
    assets:cash

πŸ”§ Editor Setup

βš™οΈ Configuration

See docs/configuration.md for supported settings and defaults.

βš™οΈ Supported Features

Feature Status
Completions βœ…
Diagnostics βœ…
Formatting βœ…
Hover βœ…
Semantic Tokens βœ…
Document Symbols βœ…
Go to Definition βœ…
Find References βœ…
Rename βœ…
Folding Ranges βœ…
Document Links βœ…
Workspace Symbol βœ…
Inline Completion βœ…

⚑ Performance

  • Incremental updates: ~2.7ms for 1000 transactions (NFR < 50ms)
  • Completion: ~4.2ms response time (NFR < 100ms)
  • Parsing: ~11ms for 10k transactions (NFR < 500ms)
  • Memory: ~31MB for large journals (NFR < 200MB)

See docs/benchmarks.md for detailed benchmarks.

πŸ“š Resources

πŸ“„ License

MIT Β© Denis Evsyukov

Directories ΒΆ

Path Synopsis
cmd
hledger-lsp command
internal
ast
cli
filetype
Package filetype detects hledger file types from URI extensions.
Package filetype detects hledger file types from URI extensions.
lsputil
Package lsputil provides UTF-8/UTF-16 position mapping utilities for LSP.
Package lsputil provides UTF-8/UTF-16 position mapping utilities for LSP.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL