mirror of
https://github.com/neovim/neovim.git
synced 2026-05-04 21:15:09 +00:00
fix(treesitter): don't invalidate parser when discovering injections
When parsing with a range, languagetree looks up injections and adds them if needed. This explicitly invalidates parser, making `is_valid` report `false` both when including and excluding children. This is an attempt to describe desired behaviour of `is_valid` in tests, with what ended up being a single line change to satisfy them.
This commit is contained in:
committed by
Christian Clason
parent
40139738eb
commit
72ed99319d
@@ -508,7 +508,6 @@ function LanguageTree:add_child(lang)
|
||||
end
|
||||
|
||||
self._children[lang] = child
|
||||
self:invalidate()
|
||||
self:_do_callback('child_added', self._children[lang])
|
||||
|
||||
return self._children[lang]
|
||||
@@ -524,7 +523,6 @@ function LanguageTree:remove_child(lang)
|
||||
if child then
|
||||
self._children[lang] = nil
|
||||
child:destroy()
|
||||
self:invalidate()
|
||||
self:_do_callback('child_removed', child)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user