-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add copy file path action to Tracked Explorer Tree #570
Conversation
788312e
to
bcdd078
Compare
export const reRegisterVsCodeCommands = (disposer: Disposer) => { | ||
disposer.track( | ||
commands.registerCommand('dvc.copyFilePath', path => | ||
commands.executeCommand('copyFilePath', Uri.file(path)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[F] I tried to simply reference this in our package json and it could not be found so looks like we need to wrap it.
@@ -50,6 +50,11 @@ suite('Extension Test Suite', () => { | |||
}) | |||
|
|||
describe('TrackedExplorerTree', () => { | |||
it('should be able to run dvc.copyFilePath without error', async () => { | |||
expect(await commands.executeCommand('dvc.copyFilePath', dvcDemoPath)).not | |||
.to.Throw |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[F] The original command returns undefined and I have not one single idea of how get to something off the clipboard and into this test 😢
await commands.executeCommand('workbench.action.files.newUntitledFile') | ||
await commands.executeCommand('editor.action.clipboardPasteAction') | ||
|
||
expect(window.activeTextEditor?.document.getText()).to.equal(dvcDemoPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#570 (comment) and 40 minutes later we have this.... 🤯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is wild
Code Climate has analyzed commit a61a981 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (85% is the threshold). This pull request will bring the total coverage in the repository to 90.8% (0.0% change). View more on Code Climate. |
Starts to address #569.
Adds Copy Path to the tracked explorer tree context menu, whilst keeping it hidden from the command palette.
Demo:
Screen.Recording.2021-06-18.at.3.47.07.pm.mov
If we're happy with the code structure / approach then I'll start rolling on this feature.