-
Notifications
You must be signed in to change notification settings - Fork 30k
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
doc: fix an unclear wording in readline.md #12605
Conversation
@@ -403,8 +403,8 @@ a `'resize'` event on the `output` if or when the columns ever change | |||
|
|||
### Use of the `completer` Function | |||
|
|||
When called, the `completer` function is provided the current line entered by |
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.
Maybe just provided
-> passed
?
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.
Without a preposition? 'When called, the completer
function is passed the current line...'? I am a bit confused by this passive voice. Can we say 'Provide the function a line' without a preposition? It seems we can say 'Pass the function a line', so the passive can be without a preposition here?
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.
Yes, passed
is transitive so works.
When called, the completer function is provided the current line entered by the user
=== When the completer function is called (by Node.js), the current line entered by the user is passed to it
.
I know we normally prefer the active voice, nothing against using that here, the only issue is that AIUI this is a callback function, so it is called
by the Node.js readline code, the arguments are passed into it, and Node expects it to return an Array. So you can't say Provide the function a line
, because the user doesn't do that, Node does.
You could maybe say something like:
The
completer
function takes the current line entered by the user as an argument, and returns an Array with 2 entries:
I defer to you on what's clearer.
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 shall use your last variant and let's see if anybody come along with us)
Landed in 2098775 |
PR-URL: #12605 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #12605 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #12605 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #12605 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #12605 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs/node#12605 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Checklist
Affected core subsystem(s)
doc, readline
As a not native speaker, I am not sure if this is really a typo. If not, sorry for the bothering)