drccrd opened a new issue, #3713:
URL: https://github.com/apache/incubator-kie-tools/issues/3713
Drools merges all DRL files of a package into one namespace, so an `import`
in any file of the package is legal in every file. The unknown-type lint
currently checks only the current document's imports and flags cross-file
usages that compile fine.
Proposal: the lint unions imports from same-package sibling files (via the
existing `WorkspaceSiblingResolvers` registry), with open editor buffers
shadowing their on-disk counterparts, riding the existing mtime-keyed sibling
parse cache (one parse serves declares and imports).
Check if this can be done with a single parse rather than two.
**Companion fix, discovered while implementing this:** `resolveFqcn`'s
wildcard branch (`endsWith(".*")`) is dead code for locally-extracted imports.
The grammar carries the `.*` of a wildcard import as a separate `(DOT MUL)`
token outside `drlQualifiedName`, so `DRLCompletionHelper.extractImports`
yields the bare package name and local wildcard imports only ever resolve
through the unambiguous-class-index fallback — an ambiguous simple name under a
wildcard import resolves for the compiler but not for the LSP.
Fix: reconstruct the `.*` suffix in `extractImports` (one line, mirrors the
sibling-side extractor). This slightly changes hover/completion resolution
behavior for ambiguous names, in the direction of matching the compiler.
--
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]