drccrd commented on code in PR #3965:
URL:
https://github.com/apache/incubator-kie-tools/pull/3965#discussion_r3843601551
##########
packages/drools-lsp/drools-completion/src/main/java/org/drools/completion/DRLCompletionHelper.java:
##########
@@ -208,6 +250,160 @@ private static List<CompletionItem>
getFieldCompletionItems(DRL10Parser.Compilat
return fieldItems(memberIndex.membersOf(fqcn));
}
+ /**
+ * The dot-separated segments preceding a caret that sits immediately
after a
+ * dot ({@code $ref.order.|} → {@code [$ref, order]}), or {@code null}
when the
+ * caret follows something else. A numeric head is a decimal literal being
+ * typed, not a path.
+ */
+ private static String[] dottedChainBeforeCaret(String text, Position
caret) {
+ if (text == null || caret == null) {
+ return null;
+ }
+ String[] lines = text.split("\n", -1);
+ int row = caret.getLine();
+ if (row < 0 || row >= lines.length) {
+ return null;
+ }
Review Comment:
Fixed in 8ddf8fa0221e3264255ed0104f00464aebbd1036 as suggested
--
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]