microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
160.95k stars 28.24k forks source link

Support "perspectives" like approach in VSCode #95182

Open LucaGabi opened 4 years ago

LucaGabi commented 4 years ago

What is a Perspective? https://www.tutorialspoint.com/eclipse/eclipse_perspectives.htm https://www.eclipse.org/articles/using-perspectives/PerspectiveArticle.html

Considering large projects with different components (backend, frontend projects with mix of languages) a feature similar to Eclipse IDE "perspectives" would be very useful to easy switch between the projects or scope to a section of the current project. To switch between the perspectives, a ui similar to open recent (Ctrl-R) project could be used and triggered with a shortcut (Ctrl-9). The icon in each entry can show the project's main technology (angular, c#, etc).

In the File Explorer (VSCode's Tab) a new context menu option "Create Perspective" is used to add perspectives based on a folder.

In the Sidebar a new item can be added named "Perspectives" that can list the existing perspectives with a highlight on the active one. A color can be used in the ui sidebar item or a status bar indicator similar to "Open Remote Window" with the name of the current perspective, at click will open Ctrl-9 ui mentioned above.

(Each perspective can have a picked color like in peakoc.)

If accepted this feature can extend the functions that are now present in the "remote connect" feature and maybe not generating another item in the status bar.

image

Benefits:

MayTheSForceBeWithYou commented 3 years ago

tbh, for the time being I just want a perspective so that when I'm using the terminal within VS Code I can switch to something without a directory tree, editor, etc. and just focus on the terminal. 🤷‍♂️

munael commented 3 years ago

@MayTheSForceBeWithYou , that one's at least maybe doable. Maybe something like:

    {
        "key": "alt+j",
        "command": [
            "workbench.action.terminal.focus",
            "workbench.action.closeSidebar",
            "workbench.action.toggleMaximizedPanel",
        ]
    }

You'll need some "when" conditions to make the toggling work. The maximization might be forever botched though. Not sure.

chaoky commented 3 years ago

this is the only thing that keeps me from switching from emacs

LucaGabi commented 1 year ago

I wonder if this will ever be implemented .. Anyway vscode is the best code editor.

gjsjohnmurray commented 1 year ago

@LucaGabi see https://code.visualstudio.com/updates/v1_69#_settings-profiles

sandipchitale commented 1 year ago

This is good news. I look forward to this - especially the layout of views, etc.

I will request additional features i.e. allow switching to a suitable layout based on events. For example, I want to have to debugging focused layout of views. At least the user should get a chance to opt into this aspect.

mikkorantalainen commented 1 year ago

I see that multiple profiles are supported but that would require keeping all the keyboard shortcuts and other settings in sync between multiple profiles.

The whole point of Eclipse Perspectives features is to only keep list of open views and their sizes in a single Perspective. The most important Perspectives that I'm using in Eclipse is main editor layout and debug layout which has a lot less space for the main editor area and lots of space for the variables and stack.

Eclipse also allows differentiating between current Perspective layout vs saved layout and you can drag panel edges to resize views e.g. while debugging some specific bug and want to have slightly bigger editor area or variable panel and then right click the Perspective tab and select Reset to restore the last Saved state of that Perspective. (The context menu for a Perspective should contain actions "Save", "Reset (restore last saved state)", "Save as new layout" and "Delete layout".) If one adjusts panels in a single perspective and closes the UI, the last adjusted state should be remembered after restart. In practice, that means that there's one unnamed save state for each Perspective which is automatically saved but will be overwritten without a warning when Reset action is used. And Save action simply overwrites the previous saved state with the current state of that named Perspective.

Eclipse also supports automatically switching to named Perspective when given debug configuration is launched but I don't think that's an important feature to support as long as creating and saving Perspectives is easy enough.

And I would like to add that Perspectives is not a great name for this. I think something more descriptive like "Saved editor layouts" or "Editor layout" would be better. The important part is that this is only about reconfiguring layout and opening/closing views and all the other behavior of the whole VS Code interface should stay identical.

In case you haven't seen this feature, it looks like this in Eclipse: image

And I honestly think that even the add new button is not needed because one could simply right click of the existing layouts and select Save as. The add new button simply allows selecting from a list of factory default layouts such as Debug, Web, XML, Resource, Team Planning, etc.

The blue label to the right of these buttons is Eclipse Mylyn feature which I hope VS Code also copies one day...

LucaGabi commented 1 year ago

:( sad ...

thefasquelle commented 1 month ago

a debug and edit perspectives would be much appreciated

grloch commented 3 weeks ago

I would like very much of something like that for when I unplug a monitor from my notebook, so I could use a layout that make sense in the smaller screen.

For example, in my case my notebook has a 14" screen and i have a 29" monitor, quite different.