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

navigator: add new command 'copy relative path' #8092

Merged
merged 2 commits into from
Jul 2, 2020

Conversation

vince-fugnitto
Copy link
Member

@vince-fugnitto vince-fugnitto commented Jun 25, 2020

What it does

Fixes: #5937
Closes: #5964

The following commit implements the 'Copy Relative Path' command (accessible through the explorer's context-menu).

  • The command copies the relative paths (according to their respective roots) to the user's clipboard.
  • The command supports both single and multiple-root workspaces.
  • The copyRelativeFilePath command is also exposed to the plugin system.

How to test

  1. select a single resource in the explorer, trigger the context-menu and select 'copy relative path'
    (it should be added to the clipboard)
  2. repeat step 1 with multiple resources
  3. repeat step 1 and 2 with a multiple-root workspace

Review checklist

Reminder for reviewers

Signed-off-by: vince-fugnitto [email protected]

- adds the `copy relative path` command.

Signed-off-by: vince-fugnitto <[email protected]>
Co-authored-by: fangnx <[email protected]>
@vince-fugnitto vince-fugnitto added navigator issues related to the navigator/explorer commands issues related to application commands labels Jun 25, 2020
@vince-fugnitto vince-fugnitto self-assigned this Jun 25, 2020
- exposes the command `copyRelativeFilePath` to the plugin system.

Signed-off-by: vince-fugnitto <[email protected]>
@vince-fugnitto vince-fugnitto force-pushed the vf/copy-relative-file-path branch from 68b44b3 to 7b8ceaf Compare June 26, 2020 14:19
Copy link
Contributor

@Anasshahidd21 Anasshahidd21 left a comment

Choose a reason for hiding this comment

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

#1: packages/core/src/browser/color-application-contribution.ts

#2: packages/core/src/browser/browser.ts
    packages/core/src/browser/clipboard-service.ts
    packages/core/src/browser/color-application-contribution.ts

#3: Untitled/Untitled.txt (single selection)
#3: lerna.json
    newtest123456.txt 
   (multiple selection)

Based on the use cases mentioned, it works well for me. #3 is based on the fact that the files are present in the root.

I also tried to Copy Relative Path with the keybindings, and it seems to work as mentioned.
An example for copying with the keybindings packages/debug/src/browser/debug-frontend-module.ts

Tested on Windows && Theia Browser

@vince-fugnitto vince-fugnitto requested a review from lmcbout June 29, 2020 13:09
@kittaakos kittaakos self-requested a review July 1, 2020 14:54
Copy link
Contributor

@kittaakos kittaakos left a comment

Choose a reason for hiding this comment

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

I am approving it, it works as expected. 👍 The URI to Path conversion is conceptually wrong for Windows users.

@vince-fugnitto vince-fugnitto merged commit e23180f into master Jul 2, 2020
@vince-fugnitto vince-fugnitto deleted the vf/copy-relative-file-path branch July 2, 2020 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commands issues related to application commands navigator issues related to the navigator/explorer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[core] add Copy (Relative) Path to the tab's context menu
3 participants