vscode-nested-tags icon indicating copy to clipboard operation
vscode-nested-tags copied to clipboard

Feature request: Go to tag references

Open blakedietz opened this issue 6 years ago • 8 comments

From clicking on the file, go to each of the occurrences of a tag in the file.

blakedietz avatar Feb 04 '19 22:02 blakedietz

Move cursor to the line of occurrence is still desired.

I use this extension to organize code in a large project. Sometime I'll put two tags in one file, so if the click can bring me to the line, it's gonna be perfect.

tiejunhu avatar Dec 12 '19 03:12 tiejunhu

I did some research, it looks like we need a custom command rather than "vscode.open", remember the line number during searching for tags and reveal the line in the custom command.

A reference implementation can be found in the TODO tree extension here: https://github.com/Gruntfuggly/todo-tree/blob/master/extension.js#L877

tiejunhu avatar Dec 12 '19 04:12 tiejunhu

I use this extension to organize code in a large project. Sometime I'll put two tags in one file, so if the click can bring me to the line, it's gonna be perfect.

Dude, that's awesome. I'd be curious to hear about your use case at some point. Maybe we could chat on the phone or do a screen share for 15 minutes whenever you're free.

@oldhu I've been feeling similarly as well. My navigation has been suffering because of this feature not being available. I've just started a new position so I'm putting more energy into that right now, but once things settle I would be more than willing to implement this myself.

If you'd entertain submitting a pr I would also support that. I'll read through some of the examples you posted this weekend and post a high level outline on what would need to be done.

blakedietz avatar Dec 13 '19 17:12 blakedietz

Is this feature still being considered? Being able to jump to the line with the tag would make this 100% perfect!

dustinsterk avatar Apr 07 '20 04:04 dustinsterk

I would love to at some point. I've just been busy with work recently. If you have a pull request, I would be more than willing to take a look at it. I think this would really increase the usability of the extension.

blakedietz avatar Apr 10 '20 02:04 blakedietz

I have a POC that I will submit, it is not production worthy yet as it does not handle YAML headers (I had to rework that section) and it also does not always jump to the line when it is opening a new file. I find double clicking works but not sure why I need to click twice on the file name.

dustinsterk avatar Apr 14 '20 00:04 dustinsterk

You can see from the pull request the proposed changes, I am essentially adding the LineNum(X) in the tree right before the filename. I tried a few different UX's and this one seems to work the best. A better approach maybe to add the additional processing of a new type of tag - for example "@@" that could simplify the change and only add this functionality of infile tagging/jumping to line.

dustinsterk avatar Apr 14 '20 01:04 dustinsterk

Awesome! I’ll take a peek at the pr!

blakedietz avatar Apr 14 '20 06:04 blakedietz