VS Code openHAB Extension!

I’m sorry I did not get how did you install the extension on MacOs

Thanks

@Dominic_Bonneau I believe it is the same for osx as it is for windows.

Open the extensions pane on the left, then open the options menu (three dot) link at the top. Choose to install from VSIX and then navigate to where you saved the vsix file.

Thanks for this, I use a text editor for writing my rules because the SmartHome designer is not good. This is a welcome change and I am willing to download VSCode, but I was wondering what would be required to make this compatible with other Visual Studio editions, I’m currently using VS2015 Pro.

I think it is currently not possible to make it compatible with other VS products.

As far as i know, the only thing that those extension types have in common is the .vsix file ending.
Nothing more. :smiley:

Bah, oh well. I’ll survive having both :grinning:

OH2.1 seems not to pick up Visual Studio edits correctly.

I usually get a “model is empty or cannot be passed” error in the logs, followed by the model being loaded correctly. Sometimes models open twice, with strange results.

SublimeText doesn’t have this problem. Has anyone else noticed this? Is there a fix?

OH and Visual Studio are both running on Ubuntu 14.

I can confirm that.

Please submit an issue on github with steps to reproduce, I’ll take a look at it. Thank you

I don’t think we should blame VSC or this wonderful extension for that issue:

2 Likes

I didn’t want to blame anything here. :smiley:
Thanks for clarification.

1 Like

I’m working locally, not on a remote filesystem. So a different issue. But certainly not blaming anybody!

This forum has many, many posts about this issue and those occur with different editors: ESHD, Notepad++, …
If you are working locally, then this is the first time I’ve read about this.
In that case @kubawolanin is right I guess and an issue should be created.

stupid question, but presumably you mean an openhab issue, not a VS extension issue?

Because of this

an openHAB runtime/core issue should be created.

Hi,
I had a similar issue. But in my case completely nothing happened when saving the config files from vs code. Actually I’m not sure about the root cause because I never tried to edit the files with a different editor in this setup. And know everything works.
My setup is similar to @dan12345’s. oh2.1 local install on Ubuntu 16.04

Greetings
Sebastian

Way better than HomeDesigner. Thanks & Kudos

Being a Mac user, I never even thought to try out Visual Studio. After seeing the positive reception here on the forum, I gave it a go and am very happy using this new extension - far better than Designer. The only problem, and I suspect it’s probably on the roadmap, is that it doesn’t have quite the same level of syntax validation as the Eclipse Designer. I do occasionally open up Designer if I’m having trouble with a rule, but otherwise VS with this extension is my go-to editor!

So, for any Mac users who are wary - don’t be!

Hi nice work!
Just tried to install it in Visual Studio Community but it failed. Should it work with the community edition?
Maybe I just need some other Extension as dependencies?

05.08.2017 08:32:48 - Microsoft VSIX Installer
05.08.2017 08:32:48 - -------------------------------------------
05.08.2017 08:32:48 - vsixinstaller.exe version:
05.08.2017 08:32:48 - 15.0.26430.16 built by: D15SVC
05.08.2017 08:32:48 - -------------------------------------------
05.08.2017 08:32:48 - Command line parameters:
05.08.2017 08:32:48 - C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VSIXInstaller.exe,C:\Users\chrisw\Downloads\openhab-0.1.0.vsix
05.08.2017 08:32:48 - -------------------------------------------
05.08.2017 08:32:48 - Microsoft VSIX Installer
05.08.2017 08:32:48 - -------------------------------------------
05.08.2017 08:32:48 - Initializing Install...
05.08.2017 08:32:48 - Extensiondetails...
05.08.2017 08:32:48 - 	Identifier         : openhab
05.08.2017 08:32:48 - 	Name               : openHAB
05.08.2017 08:32:48 - 	Author             : openhab
05.08.2017 08:32:48 - 	Version            : 0.1.0
05.08.2017 08:32:48 - 	Description        : openHAB syntax highlight, code snippets, integrated Basic UI preview and docs search
05.08.2017 08:32:48 - 	Locale             : en-US
05.08.2017 08:32:48 - 	MoreInfoURL        : 
05.08.2017 08:32:48 - 	InstalledByMSI     : False
05.08.2017 08:32:48 - 	SupportedFrameworkVersionRange : [0.0,2147483647.2147483647]
05.08.2017 08:32:48 - 
05.08.2017 08:32:48 - 	SignatureState     : Unsigned
05.08.2017 08:32:48 - 	Unterstützte Produkte : 
05.08.2017 08:32:48 - 		Microsoft.VisualStudio.Code
05.08.2017 08:32:48 - 			Version : 
05.08.2017 08:32:48 - 
05.08.2017 08:32:48 - 	Verweise           : 
05.08.2017 08:32:48 - Signaturdetails...
05.08.2017 08:32:48 - 	Extension is not signed.
05.08.2017 08:32:48 - 
05.08.2017 08:32:48 - Er wird nach passenden Produkten gesucht...
05.08.2017 08:32:48 - Installiertes Produkt gefunden - Globaler Pfad
05.08.2017 08:32:48 - Installiertes Produkt gefunden - Visual Studio Community 2017
05.08.2017 08:32:48 - VSIXInstaller.NoApplicableSKUsException: Diese Extension kann auf den derzeit installierten Produkten nicht installiert werden.
   bei VSIXInstaller.App.GetInstallableData(String vsixPath, Boolean isRepairSupported, IEnumerable`1& skuData)
   bei VSIXInstaller.App.Initialize(Boolean isRepairSupported)
   bei VSIXInstaller.App.Initialize()
   bei System.Threading.Tasks.Task`1.InnerInvoke()
   bei System.Threading.Tasks.Task.Execute()

Hi Chris,

It’s a plugin for VSCode, not Visual Studio Community. Cheers

Yes, what he said. If it makes you feel better, I did the same thing.