r3inbowari / go-mod-explorer

Go Module Explorer for Visual Studio Code (beta)
https://marketplace.visualstudio.com/items?itemName=r3inbowari.gomodexplorer
MIT License
33 stars 6 forks source link

Catch the `workbench.files.action.showActiveFileInExplorer` to point in Go Mod Explorer #61

Closed pasquale95 closed 1 year ago

pasquale95 commented 1 year ago

Hi, thanks for the beautiful extension! I open this issue to understand if this functionality is already available or can be added. Basically, if I have the file opened in VSCode and I want to move back to the project explorer, how can I do it? In VSCode there's the command workbench.files.action.showActiveFileInExplorer which allows to point to the opened file inside the project explorer. However, when I perform such operation on a file belonging to a Go external lib, I'm not redirected inside the Go Mod Explorer, but in the Open Editors section. Is there a way (or a condition) I could use to redirect the action to show the file inside the Go Mod Explorer?

r3inbowari commented 1 year ago

Hi, @pasquale95, Right, I will see whether we can do it this weekend.

r3inbowari commented 1 year ago

As you see here, the build-in method ShowActiveFileInExplorer is implemented in vscode snippet1: REVEAL_IN_EXPLORER command and snippet2: Action. They specify two branches, the object is either opened in the workspace view or in the editor view. We have no way to reuse this method to perform reveal operations in Go Mod Explorer view. Because when we have the same keybinding , only one to be executed correctly.

So, we should create a new different keybinding for it, @pasquale95, what do you think? Ctrl(⌘) + Shift + " or?

pasquale95 commented 1 year ago

I think we should just give create a new action and give people the possibility to choose which keybinding to associate with. As a predefined one, yours would be okay.

r3inbowari commented 1 year ago

Hi, @pasquale95. I think this issue has been resolved, Please upgrade to v0.3.15. How to reveal

r3inbowari commented 1 year ago

Also I noticed the fork by @vsr625, this feature(reveal without focusing) is also supported now. image

Thanks for pointing out.