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

[FEATURE] - Suggest to open .code-workspace when opening projects that contains workspaces in its root #617

Open
alefragnani opened this issue Jun 29, 2022 · 7 comments

Comments

@alefragnani
Copy link
Owner

  1. And again, as you understood correctly, the auto-opening of a workspace whenever a folder containing one was opened. I would love to see this as a feature of this plugin as I think this is a good fit but I could also imagine creating a vscode-issue (though i have no big hopes of getting that through soon). And the restriction you mentioned, that this only works if a folder is opened through the extension, is perfectly fine for me as I open all my projects with your extension only.

Originally posted by @wottpal in #334 (comment)

@D35
Copy link

D35 commented Aug 15, 2022

I have found that editing the project.json file and providing the folder and the name of the ".code-workspace" file name in the "rootPath" works well. But this does not seem to be covered in the documentation.

I did not find any documentation for the project.json "Paths" setting either.

@wottpal
Copy link

wottpal commented Aug 15, 2022

Thanks for the heads up, @D35. Unfortunately, I'm not using the manual project.json but the automatic detection instead. So I guess this would not work in my case.

@alefragnani
Copy link
Owner Author

@D35 , thanks for helping, but @wottpal scenario is a bit different. He wants VS Code to suggest opening the .code-workspace, when you open a regular folder.

BTW, the support to .code-workspace is documented in extension’s readme, as the Save Project command describe to support folders and workspaces. Ok, maybe it is not explicit that it means a .code-workspace file, but I try to follow VS Code descriptions as much as possible.

If you think the documentation could be improved somehow, please open a new issue or add some comments to #394, which was opened requesting a Tutorial to the extension.

I’m also planning a Walkthrough #517, which should be available in upcoming releases

Hope this helps

@Natetronn
Copy link

Natetronn commented Feb 15, 2023

I just hit this issue and was about to make a feature request to open workspace if a .code-workspace is present, else open folder (as is the current default.) When opening a project from my favorites of this extension, I currently see the following message:

workspace

I'd like for it to just open the workspace directly and not ask me (I'm assuming this message is a vscode (proper) message.)

The great thing about workspaces is that any previously opened files, either saved or unsaved, are opened as well and our files/folder tree is in a state where we left it. With that, we're able to continue from where we left off with ease. Opening a folder, on the other hand, has no history.

Anyway, I didn't see this option in the extensions Settings when I check for one, but I'll take a look at the readme and see if I can get it to use the workspace instead.

ETA

Okay, according to the readme, if you open a workspace and Save Project it will save it as a workspace. If you open the project as a folder, it will save it as a folder. I opened the project using the list of git repos, the ones that are listed in this extension below favorites and that's how I ended up having a folder open and not a workspace (not how I would normally open a project, but I was using the extension.)

Anyway, I guess that would be a different features request i.e. open git repos as workspace if project has a .code.workspace file or if is a project that has a rootPath that points to a .code.workspace, else open as folder.

@wottpal
Copy link

wottpal commented Feb 15, 2023

Hey @Natetronn, as I had the exact same need, I developed a small plugin to do exactly this: https://marketplace.visualstudio.com/items?itemName=zoma.vscode-auto-open-workspace

Please also see this discussion for reference.

@Natetronn
Copy link

Natetronn commented Feb 15, 2023

Hey @Natetronn, as I had the exact same need, I developed a small plugin to do exactly this: https://marketplace.visualstudio.com/items?itemName=zoma.vscode-auto-open-workspace

Please also see this discussion for reference.

@wottpal thanks for sharing! I gave it a try on two projects. One project's workspace was found and the other was not, even though both had a workspace file in root of the project. I'm not sure the difference or why one worked and the other didn't, but, either way, maybe we should take this conversation to auto-open-workspace at this point, since it's probably slightly off topic now. Shall I open an issue on your repo?

@wottpal
Copy link

wottpal commented Feb 15, 2023

@Natetronn yes, please do so :)

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

No branches or pull requests

4 participants