JBoss Drools synthax highlighting, imports organization and auto format not working in IntelliJ Idea Ultimate

Answered

I use Intellij Idea Ultimate 2019.2 and Drools 5.6.0.Final.

1. The .drl files do not change on auto-format or import re-arrangement / optimization cmd. I get `No lines changed: content is already properly formatted`, but it's not.

2. The synthax highlighting is generally working properly, but not completely. Call to values method of enums is highlighted in red: `Cannot resolve method values`. 

3. I also get `Variable X is already defined in the scope` and it clearly is in a different scope.

4. In the when clause of the rules the following gets highlighted:

over window:time(1s)

The msg is `JAVA_IDENTIFIER expected, got window`.

All rules compile fine and work properly. It's just the IDE support that doesn't work. Can I do something about it?

0
5 comments

Hello Galya,

Could you please provide file example demonstrating highlighting and error issues?

0
Avatar
Permanently deleted user

Hi Yaroslav,

This is the .drl file. You can create and import any empty enum and Serializable types to replace those in the example:

import com.demo.DemoEnum
import com.demo.ASerializableClass

rule "Demo rule"
when
$event : ASerializableClass()
over window:time(1s) // JAVA_IDENTIFIER expected, got `window`
from entry-point "EventStream"
then
for (DemoEnum value : DemoEnum.values()) { // Cannot resolve method values

}
DemoEnum value = null; // value is already defined in the scope
end
0

Galya,

Thanks for example. I reported issues on YouTrack: https://youtrack.jetbrains.com/issue/IDEA-228835, https://youtrack.jetbrains.com/issue/IDEA-228836.

Please follow them for updates.

0
Avatar
Permanently deleted user

Thank you! I was also curious about the auto format and imports re-arrangement. Is that supported and how can I enable it?

0

Galya,

Currently it's not possible. Please add comments to the related issue https://youtrack.jetbrains.com/issue/IDEA-228836

0

Please sign in to leave a comment.