nvim-orgmode / nvim-orgmode/orgmode
Installing grammar doesn't work if installed tree-sitter is
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 3.9k
- Forks
- 190
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 7
Description
Describe the bug
I have tree-sitter 0.20.8 installed (because that is what is in the apt repo for Ubuntu 24.04).
When I run require'orgmode'.setup({...}) I get this error:
Failed to run config for orgmode
...ayne/.local/share/nvim/lazy/orgmode/lua/orgmode/init.lua:133: [orgmode] Failed to compile parser
# stacktrace:
- /orgmode/lua/orgmode/init.lua:133 _in_ **setup**
- ~/.config/nvim/lua/plugins/init.lua:194 _in_ **config**
I believe this is because that version of tree-sitter doesn't have the build subcommand.
checkhealth
==============================================================================
orgmode: 1 ⚠️
Orgmode ~
- ✅ OK Treesitter grammar installed (version 2.0.2)
- ⚠️ WARNING Setup not called
- ✅ OK
org_agenda_filesconfigured - ✅ OK
org_default_notes_fileconfigured
(note: this was after I figured out a workaround to install the grammar)
Steps to reproduce
- On a system with version 0.20 of tree-sitter, go through the installation process.
- Open the editor
- Notice the error message mentioned above
Expected behavior
I should be able to install the grammar and not get the error every time.
Also, it would be nice to get more information on why it failed. Like maybe show me the command it tried to run, and the stderr from running that command. Or write that information to a log file.
I can think of a couple of ways this could be handled:
- Check the tree-sitter version, if it is too old, then use the c compiler mode instead.
- If the tree-sitter version older, then use different arguments. (use build-wasm isntead of build?)
Emacs functionality
No response
Minimal init.lua
{
'nvim-orgmode/orgmode',
event = 'VeryLazy',
config = function()
require'orgmode'.setup({
org_agenda_files = "~/org/**/*",
org_default_notes_file = "~/org/refile.org"
})
end,
},
Screenshots and recordings
No response
nvim-orgmode version
3629625199b9a45bdb41fa734bc2c6ef86d251bd
OS / Distro
Ubuntu 24.04
Neovim version/commit
0.11.5
Additional context
If I remove tree-sitter from the list of compilers and it uses my c compiler instead, then it works fine.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading lua/orgmode/utils/treesitter/install.lua, especially the compiler list linked in the issue, and lua/orgmode/init.lua around line 133. Reproduce installation with tree-sitter 0.20 on Ubuntu 24.04; done means the grammar installs successfully or the failure exposes the attempted command and stderr.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100