Skip to content

Installing grammar doesn't work if installed tree-sitter is #1082

@tmccombs

Description

@tmccombs

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_files configured
  • ✅ OK org_default_notes_file configured

(note: this was after I figured out a workaround to install the grammar)

Steps to reproduce

  1. On a system with version 0.20 of tree-sitter, go through the installation process.
  2. Open the editor
  3. 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:

  1. Check the tree-sitter version, if it is too old, then use the c compiler mode instead.
  2. 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

3629625

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions