Closed vakorol closed 6 months ago
Here's also the full backtrace from GDB when running Neovim v0.10.0 compiled with debug info:
Sorry, tree-sitter-html
was not compiled for debugging, thus "No symbol table info available".
can't reproduce - what version of the parser is it?
can't reproduce - what version of the parser is it?
TBH, I don't know how to check the version. It is installed automatically by Treesitter. Can you give me a hint what to look for?
Meanwhile, I tried disabling all other Neovim plugins (except for Lualine) and all other Treesitter parsers - the problem persists.
can you reinstall the latest parser revision and confirm it still persists? an older version will crash with the newer tree-sitter library runtime.
can you reinstall the latest parser revision and confirm it still persists? an older version will crash with the newer tree-sitter library runtime.
I have tried :TSUninstall html
and :TSUninstall all
already, and then installed the parser again.
I am having a similar issue. For me, neovim crashes whenever I edit anything inside of valid html tags or between them, but only if all of the html in the file is valid. If I break one of the tags so that it no longer constitutes a valid html tag, the whole file seems to work just fine, I can do whatever I want to edit the tags.
I confirmed that I'm using the most recent tree-sitter html parser by uninstalling and reinstalling it, and I also confirmed that it was for sure the tree-sitter html parser by disabling the parser and confirming that the error no longer persisted. I'm on neovim 0.9.5.
I am working on reproducing the bug with a minimal configuration right now.
I haven't looked very deep in the code, but the function that crashes is (according to the GDB backtrace):
void tree_sitter_html_external_scanner_destroy(void *payload) {
Scanner *scanner = (Scanner *)payload;
for (unsigned i = 0; i < scanner->tags.size; i++) {
tag_free(&scanner->tags.contents[i]);
}
array_delete(&scanner->tags);
ts_free(scanner);
}
I believe, ts_free
is defined in alloc.h
:
#ifndef ts_free
#define ts_free free
#endif
So, if this is the standard Glibc free
, it should be called after malloc
? But there is no explicit allocation for scanner
- ts_malloc
is only called for the contents of the Scanner
instance (which is basically an Array
)..
Is this correct?
An update:
I have just compiled tree-sitter-html
from the master
branch, and substituted ~/.local/nvim/share/lazy/nvim-treesitter/parser/html.so
with the resulting .so
file. The problem disappeared.
Therefore the issue does not seem to exist in main
.
The question is: which version of the parser does treesitter
pull out with :TSInstall
?
The question is: which version of the parser does treesitter pull out with :TSInstall?
Whatever is in lockfile.json
I'm closing this because it's getting off topic, and seems to not be an issue on master.
Hi!
I'm having trouble with the
html
parser fortree-sitter
in Neovim.Consider the following trivial HTML code:
Attempting to edit the
"fr"
value - for example, changing it to"en"
- makes Neovim crash after trying to type in the second char (right after the attribute value becomes"e"
).I managed to capture the crash with GDB:
Neovim version: 0.10.0-dev
I double-checked that the problem does not exist if the
html
parser is uninstalled.