Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement auto-completion #56

Closed
hohwille opened this issue Sep 28, 2023 · 2 comments · Fixed by #187
Closed

Implement auto-completion #56

hohwille opened this issue Sep 28, 2023 · 2 comments · Fixed by #187
Assignees
Labels
bash CLI IDEasy command-line-interface (parsing args, etc.) commandlet completion auto-completion in bash or build in CLI enhancement New feature or request

Comments

@hohwille
Copy link
Member

As a IDEasy user, I want to have command-line auto-completion so that I can be more productive and do not always have to read the help pages.

We had implemented this in devonfw-ide with manually bash scripts and the bash completion infrastructure.
My vision is that we pass the arguments to auto-complete directly into our Java main program.
So more or less Ide complete «args» would be called and we solve this with a CompleteCommandlet.
By finding the proper commandlet to invoke we can find its arguments and depending on their type automatically determine the possible options. That is why I prepared according specific Property sub-classes so that for a VersionProperty we know that a version-number is to be passed and from out tool-commandlet to be invoked, we can figure out the possible and matching versions.

BTW: This story is not easy and therefore not good for beginners. Also I learned that debugging auto-completion while using it is tricky as you can not use debug output to the console while pressing [Tab] key. It is therefore good to have an understanding of how auto-completion in bash works and then first have JUnits covering the different cases (completion of a single word where a prefix of that word is already given vs. a new word is started, etc.). If still some debugging is needed it is better to temporary write a log-file with the input and output of the auto-completion to later understand what went wrong and why... Good luck with this story :)

@hohwille hohwille added enhancement New feature or request bash commandlet labels Sep 28, 2023
@hohwille hohwille added this to the release:2024.01.001 milestone Sep 28, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Sep 28, 2023
@jan-vcapgemini jan-vcapgemini self-assigned this Oct 6, 2023
@jan-vcapgemini jan-vcapgemini moved this from 🆕 New to Research in IDEasy board Oct 6, 2023
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Oct 23, 2023
added jline license
added jansi license
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Oct 24, 2023
added jline.version property to pom
fixed context based help command
removed AnsiConsole
@tobka777 tobka777 moved this from Research to 🏗 In progress in IDEasy board Oct 27, 2023
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Oct 31, 2023
removed SystemRegistry and replaced with IdeCompleter
added options completion
added version completion
added tool completion
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Oct 31, 2023
added tests using tab completion
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Oct 31, 2023
added version number sorting
removed picocli example code
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Nov 2, 2023
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Nov 2, 2023
fixed version number sorting
removed used option and alias
removed jansi dependency
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Nov 7, 2023
implemented first version of option completion with cleanup of used options
converted commandletOptions from String to actual Property
adjusted tests
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Nov 7, 2023
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Nov 7, 2023
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Nov 7, 2023
added new constant for maximum results to display
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Nov 7, 2023
adjusted visibility of applyAndRun to private
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Nov 20, 2023
added setLogLevel method to AbstractIdeContext
added loggerFactory class variable to AbstractIdeContext
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Nov 20, 2023
added test for prevention of options after command
added test which handles options before a command
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Nov 20, 2023
@tobka777 tobka777 moved this from 🏗 In progress to Team Review in IDEasy board Nov 21, 2023
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Nov 21, 2023
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Nov 21, 2023
renamed ReaderTestSupport to AutocompletionReaderTestSupport
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Nov 21, 2023
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Nov 21, 2023
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Dec 12, 2023
split pattern into several parts
added patternCompiled constant
changed checkInvalidPattern param to String
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Dec 14, 2023
made sure that all exceptions get catched and reported with an error message
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Dec 14, 2023
moved check for invalid patterns to the top to stop autocomplete early before doing other stuff
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Dec 14, 2023
added another try block for catching run CLI exceptions
@hohwille hohwille added completion auto-completion in bash or build in CLI CLI IDEasy command-line-interface (parsing args, etc.) labels Jan 4, 2024
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Jan 8, 2024
renamed initializeJlineCompletion to runWithInteractiveCompletion and adjusted comments
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Jan 8, 2024
replaced redundant code with setLogLevel(minLogLevel)
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Jan 8, 2024
adjusted TODO's (added link to issues)
removed commented code
moved processCliArgument into else block
added error codes in case of exceptions
changed runWithInteractiveCompletion from void to int to be able to use error codes
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Jan 8, 2024
replaced Throwable with Exception
renamed retrieveCliArgument to initContext
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Jan 8, 2024
replaced -v and --version with VersionCommandlet
fixed CTRL+D missing return and exit code
added test for VersionCommandlet autocompletion
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Jan 8, 2024
changed to more descriptive name and description
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Jan 8, 2024
removed -v and --version
jan-vcapgemini added a commit to jan-vcapgemini/IDEasy that referenced this issue Jan 9, 2024
removed CommandletRegistry
hohwille added a commit to hohwille/IDEasy that referenced this issue Jan 10, 2024
hohwille added a commit to hohwille/IDEasy that referenced this issue Jan 11, 2024
…start» and redesign CliArguments again as it does not feel consistent but rather hacky
hohwille added a commit to hohwille/IDEasy that referenced this issue Jan 15, 2024
@hohwille hohwille linked a pull request Jan 22, 2024 that will close this issue
jan-vcapgemini added a commit to hohwille/IDEasy that referenced this issue Jan 23, 2024
hohwille added a commit that referenced this issue Jan 23, 2024
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in IDEasy board Jan 23, 2024
hohwille added a commit to hohwille/IDEasy that referenced this issue Jan 25, 2024
hohwille added a commit to hohwille/IDEasy that referenced this issue Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bash CLI IDEasy command-line-interface (parsing args, etc.) commandlet completion auto-completion in bash or build in CLI enhancement New feature or request
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants