-
Notifications
You must be signed in to change notification settings - Fork 240
Description
Describe the bug
Whenever opening a julia file, I get the error Invalid node type "function_expression". This error does not occur when only nvim-treesitter is active.
Explicitly, I get the following trace whenever I open a Julia file.
Error detected while processing BufReadPost Autocommands for "*":
Error executing lua callback: /opt/local/share/nvim/runtime/filetype.lua:35: Error executing lua: /opt/local/share/nvim/runtime/fi
letype.lua:36: BufReadPost Autocommands for "*"..FileType Autocommands for "*": Vim(append):Error executing lua callback: /opt/loc
al/share/nvim/runtime/lua/vim/treesitter/query.lua:252: Query error at 104:2. Invalid node type "function_expression":
(function_expression
^
stack traceback:
[C]: in function '_ts_parse_query'
/opt/local/share/nvim/runtime/lua/vim/treesitter/query.lua:252: in function 'fn'
/opt/local/share/nvim/runtime/lua/vim/func/_memoize.lua:58: in function 'fn'
/opt/local/share/nvim/runtime/lua/vim/func/_memoize.lua:58: in function 'get_query'
...r-textobjects/lua/nvim-treesitter/textobjects/shared.lua:99: in function 'available_textobjects'
...r-textobjects/lua/nvim-treesitter/textobjects/select.lua:173: in function 'attach'
...vim/lazy/nvim-treesitter/lua/nvim-treesitter/configs.lua:509: in function 'attach_module'
...vim/lazy/nvim-treesitter/lua/nvim-treesitter/configs.lua:532: in function 'reattach_module'
...vim/lazy/nvim-treesitter/lua/nvim-treesitter/configs.lua:133: in function <...vim/lazy/nvim-treesitter/lua/nvim-treesit
ter/configs.lua:132>
[C]: in function 'nvim_cmd'
/opt/local/share/nvim/runtime/filetype.lua:36: in function </opt/local/share/nvim/runtime/filetype.lua:35>
[C]: in function 'nvim_buf_call'
/opt/local/share/nvim/runtime/filetype.lua:35: in function </opt/local/share/nvim/runtime/filetype.lua:10>
stack traceback:
[C]: in function 'nvim_cmd'
/opt/local/share/nvim/runtime/filetype.lua:36: in function </opt/local/share/nvim/runtime/filetype.lua:35>
[C]: in function 'nvim_buf_call'
/opt/local/share/nvim/runtime/filetype.lua:35: in function </opt/local/share/nvim/runtime/filetype.lua:10>
stack traceback:
[C]: in function 'nvim_buf_call'
/opt/local/share/nvim/runtime/filetype.lua:35: in function </opt/local/share/nvim/runtime/filetype.lua:10>
Minimal-config
---Install Lazy package manager.
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
vim.fn.system {
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable', -- latest stable release
lazypath,
}
end
vim.opt.rtp:prepend(lazypath)
require('lazy').setup({
{
'nvim-treesitter/nvim-treesitter',
dependencies = {
'nvim-treesitter/nvim-treesitter-textobjects',
},
build = ':TSUpdate',
main = 'nvim-treesitter.configs',
opts = {
ensure_installed = { 'julia' },
textobjects = {
select = {
enable = true,
keymaps = {
['af'] = '@function.outer',
['if'] = '@function.inner',
},
},
}
},
},
})
To Reproduce
Steps to reproduce the behavior:
- In terminal,
touch test.jl - With the minimal config above,
nvim test.jl - See error
Expected behavior
No error should occur, and the plugin should work.
Output of :checkhealth nvim-treesitter
==============================================================================
nvim-treesitter: require("nvim-treesitter.health").check()
Installation ~
- WARNING
tree-sitter executable not found (parser generator, only needed for :TSInstallFromGrammar, not required for :TSInstall)
- WARNING
node executable not found (only needed for :TSInstallFromGrammar, not required for :TSInstall)
- OK
git executable found.
- OK
cc executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
Version: Apple clang version 14.0.0 (clang-1400.0.29.202)
- OK Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.
OS Info:
{
machine = "x86_64",
release = "21.6.0",
sysname = "Darwin",
version = "Darwin Kernel Version 21.6.0: Mon Jun 24 00:56:10 PDT 2024; root:xnu-8020.240.18.709.2~1/RELEASE_X86_64"
} ~
Parser/Features H L F I J
- c ✓ ✓ ✓ ✓ ✓
- javascript ✓ ✓ ✓ ✓ ✓
- julia ✓ ✓ ✓ ✓ ✓
- lua ✓ ✓ ✓ ✓ ✓
- luadoc ✓ . . . .
- luap ✓ . . . .
- markdown ✓ . ✓ ✓ ✓
- markdown_inline ✓ . . . ✓
- python ✓ ✓ ✓ ✓ ✓
- query ✓ ✓ ✓ ✓ ✓
- rust ✓ ✓ ✓ ✓ ✓
- vim ✓ ✓ ✓ . ✓
- vimdoc ✓ . . . ✓
Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
+) multiple parsers found, only one will be used
x) errors found in the query, try to run :TSUpdate {lang} ~
Output of nvim --version
NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1720049189
Run "nvim -V1 -v" for more info
Additional context