-
Notifications
You must be signed in to change notification settings - Fork 203
Issue730 #226
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
Draft
FlorianPommerening
wants to merge
44
commits into
aibasel:main
Choose a base branch
from
speckdavid:issue730
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Issue730 #226
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
af4e2c8
[issue730] added argcomplete for driver arguments if installed
speckdavid 2a34d67
[issue730] started with logic for tab completion
speckdavid 5be8779
start with completion in search component
FlorianPommerening c784126
started communiaction between driver and search component
speckdavid 64713a9
some prelim fixes and style
speckdavid e3aaf18
logic of argcomplete
speckdavid c0e0b8a
tab completion for translator option when called as standalone and vi…
speckdavid d5de54f
minor
speckdavid ddd7f84
some intermediate fixes
speckdavid 3741663
some logic fixes
speckdavid 816f983
forward cursor point to c++
FlorianPommerening ed83082
always set completer
FlorianPommerening 8083992
reduce code duplication and simplify logic
FlorianPommerening 75b6440
work on broken translate completion via driver
speckdavid 9bda42c
extract functions for forwarding calls and fix bugs
FlorianPommerening 91048da
added file completer to search component for --internal-plan-file op…
speckdavid 05aa478
Make path handling OS-agnostic by using std::filesystem::path::prefer…
speckdavid b37280b
file completion for search component
speckdavid 43cf4d7
tab completion docu
speckdavid a1f8b80
removed unncessary variable
speckdavid b5826a8
missing instructions for tab completion
speckdavid 57e0f4c
removed file completer in search component and rely on a default bash…
speckdavid 6011133
enable tab completion in build.py
FlorianPommerening 228a1f2
remove redundant import
FlorianPommerening 0aec464
handle default differently from aliases
FlorianPommerening e7151b0
improved tab completion setup instructions
speckdavid bed863b
fixed build script. no search configuration suggestions
speckdavid 39a5d35
fixed issue with remaining args related to '-j' options
speckdavid 962d2d0
imporved tab completion
speckdavid 3ba6f84
code review of build.py
FlorianPommerening 2276c0b
extract warning function and use BUILDS_DIR
FlorianPommerening def3f5a
worked on code clarity and fixed issues
speckdavid 5ed1356
minor
speckdavid 7c167dc
call translator standalone for tab completion
FlorianPommerening 5a23b09
reset translator
FlorianPommerening 23ae10a
style
FlorianPommerening 4f5b847
zsh completion with help
FlorianPommerening fc46d83
style
FlorianPommerening 7a270a0
changes from code review
FlorianPommerening 8564b91
avoid computing default build in two places.
FlorianPommerening a239859
code review
FlorianPommerening 8f6c57b
fix tests and typo
FlorianPommerening 12b81aa
discuss local and global activation of argcomplete
FlorianPommerening 0762dc2
fixed pip install comment
speckdavid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| ## Tab completion for Fast Downward | ||
|
|
||
| We support tab completion for bash and zsh based on the python package [argcomplete](https://pypi.org/project/argcomplete/). For full support, use at least version 3.3 which can be installed via `pip`. | ||
|
|
||
| ```bash | ||
| pip install "argcomplete>=3.3" | ||
| ``` | ||
|
|
||
| After the installation, tab completion has to be enabled in one of two ways. | ||
|
|
||
|
|
||
| ### Activating tab completion globally | ||
|
|
||
| The global activation will enable tab completion for *all* Python files that support argcomplete (not only files related to Fast Downward). To activate the global tab completion execute the following command. Depending on your installation replace `activate-global-python-argcomplete` with `activate-global-python-argcomplete3`. | ||
|
|
||
| ```bash | ||
| activate-global-python-argcomplete | ||
| ``` | ||
|
|
||
|
|
||
| ### Activating tab completion locally | ||
|
|
||
| In contrast to global activation, local activation only enables tab completion for files called `fast-downward.py`, `build.py`, or `translate.py`. However, activation is not limited to files that support argcomplete. This means that pressing tab on older version of Fast Downward files or unrelated files with the same name may have unintended side effects. For example, with older version of Fast Downward `build.py <TAB>` will start a build without printing the output. | ||
|
|
||
| To activate the local tab completion, add the following commands to your `.bashrc` or `.zshrc`. Depending on your installation replace `register-python-argcomplete` with `register-python-argcomplete3`. | ||
|
|
||
| ```bash | ||
| eval "$(register-python-argcomplete fast-downward.py)" | ||
| eval "$(register-python-argcomplete build.py)" | ||
| eval "$(register-python-argcomplete translate.py)" | ||
| ``` | ||
|
|
||
| ### Activating tab completion for the search binary | ||
|
|
||
| If you are working with the search binary `downward` directly, adding the following commands to your `.bashrc` or `.zshrc` will enable tab completion. This is only necessary if you are not using the driver script `fast-downward.py`. | ||
|
|
||
| ```bash | ||
| function _downward_complete() { | ||
| local IFS=$'\013' | ||
| if [[ -n "${ZSH_VERSION-}" ]]; then | ||
| local DFS=":" | ||
| local completions | ||
| local COMP_CWORD=$((CURRENT - 1)) | ||
| completions=( $( "${words[1]}" --bash-complete \ | ||
| "$IFS" "$DFS" "$CURSOR" "$BUFFER" "$COMP_CWORD" ${words[@]})) | ||
| if [[ $? == 0 ]]; then | ||
| _describe "${words[1]}" completions -o nosort | ||
| fi | ||
| else | ||
| local DFS="" | ||
| COMPREPLY=( $( "$1" --bash-complete \ | ||
| "$IFS" "$DFS" "$COMP_POINT" "$COMP_LINE" "$COMP_CWORD" ${COMP_WORDS[@]})) | ||
| if [[ $? != 0 ]]; then | ||
| unset COMPREPLY | ||
| fi | ||
| fi | ||
| } | ||
|
|
||
| if [[ -n "${ZSH_VERSION-}" ]]; then | ||
| compdef _downward_complete downward | ||
| else | ||
| complete -o nosort -F _downward_complete downward | ||
| fi | ||
| ``` | ||
|
|
||
| Restart your shell afterwards. | ||
|
FlorianPommerening marked this conversation as resolved.
|
||
|
|
||
|
|
||
| ### Limitations | ||
|
|
||
| The search configuration following the `--search` option is not yet covered by tab completion. For example, `fast-downward.py problem.pddl --search "ast<TAB>"` will not suggest `astar`. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.