-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
tools,doc: fix json result of grouped optional params #5977
tools,doc: fix json result of grouped optional params #5977
Conversation
@@ -1342,7 +1342,7 @@ The synchronous version of [`fs.writeFile()`][]. Returns `undefined`. | |||
## fs.writeSync(fd, data[, position[, encoding]]) | |||
|
|||
* `fd` {Integer} | |||
* `buffer` {String | Buffer} | |||
* `data` {String | Buffer} |
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.
this should probably go in a different PR. Good catch though :)
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 will make another PR for it. It was found while testing this patch :D Thanks!
8b0b25a
to
78715c4
Compare
The commit has been amended. Please review again. |
Generally LGTM, would be nice to add a comment above it to explain that it's there to address optional parameters that are grouped. |
78715c4
to
23b3421
Compare
Sure! The comment has been added. Thank you! |
LGTM if @nodejs/documentation is happy |
LGTM. Minor nit: could you post the difference of the JSON? Good work on the tooling @firedfox ! |
Sure! This is the diff result of all.markdown: http://106.187.89.52/tmp/dbc33ac-doc-json-all.diff.html |
// for grouped optional params such as someMethod(a[, b[, c]]) | ||
var pos; | ||
for (pos = 0; pos < p.length; pos++) { | ||
if ('[ ]'.indexOf(p[pos]) === -1) { break; } |
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.
You can use optionalCharDict
itself, to check if the current char is in it or not.
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 idea! Thanks!
Current tools/doc/json.js only supports one bracket style for optional params methodName(param0[,param1],param2). Add support to other styles such as methodName(param0,[param1,]param2) or methodName(param0[,param1,param2]) or methodName(param0[,param1[,param2]])
23b3421
to
e94fe00
Compare
Updated. Thanks guys! It looks much better than my first commit. |
@thefourtheye ... ping |
LGTM |
Thanks! Landed in 6222e5b. |
Current tools/doc/json.js only supports one bracket style for optional params methodName(param0[,param1],param2). Add support to other styles such as methodName(param0,[param1,]param2) or methodName(param0[,param1,param2]) or methodName(param0[,param1[,param2]]). PR-URL: #5977 Fixes: #5976 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Lindstädt <robert.lindstaedt@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Current tools/doc/json.js only supports one bracket style for optional params methodName(param0[,param1],param2). Add support to other styles such as methodName(param0,[param1,]param2) or methodName(param0[,param1,param2]) or methodName(param0[,param1[,param2]]). PR-URL: #5977 Fixes: #5976 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Lindstädt <robert.lindstaedt@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Current tools/doc/json.js only supports one bracket style for optional params methodName(param0[,param1],param2). Add support to other styles such as methodName(param0,[param1,]param2) or methodName(param0[,param1,param2]) or methodName(param0[,param1[,param2]]). PR-URL: #5977 Fixes: #5976 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Lindstädt <robert.lindstaedt@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Current tools/doc/json.js only supports one bracket style for optional params methodName(param0[,param1],param2). Add support to other styles such as methodName(param0,[param1,]param2) or methodName(param0[,param1,param2]) or methodName(param0[,param1[,param2]]). PR-URL: #5977 Fixes: #5976 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Lindstädt <robert.lindstaedt@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Current tools/doc/json.js only supports one bracket style for optional params methodName(param0[,param1],param2). Add support to other styles such as methodName(param0,[param1,]param2) or methodName(param0[,param1,param2]) or methodName(param0[,param1[,param2]]). PR-URL: #5977 Fixes: #5976 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Lindstädt <robert.lindstaedt@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Current tools/doc/json.js only supports one bracket style for optional params methodName(param0[,param1],param2). Add support to other styles such as methodName(param0,[param1,]param2) or methodName(param0[,param1,param2]) or methodName(param0[,param1[,param2]]). PR-URL: #5977 Fixes: #5976 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Lindstädt <robert.lindstaedt@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Current tools/doc/json.js only supports one bracket style for optional params methodName(param0[,param1],param2). Add support to other styles such as methodName(param0,[param1,]param2) or methodName(param0[,param1,param2]) or methodName(param0[,param1[,param2]]). PR-URL: #5977 Fixes: #5976 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Lindstädt <robert.lindstaedt@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Current tools/doc/json.js only supports one bracket style for optional params methodName(param0[,param1],param2). Add support to other styles such as methodName(param0,[param1,]param2) or methodName(param0[,param1,param2]) or methodName(param0[,param1[,param2]]). PR-URL: #5977 Fixes: #5976 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Lindstädt <robert.lindstaedt@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Pull Request check-list
make -j8 test
(UNIX) orvcbuild test nosign
(Windows) pass withthis change (including linting)?
If this change fixes a bug (or a performance problem), is a regressiontest (or a benchmark) included?
existing APIs, or introduces new ones)?
Affected core subsystem(s)
Description of change
fixes #5976