-
Notifications
You must be signed in to change notification settings - Fork 519
Fix syntax errors #1081
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
Fix syntax errors #1081
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thnanks for giving this a good look!
I think the snippets in the sections preceding "Multiple completer" don't make as much sense after #1049?
z => $zoxide_completer | ||
zi => $zoxide_completer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mhh this is not valid Nu code outside of a match
. There may be some work necessary to get this section up to date. Previously, before match
existed things like this where handled with records for which this is the correct syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still a bit lost with everything. Just reading the docs it says that "This completer is not usable for allmost every other command, so it's recommended to add it as an override in the multiple completer:". I copy-pasted it to the appropriate place and got the syntax error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mhh maybe @JoaquinTrinanes has a recommendation for that, as he set up his completions with match
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No wonder it doesn't work, those snippets where written when the completer options were a record | get | default
instead of a match
😅
As far as I can tell these changes should be enough, but maybe it should be made clearer where this configuration goes, and emphasize that it's a match statement?
Or just writing it as
match $spans.0 {
...
__zoxide_z | __zoxide_zi => $zoxide_completer
...
}
Btw, found a typo at This completer is not usable for alLmost ...
Happy to lend a hand rewriting this if needed :) As far as I can see no other snippets need updating. And if users are using the multiple_completer
from the cookbook they shouldn't run into any issue if we leave this written as-is (with the invalid match syntax) as it'll be pasted in a correct match statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed the typo and added zoxide to the full example, I hope this is what you had in mind.
@@ -68,8 +68,7 @@ Sometimes, a single external completer is not flexible enough. Luckily, as many | |||
|
|||
```nu | |||
let multiple_completers = {|spans| | |||
match $spans.0 | |||
{ | |||
match $spans.0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
94c6e4b
to
d6271ff
Compare
I tried copying the examples but got errors like
I just got started using nushell so this might be wrong.