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

Workspace API #826

Closed
titoBouzout opened this issue Apr 26, 2015 · 7 comments
Closed

Workspace API #826

titoBouzout opened this issue Apr 26, 2015 · 7 comments

Comments

@titoBouzout
Copy link
Collaborator

http://www.sublimetext.com/forum/viewtopic.php?f=6&t=18169

Is there an api to get the path of the current .sublime-workspace file?
Is there an api to delete a .sublime-workspace file?
Is there an api to load a .sublime-workspace file?
Is there an api to "Save Workspace As..."?
Is there an api to "Quick Switch Workspace"?
Is there an api to list available Quick Switch Workspaces?

@mattst
Copy link

mattst commented Oct 24, 2016

I'd like to be able to get a Sublime Text 3 window's active .sublime-workspace file too.

Currently there is no way to anticipate a Sublime Text 3 window's title bar since the workspace name is used on it. Usually that's the same as the project name but if the project has >1 workspaces then it's not and there's no way to get the workspace filename.

@wbond
Copy link
Member

wbond commented Sep 20, 2019

Is there an api to get the path of the current .sublime-workspace file?

Not currently.

Is there an api to delete a .sublime-workspace file?

No, the file can just be delete from disk. If the user wishes to remove all recent project/workspace files they can execute clear_recent_projects_and_workspaces. There is no way to remove an individual entry.

Is there an api to load a .sublime-workspace file?

There are three commands:

  • prompt_open_project_or_workspace replaces the existing project/workspace
  • prompt_switch_project_or_workspace opens the project/workspace in a new window
  • prompt_select_workspace uses the Quick Switch Project

Is there an api to "Save Workspace As..."?

No, there is a command: save_workspace_as.

Is there an api to "Quick Switch Workspace"?

No, there is a command: prompt_select_workspace.

Is there an api to list available Quick Switch Workspaces?

No.

@FichteFoll
Copy link
Collaborator

Given the nature of this issue, it's hard to see a particular request or use case for the questions, making believe this is more of a support nature than a feature request. Most referenced issues are also concerned of the resulting window title moreso than the workspace file itself.

I think a function to retrieve the current workspace file like window.project_file_name() is reasonable, but beyond that this issue has been mostly answered above.

@wbond wbond added this to the next dev cycle milestone Oct 4, 2019
@stephenll
Copy link

t I think asking for an API for these items is to avoid being prompted. I couldn't find a way to load a workspace/project via python without being prompted. My intention is to have 4 or so hot keys that I can easily switch between workspaces/projects.

@wbond
Copy link
Member

wbond commented Nov 15, 2019

A command for this will be available in the next dev cycle

@ratijas
Copy link

ratijas commented Dec 1, 2020

Is this issue still relevant?

@BenjaminSchaaf
Copy link
Member

Window.workspace_file_name was added in Sublime Text 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants