• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

devonfw / IDEasy / 9904178931

12 Jul 2024 07:32AM UTC coverage: 61.387% (-0.5%) from 61.842%
9904178931

push

github

web-flow
#400: fix error handling for undefined IDE_ROOT and IDE_HOME (#476)

1997 of 3575 branches covered (55.86%)

Branch coverage included in aggregate %.

5297 of 8307 relevant lines covered (63.77%)

2.8 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

33.33
cli/src/main/java/com/devonfw/tools/ide/commandlet/CompleteCommandlet.java
1
package com.devonfw.tools.ide.commandlet;
2

3
import com.devonfw.tools.ide.cli.CliArguments;
4
import com.devonfw.tools.ide.completion.CompletionCandidate;
5
import com.devonfw.tools.ide.context.AbstractIdeContext;
6
import com.devonfw.tools.ide.context.IdeContext;
7
import com.devonfw.tools.ide.property.StringProperty;
8

9
import java.util.List;
10

11
/**
12
 * {@link Commandlet} for auto-completion.
13
 */
14
public final class CompleteCommandlet extends Commandlet {
15

16
  /** {@link StringProperty} with the current CLI arguments to complete. */
17
  public final StringProperty args;
18

19
  /**
20
   * The constructor.
21
   *
22
   * @param context the {@link IdeContext}.
23
   */
24
  public CompleteCommandlet(IdeContext context) {
25

26
    super(context);
3✔
27
    addKeyword(getName());
4✔
28
    this.args = add(new StringProperty("", false, true, "args"));
12✔
29
  }
1✔
30

31
  @Override
32
  public String getName() {
33

34
    return "complete";
2✔
35
  }
36

37
  @Override
38
  public boolean isIdeRootRequired() {
39

40
    return false;
×
41
  }
42

43
  @Override
44
  public boolean isProcessableOutput() {
45

46
    return true;
×
47
  }
48

49
  @Override
50
  public void run() {
51

52
    CliArguments arguments = CliArguments.ofCompletion(this.args.asArray());
×
53
    List<CompletionCandidate> candidates = ((AbstractIdeContext) this.context).complete(arguments, true);
×
54
    for (CompletionCandidate candidate : candidates) {
×
55
      System.out.println(candidate.text()); // enforce output via System.out even if logging is disabled
×
56
    }
×
57
  }
×
58
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc