openhab / openhab-vscode

VS Code extension for openHAB configuration files
https://marketplace.visualstudio.com/items?itemName=openhab.openhab
Eclipse Public License 2.0
159 stars 47 forks source link

The type *Rules is already defined in *.rules (org.eclipse.xtext.xbase.validation.IssueCodes.duplicate_type) #294

Open SHU-red opened 2 years ago

SHU-red commented 2 years ago

Expected Behavior

No error should occur if i open up my homeserver via ssh and open a .rule file

Current Behavior

As i open up any .rule file, the whole rule file is marked as error with the error-text The type GooglehomeRules is already defined in googlehome.rules.(org.eclipse.xtext.xbase.validation.IssueCodes.duplicate_type)

Screenshot_20220530_145135

Possible Solution

Steps to Reproduce (for Bugs)

  1. Open VSCode (my docker_volumes folder is opened as standard and one level higher than openhab_conf)
  2. Open a Random .rule file
  3. The whole .rule-file is marked as error

Context

This issue seemed to already have been discussed but not resolved https://github.com/eclipse-archived/smarthome/issues/4799

Your Environment

WJ4IoT commented 1 year ago

As complete Linux/Docker/Container/Volume Dummy I experienced the same and was happy to read this solution. It would be nice if you could start from eg "/opt/" and select from here the lower Docker Volume of Openhab "./conf:/openhab/conf" but on the other hand it is not a normal folder but a Docker Volume and the workaround is simple just add a second entry for this purpose (and yes I am sure the system will slap me on the the ears again the next time I forget to select this entry)

image

SHU-red commented 1 year ago

Any update on this?

mrJakez commented 1 year ago

I have exactly the same issue :-/

cods69 commented 1 month ago

I'm randomly getting the same issue now. OH4.1 on Docker. Restarts, renames and re-saves sometimes fix it. Does not always appear. Usual file name is home.rules The type HomeRules is already defined in home.rules.(org.eclipse.xtext.xbase.validation.IssueCodes.duplicate_type)

basprins commented 6 days ago

Is this extension still maintained? Anybody any clue where this issue is caused? The only reference in code to eclipse.xtext.xbase is in the "simple lambda" in openhab_rules_designpattern.json. I wish I understood better how this was used :).