VSCode extension issues

I think this is the correct and only solution to @Magnus issue.
That is the reason why VScode does support .vscode folders in work spaces, I think.

@rlkoshak s use case sounds very special.
Isn’t the reason for an LSP server to have a LSP for a specific work space/project?
So you can have different openHAB LSPs when you manage different openHAB instance (like v2 and v3) at the same time.

So do not think we need support for multiple openHAB servers.

But I admit I have special use cases too sometimes. :laughing:

The problem way back when I looked into this was that on a RPi, simply editing some .rules files connected to the production server would bring the OH instance to its knees, stopping pretty much all the home automation for a time. If VSCode used a different OH instance for the LSP server then the production system wouldn’t have that huge hit in performance. But it also means that VSCode isn’t aware of the Things and Items and such (unless you duplicate them on this other OH instance).

And I wasn’t advocating for any changes to the VSCode extension to support this. My post was mainly to provide some observations which might be relevant.

Though, for those who are managing more than one OH instance, being able to switch between instances as one moves from one instance to the next would be useful. Again, I’m not personally advocating for that. Since I’ve moved to all UI driven configs I don’t use the VSCode with OH anymore. But there is a small but important community of OH admins on this forum who are maintaining OH instances for others. I imagine such a feature would be appreciated.

I think that should be done automatically in the workspace approach, when the workspace knows different settings through configuration.

Thank you for providing the vs code extension. I use the latest version on linux and have a strange problem - where I’m not sure if it is a problem with the extension.

A file is completely marked red with the message that “The type SchattenprogrammRules is already defined in schattenprogramm.rules.” - but that is the file I’m currently working with - there is no other such file that I’m aware of.

There are also no duplicated rule names in that file.
schattenprogramm.rules.txt (692 Bytes)

Is there a know bug that can cause this or do I miss the obvious and there is a mistake in my rules file after all? What additional information is required to troubleshot this?

See

Don’t select the openhab root folder

1 Like

Thank you for that hint, now the problem is solved for me with this workaround! :+1:

1 Like

Thank you for the reply. I did not open the root folder, but only the rules folder itself. But as it seems to be related to the folder I open I’ll try with the conf folder - at a first glance it looks ok like this.

1 Like

same

same what ?

Hi,

i got a similiar problem, too.

Part of the rule:

    val String var_bmw_g31_vertragsstart_string = "2019-09-09T00:00:00.000+02:00"
    val DateTime var_bmw_g31_vertragsstart = parse(var_bmw_g31_vertragsstart_string)

Warning/Error at VSC

DateTime cannot be resolved to a type.(org.eclipse.xtext.diagnostics.Diagnostic.Linking

spell checking not working Since I installed OH3
Refers to the bottom line as here:
Screenshot_20210516-144049_Edge

It’s not related, apart from having the same arrangement of letters.

This won’t work in OH3, unless you import deprecated Joda DateTime.
It’s recommended instead to use -

It’s nothing to do with VSCode.