StarlaneStudios / vscode-comment-anchors

⚓A Visual Studio Code extension that adds support for comment anchors 🔭
https://marketplace.visualstudio.com/items?itemName=ExodiusStudios.comment-anchors
MIT License
206 stars 32 forks source link

[feat-req] Allow navigating via command palette (keyboard navigation) #157

Closed jd-solanki closed 1 year ago

jd-solanki commented 2 years ago

I really love how this extension grew since I started using it ❤️

Once more feature request came to mind recently was navigating via command palette instead of panel.

Why?

Recently, I suggested this extension to one of my friends and he told me that is it possible to navigate between anchors using a command palette because he had lots of anchors in a single PHP file and find it in a long list of anchors wasn't efficient for him.

It will be a great productivity boost to allow searching and navigating through keyboard shortcuts (command palette)

I suggested him using SECTION for long list but still keyboard navigation is better

Thanks for this awesome extension.

macjuul commented 1 year ago

Thanks for the suggestion! While I don't currently have the resources to implement this right now, I'll leave this issue open in case anyone is willing to submit a PR for this functionality.

macjuul commented 1 year ago

Actually, I decided to look into this myself and have implemented it 🙂

Closing the issue as it does appear to be a duplicate of #27 and has now been implemented.

jd-solanki commented 1 year ago

Hi @macjuul

Thanks for providing keyboard navigation ❤️

However,

  1. It breaks the duplicating line in mac (maybe only I have configured it or this is for all mac users) - Duplicating the line via shift + option + up/down is not working anymore with the latest release of this extension.
  2. This issue is regarding searching the comment anchor and navigating it.

For 2, Assume you have 15 anchors and anchor desc/name is the function name. I am at 1st anchor and the function I want to navigate to is at 13 and I know the anchor's name. With the current implementation, I need 10+ keystrokes to get there.

It will be time-saving if we introduce a command pellet to search and navigate to that anchor.

Thanks.

macjuul commented 1 year ago

I can look into changing the default keybinds (you can manually change them for now). I was thinking of something along the lines of Alt + Page up/Page down, any thoughts on that?

As for your second point, I'll see if I can find an effective way to implement full command based navigation using the APIs exposed by vscode.

macjuul commented 1 year ago

Quick navigation will be available in the next release.

image

EDIT: version 1.10.1 has been released

jd-solanki commented 1 year ago

Awesome ❤️

You are so quick at it 🏃🏻

Thanks :)