Skip to content

package_name_completer behavior is broken by fuzzy-finder #1181

@fujitatomoya

Description

@fujitatomoya

Generated by Generative AI

No response

Operating System:

Linux tomoyafujita-B760M-Pro-RS-D4 6.14.0-37-generic #37~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Nov 20 10:25:38 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

ROS version or commit hash:

rolling source build

RMW implementation (if applicable):

Any

RMW Configuration (if applicable):

No response

Client library (if applicable):

No response

'ros2 doctor --report' output

ros2 doctor --report
<COPY OUTPUT HERE>

Steps to reproduce issue

ros2 run demo_<tab><tab>

Expected behavior

it should auto-complete demo_nodes_, (either demo_nodes_cpp and demo_nodes_py) should be printed as candidates.

Actual behavior

it just does not work, nothing will be suggested via <tab>.

root@tomoyafujita-B760M-Pro-RS-D4:~/ros2_ws/ros2log_dev# ros2 run demo
Package 'demo' not found

in this case, fuzzy-finder also does not work.

Additional information

this is broken because of #1151

the issue is with how argcomplete determines which argument to complete when you have optional positional arguments (nargs='?'). before package_name is required (no nargs specified) and when we type ros2 run demo_, argcomplete knows it must complete the package_name argument. so that the package_name_completer is invoked.

after the PR, package_name is optional (nargs='?') and when we type ros2 run demo_, argcomplete sees that package_name is optional and could be "satisfied" with nothing... it might move on to complete the next argument (executable_name). so that the package_name_completer is skipped or not triggered properly.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions