VSCode Intellisense for openHAB shows wrong errors

Hi,
the openhab extension in VSCode shows wrong errors in my rule files:


Seems like it doesn’t find these items. But that’s not right: All the items stated here are available and working.

Got anyone else a similar problem?

Hi. I was just about to start a new thread and then spotted this so thought might be better to continue it even though it has been dormant for 6 months.

Yes I see the same issue (and others I would like to sweep up here) and see if anyone can help. i have been using openhab2 for a couple of years now and never quite got vscode working the way it is demo’d in the github documentation so i thought i’d use the opportunity to have a concerted effort at it as i upgrade to oh3.

Note the rules are text based, copied over from openhab2 instance, but with new Things and Items linked in the OH3 GUI and rules amended accordingly.

  1. Issue where some Items are recognised and others aren’t. I have 2 almost identical items declared:

    In vscode i have:
    sendCommand(HallSetPoint, MorningSetPoint)
    sendCommand(BackRoomSetpoint, MorningSetPoint)

and

{
	"resource": "/x:/rules/heatingnew.rules",
	"owner": "_generated_diagnostic_collection_name_#1",
	"code": "org.eclipse.xtext.diagnostics.Diagnostic.Linking",
	"severity": 8,
	"message": "The method or field BackRoomSetpoint is undefined",
	"startLineNumber": 17,
	"startColumn": 17,
	"endLineNumber": 17,
	"endColumn": 33
}

however no such issue for HallSetPoint.

  1. In another rule I see all the text of the rule underlined and the error output is:
{
	"resource": "/x:/rules/curtains.rules",
	"owner": "_generated_diagnostic_collection_name_#1",
	"code": "org.eclipse.xtext.xbase.validation.IssueCodes.duplicate_type",
	"severity": 8,
	"message": "The type CurtainsRules is already defined in curtains.rules.",
	"startLineNumber": 1,
	"startColumn": 1,
	"endLineNumber": 27,
	"endColumn": 4
}

All other rule files are unaffected by this error. the rule does not declare a type CurtainsRules as far as I am aware.