Skip to content
Snippets Groups Projects
Commit 4c5a8071 authored by dgelessus's avatar dgelessus
Browse files

Update for incompatible changes to CompleteIdentifierCommand

parent 27360b5a
Branches
No related tags found
No related merge requests found
...@@ -409,13 +409,18 @@ public final class CommandUtils { ...@@ -409,13 +409,18 @@ public final class CommandUtils {
cmdExact.addKeywordContext(CompleteIdentifierCommand.KeywordContext.ALL); cmdExact.addKeywordContext(CompleteIdentifierCommand.KeywordContext.ALL);
trace.getStateSpace().execute(cmdExact); trace.getStateSpace().execute(cmdExact);
// Use LinkedHashSet to remove duplicates while maintaining order. // Use LinkedHashSet to remove duplicates while maintaining order.
final Set<String> completions = new LinkedHashSet<>(cmdExact.getCompletions()); final Set<String> completions = new LinkedHashSet<>();
for (CompleteIdentifierCommand.Completion completion : cmdExact.getCompletions()) {
completions.add(completion.getCompletion());
}
final CompleteIdentifierCommand cmdIgnoreCase = new CompleteIdentifierCommand(prefix); final CompleteIdentifierCommand cmdIgnoreCase = new CompleteIdentifierCommand(prefix);
cmdIgnoreCase.setIgnoreCase(true); cmdIgnoreCase.setIgnoreCase(true);
cmdIgnoreCase.addKeywordContext(CompleteIdentifierCommand.KeywordContext.ALL); cmdIgnoreCase.addKeywordContext(CompleteIdentifierCommand.KeywordContext.ALL);
trace.getStateSpace().execute(cmdIgnoreCase); trace.getStateSpace().execute(cmdIgnoreCase);
completions.addAll(cmdIgnoreCase.getCompletions()); for (CompleteIdentifierCommand.Completion completion : cmdExact.getCompletions()) {
completions.add(completion.getCompletion());
}
return new ReplacementOptions(new ArrayList<>(completions), start, end); return new ReplacementOptions(new ArrayList<>(completions), start, end);
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment