Skip to content

Commit

Permalink
Update DG autocompletion effort
Browse files Browse the repository at this point in the history
  • Loading branch information
wxwern committed Nov 13, 2023
1 parent e3e4b67 commit 30056f6
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -1208,11 +1208,17 @@ Additionally, a huge amount of time was spent creating test cases and modifying

### Autocompletion

To improve user experience, we wanted to incorporate an autocomplete feature which allows users to know which flags could be used for a certain command. This reduced the reliance on the User Guide and would help new users familiarize themselves with Jobby.
To improve user experience, we wanted to incorporate support for command autocompletion, which allows users to know which parameters and values could be used for a certain command. This reduced the reliance on the User Guide and would help new users familiarize themselves with Jobby.

Additionally, the addition of autocompletion allows us to use full-length flags (e.g., `--description`), yet allowing the user to simply type `-dc ` to obtain the full flag, removing the need to memorize multiple 1-, 2-letter abbreviations.

This involved:
* Creating an entire class to encapsulate this feature.
* Modify the parser to aid in autocompletion.
* Modifying JavaFX to incorporate autocompletion.
* Creating multiple classes to better organize and provide autocompletion,
* Modifying the parser, tokenizer, flag syntax, etc., to aid in autocompletion, and
* Modifying JavaFX elements and intercepting the appropriate keystroke events to incorporate autocompletion.

The end-to-end process of parsing the user text and determining what are plausible inputs is not trivial - we need to correctly decide which parameters and values are suggestable values based on command rules, such as "only one of `--name` allowed".

Additionally, despite the complex implementation, the autocompletion package has a comprehensive ~80% test coverage, with expected behaviors clearly documented within the tests themselves to guard against unexpected changes.

This was extremely challenging as including a proper autocompletion in JavaFX was not simple and straightforward.
For more details, refer to the [Command Autocompletion Internals](#command-autocompletion-internals).

0 comments on commit 30056f6

Please sign in to comment.