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

Support "perspectives" like approach in VSCode #95182

Open
LucaGabi opened this issue Apr 14, 2020 · 10 comments
Open

Support "perspectives" like approach in VSCode #95182

LucaGabi opened this issue Apr 14, 2020 · 10 comments
Labels
feature-request Request for new features or functionality layout General VS Code workbench layout issues
Milestone

Comments

@LucaGabi
Copy link

LucaGabi commented Apr 14, 2020

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:

  • large projects can be easier managed on each component (eg: backend perspective, web app perspective, mobile app perspective)
  • scope to section in same project / perspective with "Create Perspective"
  • keeps the same window but switches the workspace (no alt-tab jumps)
  • keeps the same simple/clean layout (no need for multiple sidebars clutter)
@MayTheSForceBeWithYou
Copy link

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
Copy link

munael commented Sep 27, 2020

@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
Copy link

chaoky commented Jan 26, 2021

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

@LucaGabi
Copy link
Author

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

@gjsjohnmurray
Copy link
Contributor

@sandipchitale
Copy link

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
Copy link

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

:( sad ...

@thefasquelle
Copy link

a debug and edit perspectives would be much appreciated

@grloch
Copy link

grloch commented Jun 30, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality layout General VS Code workbench layout issues
Projects
None yet
Development

No branches or pull requests

11 participants