wllfaria / ledger.nvim

Neovim integration for ledger. Powered by tree-sitter.
11 stars 0 forks source link

Syntax highlighting? #2

Closed mattpetters closed 1 month ago

mattpetters commented 1 month ago

First off thanks for this! Just getting into PTA and cool to see an active dev option for Neovim integration!

Second, is any other LSP module required for syntax highlighting? I added your plug to my lazy load config but hitting a treesitter issue:

Error detected while processing BufEnter Autocommands for "*":
Failed to run `config` for ledger.nvim

....10.1/share/nvim/runtime/lua/vim/treesitter/language.lua:107: no parser for 'ledger' language, see :help treesitter-parsers

# stacktrace:
  - /opt/homebrew/Cellar/neovim/0.10.1/share/nvim/runtime/lua/vim/treesitter/language.lua:107 _in_ **add**
  - /opt/homebrew/Cellar/neovim/0.10.1/share/nvim/runtime/lua/vim/treesitter/query.lua:250 _in_ **fn**
  - /opt/homebrew/Cellar/neovim/0.10.1/share/nvim/runtime/lua/vim/func/_memoize.lua:58 _in_ **parse**
  - /ledger.nvim/lua/ledger/queries.lua:3
  - /ledger.nvim/lua/ledger/parser.lua:1
  - /ledger.nvim/lua/ledger/context.lua:3
  - /ledger.nvim/lua/ledger/init.lua:39 _in_ **setup**
  - ~/.config/nvim/lua/plugins/accounting.lua:8 _in_ **config**
  - ~/.config/nvim/init.lua:17
Press ENTER or type command to continue
mattpetters commented 1 month ago

Ahhh I think it could be related to the other dependencies (reading the tea leaves in the CI config ;) )

mattpetters commented 1 month ago

Actually nvm I think ledger needs to be added to the ensure_installed config, maybe in the dependency declaration. I pulled in the other deps while troubleshooting this so not sure if it works without them tbh

wllfaria commented 1 month ago

yeah, you need ledger as a source for tree-sitter, I should totally make that more explicit, I'm still doing work on this before I "announce" anywhere, but It should be usable! you need to have nvim-treesitter-ledger setup, and for completions, currently only nvim-cmp is supported