-
Notifications
You must be signed in to change notification settings - Fork 313
Add guidance for searching multi-line function call chains in Copilot instructions #3138
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
base: main
Are you sure you want to change the base?
Add guidance for searching multi-line function call chains in Copilot instructions #3138
Conversation
Co-authored-by: heaths <[email protected]>
.github/copilot-instructions.md
Outdated
- Do not begin test function names with "test" unless necessary to disambiguate from the function being tested. | ||
- Test functions do not need to be public. | ||
|
||
## Searching for Code Patterns |
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.
@copilot was a whole section necessary? Won't this blow up our token count? Seems you could provide a few bullet points in the Code Generation section above or even add a new "Other Considerations" section for miscellaneous stuff like this. Be concise.
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.
Condensed it into a single bullet point in the Code Generation section. Removed the entire "Searching for Code Patterns" section to reduce token count. (e25e19a → 8fd2f67)
Co-authored-by: heaths <[email protected]>
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.
Worth a try. I thought the individual instructions from before were better.
@copilot add "rustfmt" to |
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.
Pull Request Overview
This PR adds guidance to the Copilot instructions to help with searching multi-line function call chains in Rust code. The issue addressed is that Copilot was searching for method chains as single-line patterns when rustfmt typically formats them across multiple lines.
- Added a bullet point to remind about rustfmt's multi-line formatting of method chains
- Suggests using multi-line search patterns with
rg -U
flag or searching for individual method names - Provides practical guidance to improve code search accuracy
Co-authored-by: heaths <[email protected]>
Added "rustfmt" to |
Summary
Updated the Copilot instructions with concise guidance about searching for multi-line function call chains in Rust code, and added "rustfmt" to the cspell.json dictionary.
Changes:
rg
with-U
flag).vscode/cspell.json
word list in alphabetical orderThis addresses the issue while being much more token-efficient.
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.