drccrd opened a new issue, #3712: URL: https://github.com/apache/incubator-kie-tools/issues/3712
**Dotted member chains.** Hover on any segment of `$p.address.city` (or `address.city` inside a pattern) resolves the chain left-to-right through the pattern/binding type's members and renders the hovered segment's type and, for class-typed segments, its member list. Builds on the existing rule-scoped primitives (`LhsBindingResolver.resolveAt`, `ClassMemberIndex`, the declared-type index) in `packages/drools-lsp/drools-completion/.../DRLHoverHelper.java`. **Qualified enum constants.** Hover on `Severity.HIGH` in a constraint renders the enum type and the constant, including constructor arguments for DRL declared enums. **Accumulate-function hover.** Hover on `sum`, `count`, `collectList`, … inside `accumulate(...)` renders the function's result type and, where known, the implementing class — so authors can see what `$total : sum($w)` binds. Design note: `drools-completion` deliberately carries no Drools runtime dependency, so the function table cannot be reflected from the engine there. Contributed shape: a small static holder (name → result type / impl FQCN) with baked defaults transcribed from the engine's standard accumulate functions, plus a setter so `drools-lsp-server` (which does carry the dependency) can refresh the table from the actual engine version at startup (`META-INF/kie.default.properties.conf`). Detection is parse-tree-based (the accumulate context), not textual. **Doc comments for `function`/`query`/`global`.** Declared types already surface their preceding `/** ... */` doc comments on hover (kiegroup/drools-lsp #82); these three declaration kinds do not. Extends the same `DRLDocCommentParser` machinery, current-document scope first; sibling-file awareness is the tracked follow-up, matching the sibling-aware lookup declared types already get. **Constructor/getter sections (member provenance).** Java-type hover currently renders a flat member list (bean properties + public fields, unlabeled). Group it into **Constants / Fields / Getters / Constructors** sections: tag members with their origin (enum constant, getter-derived property, public field) in `ClassMemberIndex` and reflect public constructor signatures. Authors see how to construct a fact and which members are bean properties vs. raw fields. (This piece also underpins the source-typing proposal in issue 4, but stands alone.) **Inherited members of a Java supertype.** A DRL `declare` may extend a Java class (`declare Assessment extends InputFact`). Hover on such a type currently shows only the fields the DRL declares: `DRLDeclaredTypeParser.fieldsIncludingInherited` walks `extendsName` through the declared-type index and stops the moment the parent is not another `declare`, so everything inherited from the Java side is invisible — in hover, in field completion, and (via `LhsBindingResolver`) in the resolved type of a binding on an inherited field. Proposal: a small host-installed seam (type name → members, inherited already folded in) that both inheritance walks consult when a type is not declared in the DRL, so `ClassMemberIndex` — which already reflects the full hierarchy — can answer. Deliberately *not* a new layer on the declared-type index: that index also feeds go-to-definition/references/rename, which would then receive synthetic types with no navigable source position. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
