vscode-diff icon indicating copy to clipboard operation
vscode-diff copied to clipboard

default left and right files/folders

Open Morriz opened this issue 2 years ago • 12 comments

Hi, can we provide defaults for left/right files and folders so that CMD+LL will open that immediately?

Morriz avatar Dec 21 '22 14:12 Morriz

Hi, cmd+l cmd+l has the current workspace as default for left. If you work with workspaces the first workspace is left and the second workspace is on the right. If you want to customize the paths you can use favorites which supports a placeholder ${workspaceFolder} or ${workspaceFolder:NAME} But there is no feature right now to customize a default path if you use the keyboard shortcut. For this case it is maybe a good idea to define a favorite as default.

L13 avatar Dec 21 '22 15:12 L13

How can we add favorites via cli then? No human should be needed until the window is opened with relevant diff

Morriz avatar Jan 03 '23 13:01 Morriz

I fought about the idea again and I think the best choice is to implement slots from 1 to 9 like in my other extension Projects. This makes it possible to access your most important comparison immediately. No ui, just by shortcut.

L13 avatar Jan 03 '23 16:01 L13

But it is for automation, not humans. I only want a dev to do what is necessary. And have preconfigured what they need to look at. It would therefor be awesome if we could deliver configuration via .vscode/settings.json that does that.

Morriz avatar Jan 06 '23 10:01 Morriz

Now I am really confused. The first post was about default paths, the second about cli, which vscode does not support for extensions and the third about the settings.json. Can you describe your use case, please?

L13 avatar Jan 06 '23 13:01 L13

just using code, the result should be:

defaults for left/right files and folders so that CMD+LL will open that immediately

I do not care how, but throughout our discourse I realized it is probably only possible through .vscode/settings.json

Morriz avatar Jan 06 '23 14:01 Morriz

So something like:

  "l13Diff.initialFavorites": [
    { "leftFolder": "${workspaceFolder}/bla", "rightFolder": "${workspaceFolder}/dida" }
  ]

Morriz avatar Jan 06 '23 14:01 Morriz

I'm still thinking about the use case for this feature and your suggestion for settings.json, because do you need workspace favorites which are stored in the local .vscode folder? So every project can have its own favorite comparisons. For this way it is maybe a better idea to have a new tab with workspace comparisons. You click on it and get immediately what you are looking for.

L13 avatar Jan 23 '23 07:01 L13

Our goal is to offer devs a link that opens vscode in the right location (side by side comparison view) to make decisions based on what they see immediately, without having to know or do anything to get there.

Morriz avatar Feb 10 '23 14:02 Morriz

I suggested the idea for a new CLI command to the VS Code team. For example:

code --command "l13Diff.action.panel.openAndCompare" --args "/path/to/folder-a" "/path/to/folder-b"

https://github.com/microsoft/vscode/issues/174082

I think this is a better solution. I recommend to upvote the issue on the vscode repository.

L13 avatar Feb 10 '23 17:02 L13

Great idea! Can you share a link?

Morriz avatar Feb 24 '23 08:02 Morriz

I figured out that somebody still opened the same issue like I mentioned in the comment before. You can find it here

https://github.com/microsoft/vscode/issues/105487

L13 avatar Feb 24 '23 12:02 L13