I’ve just setup a new Linux server which I’m now running as my “production” environment and my existing RPi setup will become my “development” environment.
My next step is to start the configuration which has led me back into VSCode, however, is there a way to have multiple OH environments in the VSCode openHAB extension? I’ve had a look but can’t see a way, but some of you with more VSC experience maybe able to point me in the right directions.
I can change the address in the settings and I’d be able to see the other server instead. What I’m questioning is whether it’s possible to have VSC configured so I can select the environment I’m working on at the time, without having to change the settings each time and then loose connection to my other environment.
I’m not in front of VSC right now, but I’m pretty sure it’s just a setting so you can put it in a settings file in the folder you’re working in instead of global settings. You can also define workspace settings if you’re using workspace files.
I’m not that familiar with VSC but I’m used to workspaces in Eclipse so I can see how that would work, still not a perfect solution but more than happy as a work around. I might see if it’s possible to put it in folder as well as that would be even better.
Yes, I keep my workspace files in the root folder they are dealing with. I have only recently started using them after having my dev machine die on me and installing VSC again and again between that and updating to Ubuntu 20 just prior. Now I don’t have to keep restoring my global VSC settings, they are just there in the workspace file which is in source control. Bonus of it being in source control is that for shared projects I can have some control over the IDE of contributors to enable things like linting and code formatting.
I have not worked on my openhab config since I started using workspaces, but here is an example of what I might setup: