Expected behavior
IDEasy complete should match commandlets only once.
Actual behavior
It appears that IDEasy matches commandlets for the completion of an expression a 2nd time.
See:
|
public List<CompletionCandidate> complete(CliArguments arguments, boolean includeContextOptions) { |
|
|
|
CompletionCandidateCollector collector = new CompletionCandidateCollectorDefault(this); |
|
if (arguments.current().isStart()) { |
|
arguments.next(); |
|
} |
|
if (includeContextOptions) { |
|
ContextCommandlet cc = new ContextCommandlet(); |
|
for (Property<?> property : cc.getProperties()) { |
|
assert (property.isOption()); |
|
property.apply(arguments, this, cc, collector); |
|
} |
|
} |
|
CliArgument current = arguments.current(); |
|
if (!current.isEnd()) { |
|
String keyword = current.get(); |
|
Commandlet firstCandidate = this.commandletManager.getCommandletByFirstKeyword(keyword); |
|
boolean matches = false; |
|
if (firstCandidate != null) { |
|
matches = apply(arguments.copy(), firstCandidate, collector); |
|
} else if (current.isCombinedShortOption()) { |
|
collector.add(keyword, null, null, null); |
|
} |
|
if (!matches) { |
|
for (Commandlet cmd : this.commandletManager.getCommandlets()) { |
|
if (cmd != firstCandidate) { |
|
apply(arguments.copy(), cmd, collector); |
|
} |
|
} |
|
} |
|
} |
|
return collector.getSortedCandidates(); |
|
} |
|
if (!matches) { |
|
for (Commandlet cmd : this.commandletManager.getCommandlets()) { |
|
if (cmd != firstCandidate) { |
|
apply(arguments.copy(), cmd, collector); |
|
} |
|
} |
|
} |
Steps to reproduce (bug) / Use Case of feature request (enhancement)
- Debug through
ide complete in
Related/Dependent Issues
Comments/Hints:
Affected version:
- IDEasy: 2024.08.001-beta-SNAPSHOT
Expected behavior
IDEasy complete should match commandlets only once.
Actual behavior
It appears that IDEasy matches commandlets for the completion of an expression a 2nd time.
See:
IDEasy/cli/src/main/java/com/devonfw/tools/ide/context/AbstractIdeContext.java
Lines 938 to 970 in 3c1dcd1
IDEasy/cli/src/main/java/com/devonfw/tools/ide/context/AbstractIdeContext.java
Lines 961 to 967 in 3c1dcd1
Steps to reproduce (bug) / Use Case of feature request (enhancement)
ide complete inRelated/Dependent Issues
Comments/Hints:
Affected version: