-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Feature Suggestion: Hints for objects *outside* nodes containing the cursor #33
Comments
all nodes sounds like it would clutter up the screen quite a lot. playing with hop.nvim with some custom lua for using treesitter queries I am finding the screen gets very busy very quickly. you would have to be very careful about which nodes you show hints for. |
I'm not saying hopping to other nodes other than the immediately containing nodes isn't useful, although it probably is more the responsibility of hop.nvim or an extension of hop.nvim (which treehopper uses for the moving btw). I'm saying if you simply add hints for every single treesitter node there will be so many labels (and most will end up needing 2 key presses that the entire screen is covered in labels. So you need to be smart about how you choose the nodes to add targets. It's not about how many lines up or down (although that affects slightly based on how many targets will require 2 keypresses) but about the density of nodes. Remember the treesitter tree is a very detailed and information dense CST, almost every token is a node, and then those nodes are contained by other nodes, etc. Look at :TSPlayground.
I've been playing around with a hop.nvim extension (you can check out my account) for navigating based on treesitter and it's non obvious which nodes should be hop targets and which shouldn't. Unless selection, the main original point of treehopper, where all containing nodes works well.
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: pseudometa ***@***.***>
Sent: Monday, April 3, 2023 7:18:18 PM
To: mfussenegger/nvim-treehopper ***@***.***>
Cc: Anshuman MEDHI ***@***.***>; Comment ***@***.***>
Subject: Re: [mfussenegger/nvim-treehopper] Feature Suggestion: Hints for objects *outside* nodes containing the cursor (Issue #33)
all nodes sounds like it would clutter up the screen quite a lot.
that does depend on your window size, which true, isn't that big for me most of the time. One could also restrict this to x lines below or above the cursor maybe?
________________________________
Nevertheless, I made this to illustrate my point:
treehopper offers me hints to jump inside the current node (red), which isn't all to helpful here sind I can already reach various parts of this node via ii, ia, ac etc pretty easily.
What isn't quickly to reach are locations in neighboring nodes (blue) – but for those, treehopper does not offer hints.
[CleanShot 2023-04-03 at 13 14 ***@***.***<https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F73286100%2F229494021-198d1531-7bc4-4c18-b57e-cedabd449fe4.png&data=05%7C01%7Camedhi%40connect.ust.hk%7C5e4cd815ab794bad75f108db343521b2%7C6c1d415239d044ca88d9b8d6ddca0708%7C1%7C0%7C638161175028526123%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=C2G1x0sAarTrKAbtQAxsoBtgKi%2Bf%2B7XtspPCmSXeyrY%3D&reserved=0>
—
Reply to this email directly, view it on GitHub<https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmfussenegger%2Fnvim-treehopper%2Fissues%2F33%23issuecomment-1494138242&data=05%7C01%7Camedhi%40connect.ust.hk%7C5e4cd815ab794bad75f108db343521b2%7C6c1d415239d044ca88d9b8d6ddca0708%7C1%7C0%7C638161175028526123%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=GIYdPpWP667U80DZc1VY7xzaea%2FK%2FfRhnHVUeR2y50M%3D&reserved=0>, or unsubscribe<https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABNUNQICHR25OD2Q23YGUCDW7KWXVANCNFSM6AAAAAAWPT6BKU&data=05%7C01%7Camedhi%40connect.ust.hk%7C5e4cd815ab794bad75f108db343521b2%7C6c1d415239d044ca88d9b8d6ddca0708%7C1%7C0%7C638161175028682367%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2Fh%2FOazcEOpsBpO3oF2%2BqOHciDmt6iArZIOuPY0%2B2Dn8%3D&reserved=0>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I just stumbled upon this plugin and I must say, I find it's concept very intriguing.
Having played around with it for a bit, I noticed that this plugin restricts the hints and therefore actionable area to nodes containing the cursor. When in a big, deeply nested node like in the demo in the readme, that makes sense, but when in areas with a long sequence of non-nested nodes like an array, this makes the plugin rather unuseful:
So my idea is to introduce options to change the area actionable (= getting hints) from the plugin:
The text was updated successfully, but these errors were encountered: