Language support for DRL (Drools Rule Language) files in Visual Studio Code, powered by a dedicated Language Server.
Requirements
- Java 17 or later (
JAVA_HOMEmust be set orjavamust be on yourPATH) - Maven (for classpath resolution of Java types used in rules)
Features
Code Editing
- Syntax highlighting
- Code completion for grammar keywords, Java class names, fields/properties, and DRL
declaretypes - Inlay hints for bound variables
- Live class index refresh on recompile (no server restart required)
Navigation
- Go-to definition for DRL and Java types
- Find references for DRL types and bound variables
- Rename for DRL declared types and bound variables
- Document symbols (outline view)
- Type hierarchy for DRL types
- Folding ranges for DRL blocks and comments
Diagnostics
- Syntax error reporting
- Lint diagnostics (missing
end, missing separators, unbalanced parentheses, etc.) - Unknown-type lint with typo quick-fix for DRL-declared types
Information
- Hover tooltips for DRL/Java types with doc-comment rendering
- Reference-count code lens for DRL declared types
Extension Settings
| Setting | Default | Description |
|---|---|---|
drools.lsp.logLevel |
INFO |
Server-side log level |
drools.lsp.lint.missingEnd |
warning |
Severity for missing end keyword |
drools.lsp.lint.missingSeparator |
warning |
Severity for missing constraint separator |
drools.lsp.lint.missingSemicolon |
warning |
Severity for missing semicolon in consequence |
drools.lsp.lint.unbalancedParens |
warning |
Severity for unbalanced parentheses |
drools.lsp.lint.mvelPropertyAccess |
off |
Hint to prefer property-access style over getter calls in LHS |
drools.lsp.inlayHints.enabled |
true |
Show inline type hints for bound variables |
drools.lsp.maven.pomPath |
"" |
Maven POM path(s) for classpath resolution |
All lint settings accept: off, hint, info, warning, error.
Some features can be further configured using VS Code's built-in settings, such as editor.inlayHints.enabled for inlay hint visibility and editor.folding for folding range behavior.
Known Issues
If you find any issues, please report them in GitHub Issues.