Neovim tree-sitter error when loading julia file: invalid node type "function_expression"

After updating my neovim setup I get the following error

My guess is I am not alone here (?)

Searching a bit around I think a fix is already available from this commit

But I don’t know when this will land to the latest tree-sitter release.

It looks like tree-sitter doesn’t gracefully handle versioning of 3rd party modules like julia.
I don’t even know how to poll which tree-sitter-julia version is installed, let alone how to instruct tree-sitter to use the newest version.

Any help ?

1 Like

My understanding is that the parsers are locked in the nvim-treesitter plugin (in their lockfile.json). So you’d have to pin a version of nvim-treesitter that has the julia parser you want, or potentially look into an advanced setup.

What syntax do you have in your .jl file that triggers this error? I’m on nvim-treesitter v0.9.3, and I’m haven’t seen any issues.

Did you run :TSUpdate ?

Same issue for me :frowning:
It seems julia is no longer ticked on the list of supported languages.

Yes.

I am running on neovim v0.10.2 and the latest nvim-treesitter commit 8a74ac9a with the lockfile.jl showing the latest tree-sitter-julia commit e01c928d11375513138a175a68485c4d53e55ea9.
I have uninstalled/installed tree-sitter plugin several times.

Just starting an empty .jl file is enough

I’m on nvim-treesitter v0.9.3, and I’m haven’t seen any issues.

@goerz just curious… what plugin manager are you using and how did you identify the version?

I don’t know why, but I had the following Lazy configuration for nvim-treesitter

  {
    -- Highlight, edit, and navigate code
    'nvim-treesitter/nvim-treesitter',
    dependencies = {
      'nvim-treesitter/nvim-treesitter-textobjects',
    },
    build = ':TSUpdate',
  },

The current version of nvim-treesitter/nvim-treesitter-textobjects has the following line

which provokes the error.

I just deleted nvim-treesitter/nvim-treesitter-textobjects from the dependency and uninstalled and now I don’t get the error.

There is also an issue open

1 Like

I’m using Lazy as well. My configuration is at GitHub - goerz/neovimrc: My Neovim Configuration

If you ever have a problem with treesitter queries that ship with nvim-treesitter, you can always use your own by putting them in ~/.config/nvim/queries/julia

1 Like