Nykredit / openshift-test

testing the devspace env.
0 stars 2 forks source link

RH-settings-forgetting-where-you-left. #1

Open APINYK opened 9 months ago

APINYK commented 9 months ago

https://github.com/Nykredit/openshift_test/assets/127222595/a83da840-74c5-449c-af04-d0d8b2dae485

vitaliy-guliy commented 9 months ago

I explained my thoughts in this video https://www.youtube.com/watch?v=Gx3e_edmwOY And prepared a pull request to this repository that demonstrates a workaround. Please let me know if it works for you and do not hesitate to ask for any help.

APINYK commented 9 months ago

Thank you very much @vitaliy-guliy - Very helpfull! I will test if I can replicate your findings asap!

APINYK commented 9 months ago

@vitaliy-guliy the workaround seems to work on my side and all extensions seem to discover the new settings in .code-workspace. Hope you will be looking into fixing the issue in the future (about forgetting) to make the behavior more consistent accros platforms. Thank you very much!

vitaliy-guliy commented 9 months ago

@APINYK I even do not know what we have to fix, a it is just a bit different behavior. When VS Code is is opened using a workspace file, all the 'global' setting like theme, etc.. should be described in the workspace file, not in .vscode/settings.json.

But we need to invent something. If you create a workspace from a repository where devfile does not have any projects (or even no devfile in the repository), you expect that all the settings from .vscode directory will be applied.

Btw, what do you think about that? Should we create a workspace file automatically for only one project in a workspace? Or just specify some environment variable in the devfile to skip generating the workspace file and open the project as it was before.

vitaliy-guliy commented 9 months ago

So, the simplest thing what we can improve: if you want to describe some settings for your project, just define .code-workpace file. This file will be used automatically. And it will be not necessary to define VSCODE_DEFAULT_WORKSPACE environment variable in the devfile. So, if a workspace has one project, and the project has .code-workspace file, the file will be used automatically.

APINYK commented 9 months ago

@vitaliy-guliy sorry for my late reply!

I think the latter solution is fine. Then people just need to put a .code-workspace file into their project.

The only thing I don't like is that if a project has an existing .vscode folder i won't be as smooth as before to move from vs-code desktop to the web-based version.