Just started using VS Code with the OH2 plugin and I was working on my first sitemap file. OH2 kept ignoring it due to errors every time I saved it. How do I ensure that VS Code is set up properly to help me check for errors in syntax etc?
I don’t mean to be rude but you are asking a lot of questions that can easily be answered with searching. Please try doing a little footwork. It’s not fair for us to have to feed this info to you.
Thanks @Moxified… I did read that documentation and the section regarding Rule Validation said the Language Server is active by default. I wasn’t seeing it flag anything. Perhaps I’m missing something but I did read first. Apologies as I’m not trying to be spoon fed without spending the effort.
This is what I read… This extension comes with Language Server Protocol support. Language servers allow you to add your own validation logic to files open in VS Code. openHAB from version openHAB 2.2.0 Build #1065 (SNAPSHOT) has the Language Server exposed on 5007 port. openHAB 2.2 since build #1084 has LSP feature enabled in the runtime, so there are no additional steps for you to make it work.
Ok. NP. Well, I think in this case you might be right that the doc is a little incomplete on this… idk. It does say that openhab.host is mandatory but it is under the sitemap preview section.
Anyways. Add a setting for openhab.host to the ip of your OH server. That’s probably what you are missing.