-
-
Notifications
You must be signed in to change notification settings - Fork 69
fix: fix example function params order #897
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: fix example function params order #897
Conversation
WalkthroughDocumentation example updated to reflect a public API signature change for the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
HerringtonDarkholme
left a comment
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.
thanks!
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
website/guide/api-usage/js-api.md (1)
128-130: Refactor to avoid variable shadowing of thekindfunction.Line 129 shadows the
kindfunction with a variable of the same name (const kind = kind(...)), which can confuse readers of documentation examples. This practice is generally discouraged in educational code.Consider renaming the variable to something more descriptive:
let l = Lang.JavaScript // calling kind function requires Lang -const kind = kind(l, 'string') // convert kind name to kind id number -root.find(kind) // returns SgNode of string +const stringKind = kind(l, 'string') // convert kind name to kind id number +root.find(stringKind) // returns SgNode of stringThis makes it clearer that we're converting a kind name to its numeric ID before using it.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
website/guide/api-usage/js-api.md(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
website/**/*.md
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
website/**/*.md: Documentation should use clear, concise language
Include code examples for concepts in documentation
Test documentation examples in the playground when possible
Maintain consistent formatting across documentation pages
Files:
website/guide/api-usage/js-api.md
🔇 Additional comments (1)
website/guide/api-usage/js-api.md (1)
121-121: Parameter order documentation is verified and consistent.The documentation correctly reflects the updated
kindfunction signature withLangas the first parameter. Line 121's explanation and the code example on line 129 both use the same parameter order:kind(Lang.JavaScript, 'function').Note: Line 129 uses
const kind = kind(l, 'string'), which shadows thekindfunction name. Consider renaming the variable tokindIdor similar for improved clarity in documentation examples.
It should be
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.