Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Upgrading to latest commit and neovim 0.11.1 #990

Discussion options

Was testing out the latest commit to see about locking in a new version of org-roam, and I'm hitting errors that I haven't fully figured out if they're my setup (probably?) or a breaking change.

Versions

  1. Orgmode is at commit 55b68bb
  2. Org-roam is at commit 5ff1c9b
  3. Neovim is version 0.11.1

Errors

  1. When opening any org file, I'm getting an error with org-bullets.nvim:
    Error in decoration provider "win" (ns=org-bullets):
    Error executing lua: .../neovim/0.11.1/share/nvim/runtime/lua/vim/treesitter.lua:111: Parser could not be created for buffer 2 and language "org"
    stack traceback:
     [C]: in function 'error'
     .../neovim/0.11.1/share/nvim/runtime/lua/vim/treesitter.lua:111: in function 'get_parser'
     ...cal/share/nvim/lazy/org-bullets.nvim/lua/org-bullets.lua:237: in function 'get_mark_positions'
     ...cal/share/nvim/lazy/org-bullets.nvim/lua/org-bullets.lua:280: in function <...cal/share/nvim/lazy/org-bullets.nvim/lua/org-bullets.lua:276>
    
  2. During org-roam setup, where I inject the custom function in the org mappings for opening at point (code pointer) to support opening roam node links, it seems to trigger something via the __index metatable to fail on treesitter:
    Failed to run `config` for org-roam.nvim
    ...m/0.11.1/share/nvim/runtime/lua/vim/treesitter/query.lua:373: Query error at 2:3. Invalid node type "inline_code_block":
     (inline_code_block
     ^
    # stacktrace:
     - /opt/homebrew/Cellar/neovim/0.11.1/share/nvim/runtime/lua/vim/treesitter/query.lua:373 _in_ **fn**
     - /opt/homebrew/Cellar/neovim/0.11.1/share/nvim/runtime/lua/vim/func/_memoize.lua:78 _in_ **fn**
     - /opt/homebrew/Cellar/neovim/0.11.1/share/nvim/runtime/lua/vim/func/_memoize.lua:78 _in_ **get**
     - /opt/homebrew/Cellar/neovim/0.11.1/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:142 _in_ **_get_parser**
     - /orgmode/lua/orgmode/files/file.lua:163 _in_ **parse**
     - /orgmode/lua/orgmode/files/file.lua:204 _in_ **get_ts_captures**
     - /orgmode/lua/orgmode/files/file.lua:224 _in_ **method**
     - /orgmode/lua/orgmode/utils/memoize.lua:50 _in_ **get_headlines**
     - /orgmode/lua/orgmode/files/init.lua:131 _in_ **get_clocked_headline**
     - /orgmode/lua/orgmode/clock/init.lua:24 _in_ **init**
     - /orgmode/lua/orgmode/clock/init.lua:18 _in_ **new**
     - /orgmode/lua/orgmode/init.lua:74 _in_ **init**
     - /orgmode/lua/orgmode/init.lua:213 _in_ **instance**
     - /orgmode/lua/orgmode/init.lua:33 _in_ **__index**
     - ~/projects/org-roam.nvim/lua/org-roam/setup/plugin.lua:18
     - ~/projects/org-roam.nvim/lua/org-roam/setup.lua:74 _in_ **__modify_orgmode_plugin**
     - ~/projects/org-roam.nvim/lua/org-roam/setup.lua:26 _in_ **setup**
     - ~/.config/nvim/lua/senkwich/plugins/org-roam.lua:8 _in_ **config**
    
You must be logged in to vote

What does :checkhealth orgmode give? For 1st error, I assume it's something regarding org-bullets, you can try disabling it temporarily. For 2nd, it seems you didn't update to the newest parser. It should be done automatically though. Try running :Org ts_install_grammar to force it. Let me know how it goes.

Replies: 1 comment 3 replies

Comment options

I'm using lazy.nvim, and here's my config in case I'm missing a step these days:

return {
 'nvim-orgmode/orgmode',
 dependencies = {
 { 'nvim-treesitter/nvim-treesitter', lazy = true },
 },
 event = 'VeryLazy',
 config = function()
 local org_root = '~/orgfiles'
 -- Support Shift+Return while in insert mode to act as a meta return for orgmode,
 -- which does things like add a new headline or new list item from existing item
 vim.api.nvim_create_autocmd('FileType', {
 pattern = 'org',
 callback = function()
 vim.keymap.set('i', '<S-CR>', '<CMD>lua require("orgmode").action("org_mappings.meta_return")<CR>', {
 silent = true,
 buffer = true,
 })
 end,
 })
 -- Trim whitespace at end of lines within orgmode documents
 vim.api.nvim_create_autocmd('BufWritePre', {
 pattern = '*.org',
 command = ':%s/\\s\\+$//e',
 })
 require('orgmode').setup({
 -- Collapsed my setup since it shouldn't affect anything
 })
 -- Reload current file if it's org file to reload tree-sitter
 if vim.bo.filetype == 'org' then
 vim.cmd([[edit!]])
 end
 end,
}
You must be logged in to vote
3 replies
Comment options

What does :checkhealth orgmode give? For 1st error, I assume it's something regarding org-bullets, you can try disabling it temporarily. For 2nd, it seems you didn't update to the newest parser. It should be done automatically though. Try running :Org ts_install_grammar to force it. Let me know how it goes.

Answer selected by chipsenkbeil
Comment options

Also, does orgmode work without org-roam?

Comment options

:checkhealth orgmode

Orgmode ~

  • ✅ OK Tree-sitter grammar is installed, but not by nvim-orgmode plugin. Any issues or version mismatch will need to be handled manually.
    If you want nvim-orgmode to manage the parser installation (recommended), remove the installed parser at "/Users/senkwich/.local/share/nvim/lazy/nvim-treesitter/parser/org.so" and restart Neovim.
  • ✅ OK Setup called
  • ✅ OK org_agenda_files configured
  • ✅ OK org_default_notes_file configured

Ah ha! So it does seem like there was some old treesitter parser sitting around. Odd because I have the exclusion of org included in my treesitter config. Looking at the date of the file, it's from way back in March of 2024, so must be before I updated my config to exclude it.

That fixed both issues, so it was definitely the legacy treesitter causing issues! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /