Skip to content

#1392: Smart completions#1859

Open
HenokLachmann wants to merge 50 commits into
devonfw:mainfrom
HenokLachmann:feature/#1392-smart-completions
Open

#1392: Smart completions#1859
HenokLachmann wants to merge 50 commits into
devonfw:mainfrom
HenokLachmann:feature/#1392-smart-completions

Conversation

@HenokLachmann
Copy link
Copy Markdown
Contributor

@HenokLachmann HenokLachmann commented Apr 27, 2026

This PR fixes #1392

Implemented changes:

Auto-completion is extended for the Mvn commandlet. It enables autocompletion for the ShellCommandlet as well as for bash. Completion is supported for the last word as well as intermittent words on a commandline. Completion covers the following:

  • Typical maven goals like clean, install, package
  • Boolean flags like --fail-fast
  • Definitions like -Dexec.mainClass=<classname>

Whitespace is excluded after a completed trailing = by differentiating partial from full completions. Merged short options are also supported as they are for present options.

Completion is based on Property instances, but properties are also used as stand-in replacements. Examples are the repository property for RepositoryCommandlet or the commandlet property for HelpCommandlet. These are not literal, they should not participate in autocompletion. A new boolean property placeholder is introduced to exclude them from completion.

A bug existed in the current implementation that would complete the exit subcommand infinitely. This is fixed by this PR by making exit an ordinary KeywordProperty and dynamically adding it when a shell session is started.


Checklist for this PR

Make sure everything is checked before merging this PR. For further info please also see
our DoD.

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary» (e.g. #921: fixed setup.bat). If no issue ID exists, title only.
  • PR top-level comment summarizes what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you or there is no issue (might happen for very small PRs)
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc unless issue is labeled
    with internal

@github-project-automation github-project-automation Bot moved this to 🆕 New in IDEasy board Apr 27, 2026
@HenokLachmann HenokLachmann self-assigned this Apr 27, 2026
@HenokLachmann HenokLachmann added completion auto-completion in bash or build in CLI shell build-in shell with advanced completion labels Apr 27, 2026
@HenokLachmann HenokLachmann force-pushed the feature/#1392-smart-completions branch from 499ecbe to d4ae88b Compare May 13, 2026 13:33
@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented May 19, 2026

Coverage Report for CI Build 26101908636

Coverage increased (+0.003%) to 70.982%

Details

  • Coverage increased (+0.003%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 240 coverage regressions across 23 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

240 previously-covered lines in 23 files lost coverage.

Top 10 Files by Coverage Loss Lines Losing Coverage Coverage
com/devonfw/tools/ide/context/AbstractIdeContext.java 102 63.77%
com/devonfw/tools/ide/property/Property.java 28 71.9%
com/devonfw/tools/ide/tool/mvn/Mvn.java 19 83.84%
com/devonfw/tools/ide/property/PathProperty.java 16 11.27%
com/devonfw/tools/ide/commandlet/CommandletManagerImpl.java 10 84.21%
com/devonfw/tools/ide/completion/CompletionCandidateCollectorAdapter.java 9 0.0%
com/devonfw/tools/ide/context/IdeContext.java 9 77.78%
com/devonfw/tools/ide/cli/CliArguments.java 8 69.64%
com/devonfw/tools/ide/cli/Ideasy.java 5 51.43%
com/devonfw/tools/ide/commandlet/Commandlet.java 5 85.71%

Coverage Stats

Coverage Status
Relevant Lines: 15567
Covered Lines: 11521
Line Coverage: 74.01%
Relevant Branches: 6964
Covered Branches: 4472
Branch Coverage: 64.22%
Branches in Coverage %: Yes
Coverage Strength: 3.14 hits per line

💛 - Coveralls

@HenokLachmann HenokLachmann marked this pull request as ready for review May 19, 2026 13:26
@tineff96 tineff96 moved this from 🆕 New to Team Review in IDEasy board May 20, 2026
Copy link
Copy Markdown
Contributor

@tineff96 tineff96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and tested.

  • mvn clean test passed
  • verified mvn CLI behavior and completion

The changes look solid and work as expected.

I’m still relatively new to the project, but everything seems correct from my side.

Looks good to me.

@tineff96 tineff96 moved this from Team Review to 👀 In review in IDEasy board May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

completion auto-completion in bash or build in CLI shell build-in shell with advanced completion

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

Smart completion

3 participants