Comments (14)
I have this issue as well. It's because you're in a .lua
file but there's also .vim
syntax present. If I remember correctly, I would :TSUpdate vim
and it would resolve it.
from kickstart.nvim.
I noticed this too on a fresh install today, but :TSUpdate vim
has fixed it for me
from kickstart.nvim.
Adding vim
to the ensure_installed
list for treesitter seems to resolve this problem as well (and persistently across restarts).
https://github.com/nvim-lua/kickstart.nvim/blob/master/init.lua#L221
Follow-up: The lua queries from nvim-treesitter contain injections referencing vim. I guess this is causing the problem. Although I am not sure if missing the referenced injections "should" crash the parser or if this is some other bug.
At least adding lua and not vim to treesitter (like the kickstart does), seems to be the cause for the errors.
from kickstart.nvim.
Thank you @MichaelVessia this solved it for me.
Next time I opened nvim the problem returned.
from kickstart.nvim.
:TSUpdate vim seems to have resolved it for me as well, but keeping the issue open as it seems common enough that it should probably be worked around in the bootstrap code.
from kickstart.nvim.
So just to make sure we're clear, after running :TSUpdate vim
the problem was resolved?
from kickstart.nvim.
Correct.
from kickstart.nvim.
It did not fix it for me. But this predates my starting over with configuration using this repo.
here is the current output from checkhealth
nvim-treesitter: require("nvim-treesitter.health").check()
Installation
- WARNING:
tree-sitter
executable not found (parser generator, only needed for :TSInstallFromGrammar, not required for :TSInstall) - OK:
node
found v18.12.1 (only needed for :TSInstallFromGrammar) - OK:
git
executable found. - OK:
cc
executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
Version: cc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0 - 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 = "6.0.6-76060006-generic",
sysname = "Linux",
version = "#202210290932166906205022.04~d94609a SMP PREEMPT_DYNAMIC Mon N"
}
Parser/Features H L F I J
- regex β . . . .
- go β β β β β
- json β β β β .
- vim x β β . β
- comment β . . . .
- lua β β β β β
- html β β β β β
- bash β β β . β
- javascript β β β β β
- gitattributes β . . . β
- git_rebase β . . . β
- python β β β β β
- gitcommit β . . . β
- typescript β β β β β
- help β . . . β
- mermaid β . . . .
- yaml β β β β β
- c_sharp β β β . β
- markdown β . β . β
- c β β β β β
- rust β β β β β
- cpp β β β β β
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}
The following errors have been detected:
- ERROR: vim(highlights): /usr/local/share/nvim/runtime/lua/vim/treesitter/query.lua:171: query: invalid node type at position 4647 for language vim
vim(highlights) is concatenated from the following files:
| [OK]:"/home/moose/.local/share/nvim/site/pack/packer/start/nvim-treesitter/queries/vim/highlights.scm"
| [ERROR]:"/usr/local/share/nvim/runtime/queries/vim/highlights.scm", failed to load: /usr/local/share/nvim/runtime/lua/vim/treesitter/query.lua:171: query: invalid node type at position 581 for language vim
I was able to work around it using this syntax.
vim.cmd{ cmd='packadd packer.nvim'}
from kickstart.nvim.
@agentHoover I have this in my notes, if it's helpful:
-- If seeing errors parsing, check that you do not have two parsers installed. Why this happens I do not know.
-- :echo nvim_get_runtime_file('*/python.so', v:true)
-- rm -rf /usr/local/lib/nvim/parser
I'm still learning about treesitter so I don't know why this happens, but it seems like two highlights.scm files sometimes exist, as it seems to be in your case, and then it doesn't know which to use.
from kickstart.nvim.
@MichaelVessia yep. That fixed it. I tried to uninstall the vim parser with TSUninstall vim
and it told me that vim was still installed and exactly which file to remove manually to uninstall it. Removed the file, reinstalled, and all is well. The file I removed was located here: /usr/local/lib/nvim/parser/vim.so
for what its worth.
Thanks for your help.
from kickstart.nvim.
I had the same issue and fixed adding 'vim'
to ensure_installed.
. Maybe we should add 'vim' to that array by default. Are there drawbacks to adding it?
from kickstart.nvim.
π just that I thought I already had vim
in the list haha
If someone wants a free PR, they can open. Otherwise I'll do probably tomorrow or soon
from kickstart.nvim.
I have investigated these two treesitter situations...
Situation 1
After installing vim parser no more treesitter (2) errors:
init.lua:
vim.cmd [[packadd packer.nvim]]
vim.cmd [[colorscheme onedark]]
Situation 2
Example 01 (commands-GOOD.lua):
vim.cmd( [[
" ------------------------ COMMANDS --------------------------
" ----------------------------------------------------------
" Comm_ 01:
" Edit init.vim and cd to folder:
command! QeditVIMRC :e $MYVIMRC | tcd %:h
" ----------------------------------------------------------
" Comm_ 02:
" Toggle line relativenumber on or off.
command! QnumberRelativ set relativenumber!
" ----------------------------------------------------------
]] )
Example 02 (commands-BAD.lua):
When you move the cursor slowly from the first row down, then you can see that the treesitter is not working well.
vim.cmd [[
" ------------------------ COMMANDS --------------------------
" ----------------------------------------------------------
" Comm_ 01:
" Edit init.vim and cd to folder:
command! QeditVIMRC :e $MYVIMRC | tcd %:h
" ----------------------------------------------------------
" Comm_ 02:
" Toggle line relativenumber on or off.
command! QnumberRelativ set relativenumber!
" ----------------------------------------------------------
]]
Desktop:
- OS: Windows 10
- Terminal: no, nvim-qt.exe
** Neovim Version **
- Output of running
:version
from inside of neovim:
NVIM v0.8.2
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compiled by runneradmin@fv-az28-353
Features: -acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM\sysinit.vim"
fall-back for $VIM: "C:/Program Files (x86)/nvim/share/nvim"
from kickstart.nvim.
Should have all the required grammars now, so I can't reproduce crash anymore. Thanks!
from kickstart.nvim.
Related Issues (20)
- References highlight blinks every time the cursor is moved HOT 5
- LSP for html config HOT 8
- Telescope bindings don't work. HOT 11
- How do I add language specific LSP keymaps? HOT 6
- Language server does not install using termux on android HOT 1
- Language servers removed from `servers` table still take affect HOT 3
- telescope(?) issue in `init.lua` HOT 6
- Can we please enable DISCUSSIONS on this repo? HOT 4
- Telescope Current Buffer Fuzzy Find is showing last result HOT 4
- Debug Test For Go Not Working HOT 7
- Isnβt `hlsearch` the default option? Iβm missing something?
- Custom location of `lazy-lock.json` file HOT 3
- turn inlay hints on by default? HOT 6
- Initialization problem HOT 4
- Very slow with large C++ files in insert mode. HOT 2
- neodev has been deprecated in favour of lazydev
- Help with custom plugins / not loading HOT 3
- Warning on missing a parameter HOT 2
- Incorrect comments in init.lua
- Failed to load the parser for 'lua' for nvim-treesitter HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kickstart.nvim.