-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: remove nvim-treesitter as a dependency #523
Conversation
Thank you for tackling this! I think the best course here is to not merge this to master but make this a new parallel branch (This also means we don't have to complete the rewrite in a single PR.)
💯 (and yes, this approach is what I would suggest as well)
Probably not; I would enable this globally with a check for parsers and query that short-circuits them. Also, it's perfectly fine (and often preferable) to have some global startup code in
I consider
Yes, should vim.treesitter.query.get be cached?
Yes, definitely! We don't need yet another DSL for setting keymaps. (Although we could talk about reasonable default mappings as opt-in.) Although possibly this is a special case here; maybe we could discuss instead exposing a single (Lua!) function that is easy to map?
That is OK; you need |
Correct me if I'm wrong, but doesn't core already cache this via a weak table? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any plans to keep the commands? We've added them because some users requested them because they wanted to use them in ext mode or for vinyl remappings. Not a strong requirement since all functionality is available via Lua functions, just being curious on what your idea for this PR was.
I believe you're right, they should be cached. Nvim-treesitter-textobjects might be doing additional caching of the query results if they are using still an own slow algorithm to aggregate query results |
I think we should take this opportunity to revisit the user API here, with all the lessons learned since. (Not necessarily in this PR.) My preference would be to start with a clean slate and (re-)add stuff when it is requested with a compelling use case. (User commands are trivial to add in a What I don't want to see again is a custom module for creating keymaps and user commands through |
How should I tackle this? I see that I can change which branch the PR targets, but I can't select the |
Now it does :) |
So |
Does this mean the |
This comment was marked as outdated.
This comment was marked as outdated.
Nice; want to make a PR to remove it from the |
Sadly, my previous comment was incorrect.
|
So we will need the same sort of memoization here for the textobjects query results, right? |
Would be nice, I don't think there's one right now though |
I didn't understand the codebase enought to know what |
@TheLeoP basically we create a new node capture from the two node captures that is specified for |
@clason Is there a specific part of the code left that you would like to be refactored? I still haven't give too much atention to test, docs or scripts, I wanted to focus on the plugin functionality first. |
I think you are right that we should first make sure everything works with nvim-treesitter Also, we have an autoformatter for queries now, which could be added to CI here ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you keep the keymap configuration in setup?
What I don't want to see again is a custom module for creating keymaps and user commands through
setup()
.
Disregard this comment. :^)
No, this comment stands. I want to see the module framework gone. If you want to set keymaps (through this plugin), use the Neovim API directly. |
Yes, I didn't mean it should remain a module. |
@TheLeoP this looks like it's in a good place -- can you take care of the remaining items? |
@clason. Will do. Question: are the current vimdocs generated? Or do they have to be manually updated? |
They are manually written. It's OK to have a minimal (but correct) version for the initial PR. |
Is it expected to document the lua API being used for keymaps on the vimdocs/README? |
The query files test is working again c:, but the python tests seem to be broken indeed and I don't know enought python to look into them. I wouldn't like to keep blocking this PR. @clason would it be ok to remove the python tests, as you mentioned, and move native lua test to a follow up PR? |
This PR should be ready to merge |
Can you squash your commits and update the PR/commit message (what's changed, what's still todo)? Then I'll merge. |
I've squashed all my commits and updated the PR and commit messages. Let me know if there is something else I may be missing |
You may need to rebase on |
Guess we need to rebase on master. Let me try to do this properly, you don't have to worry about it. |
details: - This plugin no longer depends on nvim-treesitter nor it's modules system. - A bunch of code previously owned by nvim-treesitter has been moved to this plugin and been refactored. - The user interface has changed in the following ways: - keymaps are no longer an option provided via the `setup` function. Users are expected to create them using `vim.keymap.set` - User commands have been removed for now. - Python dependant tests (consistency_tests) have been removed - Check #523 for more info
Ok, CI is green. @TheLeoP Before you delete (or pull!) your branch, please check the diff here against your local changes to make sure I did not force-push some of them away (in which case, please make a follow-up PR from latest I'm looking forward to follow-up PRs (by you and other interested parties) cleaning up the old legacy design and adding a proper keymap setup (@ObserverOfTime). @kiyoon @ribru17 Note that this means that
|
Yes: hell must freeze over. |
Less facetiously: these changes will never make it to |
Makes sense, thank you |
details: - This plugin no longer depends on nvim-treesitter nor it's modules system. - A bunch of code previously owned by nvim-treesitter has been moved to this plugin and been refactored. - The user interface has changed in the following ways: - keymaps are no longer an option provided via the `setup` function. Users are expected to create them using `vim.keymap.set` - User commands have been removed for now. - Python dependant tests (consistency_tests) have been removed - Check #523 for more info
details: - This plugin no longer depends on nvim-treesitter nor it's modules system. - A bunch of code previously owned by nvim-treesitter has been moved to this plugin and been refactored. - The user interface has changed in the following ways: - keymaps are no longer an option provided via the `setup` function. Users are expected to create them using `vim.keymap.set` - User commands have been removed for now. - Python dependant tests (consistency_tests) have been removed - Check #523 for more info
details: - This plugin no longer depends on nvim-treesitter nor it's modules system. - A bunch of code previously owned by nvim-treesitter has been moved to this plugin and been refactored. - The user interface has changed in the following ways: - keymaps are no longer an option provided via the `setup` function. Users are expected to create them using `vim.keymap.set` - User commands have been removed for now. - Python dependant tests (consistency_tests) have been removed - Check #523 for more info
details: - This plugin no longer depends on nvim-treesitter nor it's modules system. - A bunch of code previously owned by nvim-treesitter has been moved to this plugin and been refactored. - The user interface has changed in the following ways: - keymaps are no longer an option provided via the `setup` function. Users are expected to create them using `vim.keymap.set` - User commands have been removed for now. - Python dependant tests (consistency_tests) have been removed - Check #523 for more info
details: - This plugin no longer depends on nvim-treesitter nor it's modules system. - A bunch of code previously owned by nvim-treesitter has been moved to this plugin and been refactored. - The user interface has changed in the following ways: - keymaps are no longer an option provided via the `setup` function. Users are expected to create them using `vim.keymap.set` - User commands have been removed for now. - Python dependant tests (consistency_tests) have been removed - Check nvim-treesitter#523 for more info
details: - This plugin no longer depends on nvim-treesitter nor it's modules system. - A bunch of code previously owned by nvim-treesitter has been moved to this plugin and been refactored. - The user interface has changed in the following ways: - keymaps are no longer an option provided via the `setup` function. Users are expected to create them using `vim.keymap.set` - User commands have been removed for now. - Python dependant tests (consistency_tests) have been removed - Check #523 for more info
details: - This plugin no longer depends on nvim-treesitter nor it's modules system. - A bunch of code previously owned by nvim-treesitter has been moved to this plugin and been refactored. - The user interface has changed in the following ways: - keymaps are no longer an option provided via the `setup` function. Users are expected to create them using `vim.keymap.set` - User commands have been removed for now. - Python dependant tests (consistency_tests) have been removed - Check #523 for more info
details: - This plugin no longer depends on nvim-treesitter nor it's modules system. - A bunch of code previously owned by nvim-treesitter has been moved to this plugin and been refactored. - The user interface has changed in the following ways: - keymaps are no longer an option provided via the `setup` function. Users are expected to create them using `vim.keymap.set` - User commands have been removed for now. - Python dependant tests (consistency_tests) have been removed - Check #523 for more info
details: - This plugin no longer depends on nvim-treesitter nor it's modules system. - A bunch of code previously owned by nvim-treesitter has been moved to this plugin and been refactored. - The user interface has changed in the following ways: - keymaps are no longer an option provided via the `setup` function. Users are expected to create them using `vim.keymap.set` - User commands have been removed for now. - Python dependant tests (consistency_tests) have been removed - Check nvim-treesitter#523 for more info
details: - This plugin no longer depends on nvim-treesitter nor it's modules system. - A bunch of code previously owned by nvim-treesitter has been moved to this plugin and been refactored. - The user interface has changed in the following ways: - keymaps are no longer an option provided via the `setup` function. Users are expected to create them using `vim.keymap.set` - User commands have been removed for now. - Python dependant tests (consistency_tests) have been removed - Check #523 for more info
details: - This plugin no longer depends on nvim-treesitter nor it's modules system. - A bunch of code previously owned by nvim-treesitter has been moved to this plugin and been refactored. - The user interface has changed in the following ways: - keymaps are no longer an option provided via the `setup` function. Users are expected to create them using `vim.keymap.set` - User commands have been removed for now. - Python dependant tests (consistency_tests) have been removed - Check #523 for more info
details: - This plugin no longer depends on nvim-treesitter nor it's modules system. - A bunch of code previously owned by nvim-treesitter has been moved to this plugin and been refactored. - The user interface has changed in the following ways: - keymaps are no longer an option provided via the `setup` function. Users are expected to create them using `vim.keymap.set` - User commands have been removed for now. - Python dependant tests (consistency_tests) have been removed - Check #523 for more info
details: - This plugin no longer depends on nvim-treesitter nor it's modules system. - A bunch of code previously owned by nvim-treesitter has been moved to this plugin and been refactored. - The user interface has changed in the following ways: - keymaps are no longer an option provided via the `setup` function. Users are expected to create them using `vim.keymap.set` - User commands have been removed for now. - Python dependant tests (consistency_tests) have been removed - Check #523 for more info
DONE:
main
branch@*.outer
captures)vim.keymap.set
directlymaster
branch)This addresses #503
Moved to a follow up PR (TODO)
some_exposed_func
while others have the formfunction() some_exposed_func() end
an
,in
textobject