Skip to content
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

Merged
merged 4 commits into from
Jun 18, 2021

Conversation

mattseddon
Copy link
Member

@mattseddon mattseddon commented Jun 18, 2021

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.

@mattseddon mattseddon added the product PR that affects product label Jun 18, 2021
@mattseddon mattseddon self-assigned this Jun 18, 2021
@mattseddon mattseddon force-pushed the copy-file-path-command branch from 788312e to bcdd078 Compare June 18, 2021 05:42
export const reRegisterVsCodeCommands = (disposer: Disposer) => {
disposer.track(
commands.registerCommand('dvc.copyFilePath', path =>
commands.executeCommand('copyFilePath', Uri.file(path))
Copy link
Member Author

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.

@mattseddon mattseddon marked this pull request as ready for review June 18, 2021 05:50
@mattseddon mattseddon requested a review from rogermparent June 18, 2021 05:50
@@ -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
Copy link
Member Author

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)
Copy link
Member Author

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.... 🤯

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is wild

@rogermparent rogermparent enabled auto-merge (squash) June 18, 2021 14:53
@codeclimate
Copy link

codeclimate bot commented Jun 18, 2021

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.

@rogermparent rogermparent merged commit 9a80c7f into master Jun 18, 2021
@rogermparent rogermparent deleted the copy-file-path-command branch June 18, 2021 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR that affects product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants