Sertion / vscode-gitblame

Visual Studio Code Extension - See Git Blame info in status bar.
https://marketplace.visualstudio.com/items/waderyan.gitblame
MIT License
79 stars 32 forks source link

Add "Copy URL" button as well as just "view" #47

Closed tombusby closed 5 years ago

tombusby commented 5 years ago

I use separate browsers for general browsing and for work-related stuff. (It helps with managing logins and other extension config things).

When I do a git blame, the extension only gives me the option to "view" which opens a new (default) browser window.

It would be better if there was a button to "Copy URL" (or an option in the config to change "View" to this). Currently I have to "view", copy the URL from the address bar, open a new tab in the other browser, paste the URL, then close the default browser window. It's pretty cumbersome.

There are a number of cases where it's preferable to just copy the URL to clipboard rather than open a browser tab.

If I get chance to, I'll implement this myself. But, as it stands, I don't really know anything about VSCode's extension API.

Sertion commented 5 years ago

Hey Tom!

Thank you for the feature request. It sounds like a great idea!

If you want to look into doing a pull request know that dealing with the clipboard is not supported by the VSCode API and we will need to use something like node-copy-paste (and its types).

tombusby commented 5 years ago

Cool, I'll bear this in mind. I don't know when I'll have the chance to take a look, bit I'll try to get round to it soon.

Sertion commented 5 years ago

Did some digging in the VSCode API and it looks like there is a Clipboard object that was added in a recent version.

Sertion commented 5 years ago

I have started working on this and it will be in the next version. No planned date for release yet.

Sertion commented 5 years ago

I implemented it a bit different than suggested:

I have added two new commands that can be bound to keyboard shortcuts or executed from the command panel. One will copy the tool URL to the clipboard and the other will copy the git commit hash to the clipboard.

I hope to release it tomorrow (2019-03-17).

Sertion commented 5 years ago

This was released today in version 2.7.0.