feat(ALL): check children treesitter languages after parents#2407
Draft
TheLeoP wants to merge 1 commit intonvim-mini:mainfrom
Draft
feat(ALL): check children treesitter languages after parents#2407TheLeoP wants to merge 1 commit intonvim-mini:mainfrom
TheLeoP wants to merge 1 commit intonvim-mini:mainfrom
Conversation
Member
|
Thanks for the PR!
There are already tests for injected languages (this one for 'mini.ai'). They use built-in Lua -> Vimscript injections. I think tests for this could use even Lua -> Vimscript -> Lua injections. Like here: vim.cmd([[
set cursorline
lua local a = 1
]])
There is less overall complexity if tree-sitter related (and even some other) code in 'mini.ai' and 'mini.surround' is kept as aligned as possible. As per this PR, please reduce code duplication. Both parents and children are meant to be processed exactly the same, right? In both 'mini.ai' and 'mini.surround' this processing is rather complicated, so even with two times duplication it adds a lot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is only a proof of concept of what a fix for #2397 would look like.
Thoughts:
mini.surrounddoesn't seem to need this change since the cursor always needs to already be on top of the region with a treesitter injection. So, it will be parsed even before this PR when going up the tree.