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

MAVExplorer: don't show instances with dump tab completion #1307

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

shancock884
Copy link
Contributor

@shancock884 shancock884 commented Jan 12, 2024

I very much like PR #1303 from @peterbarker - I have often typed dump and pressed tab to be met with nothing!
However, when using the code from this update, I spotted a couple of things that were not quite as I expected...

  • It looks like you meant to link the dump command to new the (MESSAGETYPE) completion that you created, but used (VARIABLE) by mistake, so I changed this.
  • The completion includes message instances as well as messages (i.e. both IMU and IMU[1]), but dump only works with the name without instance, so I updated the filter to remove them.

And nothing to do with the previous PR:

  • When pressing tab on something like "graph BAT[" it was getting an error, so I updated the partially open array regex to use * instead of + for the text after "[" (i.e. allowed to be empty).
  • The regex strings use "\[" and "\]", but this generates python warnings, as it tries to apply the escape sequence before passing to regex. Could have either make them raw strings r"...", but instead decided to keep as regular string and escape the "\".

Use "\\" in regex strings to avoid escape sequence warnings
Handle tab on "MSG[" without error, by changing '+' for '*' in regex
@peterbarker peterbarker merged commit 2d3479e into ArduPilot:master Jan 17, 2024
2 checks passed
@peterbarker
Copy link
Contributor

Merged, thanks!

Did find that we can't tab-complete another message name once you have one on the line...

i.e. graph XKF[0].TimeUS <tab><tab> doesn't complete anything

@shancock884
Copy link
Contributor Author

Did find that we can't tab-complete another message name once you have one on the line...

i.e. graph XKF[0].TimeUS <tab><tab> doesn't complete anything

I think it might be because XKF[0] message may not exist in your log..... should it be something like XKF1[0]? At least this was the case in my logs. If I do graph XKF1[0].TimeUS <tab><tab> it works.
i.e. if you enter anything that doesn't match a param (like graph blah <tab><tab>), then following arguments wont autocomplete.

@shancock884 shancock884 deleted the tab-completion branch January 17, 2024 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants