Vscode: workbench.action.files.copyPathOfActiveFile is missing in 1.20

Created on 12 Jan 2018  路  23Comments  路  Source: microsoft/vscode

It's in 1.19 but is gone in 1.20, this is the old keybinding:

{ "key": "cmd+k p",               "command": "workbench.action.files.copyPathOfActiveFile" },

If the command was replaced with something we should add this keybinding back.

bug candidate file-explorer verified

All 23 comments

@isidorn maybe a regression from your commands work?

Same as workbench.action.files.revealActiveFileInWindows
The workbench.action.files.copyPathOfActiveFile is a duplication of copyFilePath command. I will continue supporting workbench.action.files.copyPathOfActiveFile for January and will drop it in february. I have documented this in the release notes.

@Tyriar thanks for finding this. I will now go through other commands to verify I did not remove more accidentely

Ok here are more things which I accidentely removed
workbench.action.files.newFile
workbench.action.files.newFolder
workbench.action.files.saveFiles -> duplication of workbench.action.files.saveAllFiles This one I will also completely drop in february

Edit: actually the first two have been deprecated by ben already in the past, now I just killed them for good. Will still update the docs for the saveFiles one.

Edit2: @bpasero maybe I leave both save commands since maybe a lot of users use them. If we keep one which one to keep. What do you think?

Edit3: will keep both saveFiles and saveAllFiles

@bpasero I have now transitioned the newly introduced ids to be short and elegant. The last commit captures that. All of these ids were not present in vscode before so we can name them as we want

@isidorn I am not seeing any command with the ID workbench.action.files.saveAllFiles?

@isidorn the original intent as far as I remember was to have an action that would save all files, but not untitled. As such, the save all action is not a replacement to that as it would popup a dialog asking where to save untitled files. So we should still have 2 actions, one for saving all (untitled and files) and one for files only.

@bpasero all is good know. We will have those two different
saveAll new one (previously was not exposed)
and workbench.action.files.saveFiles the old one which I brought back.

Oke

I have now transitioned the newly introduced ids to be short and elegant.

Is it just me that preferred the longer command names and found the short ones to be messy? Also Make sure that the keybindings are moved over to whichever one we're keeping as I rely on the defaults for that (so I'm sure others would).

@Tyriar we are not changing any command names, just the newly introduced ones will be short.

just the newly introduced ones will be short

@isidorn the long namespaced commands are good though, if we don't use namespaces going forward it's going the list of commands is going to be a mess.

@Tyriar we already have some in stable which are short. For me personally one namespace makes sense, 3 are just too much and most of them are bogus. Like why have workbench.action.files.copy when it should just be files.copy

Though it is up to each command author to choose what to do, currently we do not have a vscode wide convention

@isidorn

The workbench.action.files.copyPathOfActiveFile is a duplication of copyFilePath command. I will continue supporting workbench.action.files.copyPathOfActiveFile for January and will drop it in february.

They are not duplicates. The current copyPathOfActiveFile copies active editor's file path, whereas copyFilePath copies the active file on explorer.

In cases where explorer.autoReveal is false, or workbench.list.openMode is doubleClick, the active file on explorer can be different than the one open in active editor.

@octref you are correct. However I question how many users are relying on this behavior. I would bet not many, but I might be wrong.

@isidorn didn't @bpasero add a bunch of keybindings to help users navigating the explorer? I think the following wouldn't work anymore:

  • ctrl+shift+e
  • down x times to some file
  • copy file's path command

I think the only way to do this now is via the context menu key if it's available and selecting Copy Path.

@Tyriar @isidorn yeah makes sense, I think we need to revive that command to not cause a regression.

@bpasero the command workbench.action.files.copyPathOfActiveFile does not need reviving, since I never removed it.
I just planned to remove it in Febraury but will not do that now.

Closing as this works nicely in insiders.
@bpasero @Tyriar please reopen if you see otherwise

Ok the issue is that the command now first looks at the explorer and only then at the active file. So reopening to change that.
Not sure what would be the optimal behavior if there is no open file? No op then?

I have brought back the old behavior.

  • workbench.action.files.copyPathOfActiveFile copies the path of the active file, if there is no editor active this command is a no op
  • copyFilePath looks at what is focused in the explorer / open editors as it did before

Apart from this I aslo noticed a simliar issue with workbench.action.files.revealActiveFileInWindows and revealFileInOS so I also tackled that in this commit.

  • revealFileInOS works on explorer / open editors specifc context
  • workbench.action.files.revealActiveFileInWindows looks at the active editor

@bpasero can you please review / verify once the new builds are out. I have cherry picked this on top of the release branch

Verified and reviewed (out of sources). 馃憤

@isidorn the keybinding cmd/ctrl+k, p is no longer attached to the command. I would probably report an issue about this if I was a regular user and it stopped working in stable.

@Tyriar that's a great catch.
I have brought back the missing keybindings and I have also cherry-picked this on top of the release branch.
I have also went through all the commands and made sure that none of the keybindings have been broken compared to stable.
Verifier: also verify that all default keybindings are still present. This is easiest to verify by having stable and insider running side by side and checking keyboard shorcuts searching for 'files.'

Double verified, I have my keybinding back 馃槃 馃帀

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shanalikhan picture shanalikhan  路  3Comments

sirius1024 picture sirius1024  路  3Comments

villiv picture villiv  路  3Comments

ryan-wong picture ryan-wong  路  3Comments

biij5698 picture biij5698  路  3Comments