Skip to content

Commit

Permalink
[WIP] Fix AbstractJavaCompletionProposal for persistent content assist
Browse files Browse the repository at this point in the history
WIP, DONT MERGE

Fixes: #1643
Signed-off-by: Simeon Andreev <[email protected]>
  • Loading branch information
trancexpress committed Sep 13, 2024
1 parent b83ffe1 commit 4914ab1
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -800,13 +800,11 @@ public boolean validate(IDocument document, int offset, DocumentEvent event) {
if (!isOffsetValid(offset))
return fIsValidated= false;

fIsValidated= isValidPrefix(getPrefix(document, offset));
String prefix = getPrefix(document, offset);
fIsValidated= isValidPrefix(prefix);

if (fIsValidated && event != null) {
// adapt replacement range to document change
int delta= (event.fText == null ? 0 : event.fText.length()) - event.fLength;
final int newLength= Math.max(getReplacementLength() + delta, 0);
setReplacementLength(newLength);
setReplacementLength(prefix.length());
}

return fIsValidated;
Expand Down

0 comments on commit 4914ab1

Please sign in to comment.