diff --git a/src/main/java/de/prob2/jupyter/CommandUtils.java b/src/main/java/de/prob2/jupyter/CommandUtils.java index 09d582d9d4c36fe51dfd09826880ab105063e72c..2ff72496d16ab3178a435a1b44f9d5ea3085ac52 100644 --- a/src/main/java/de/prob2/jupyter/CommandUtils.java +++ b/src/main/java/de/prob2/jupyter/CommandUtils.java @@ -409,13 +409,18 @@ public final class CommandUtils { cmdExact.addKeywordContext(CompleteIdentifierCommand.KeywordContext.ALL); trace.getStateSpace().execute(cmdExact); // 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); cmdIgnoreCase.setIgnoreCase(true); cmdIgnoreCase.addKeywordContext(CompleteIdentifierCommand.KeywordContext.ALL); 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); };