Commit aded76e
Add guidance for searching multi-line function call chains in Copilot instructions (Azure#3138)
- [x] Review current copilot-instructions.md file structure
- [x] Add guidance section about searching for function call chains
- [x] Provide examples of multi-line Rust method chaining patterns
- [x] Suggest using ripgrep with multi-line search or AST-based tools
- [x] Condense guidance to reduce token count per feedback
- [x] Add rustfmt to cspell.json word list
## 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:
- Removed the separate "Searching for Code Patterns" section to reduce
token count
- Condensed all guidance into a single, concise bullet point in the Code
Generation section
- Removed redundant information while keeping the essential message:
- Awareness that rustfmt formats method chains across multiple lines
- Suggestion to use multi-line search patterns (`rg` with `-U` flag)
- Alternative approach: search for individual method names
- Added "rustfmt" to `.vscode/cspell.json` word list in alphabetical
order
This addresses the issue while being much more token-efficient.
<!-- START COPILOT CODING AGENT SUFFIX -->
<details>
<summary>Original prompt</summary>
>
> ----
>
> *This section details on the original issue you should resolve*
>
> <issue_title>Update Copilot instructions to search for call chains
across multiple lines</issue_title>
> <issue_description>I've noticed lately that Copilot often greps for
function call chains like `obj.foo().bar()` when, in fact, rustfmt
might've reformatted it across multiple lines like,
>
> ```rust
> obj
> .foo()
> .bar();
> ```
>
> Update the copilot-instructions.md to take this into account whenever
it's grep'ing for function call chains.</issue_description>
>
> ## Comments on the Issue (you are @copilot in this section)
>
> <comments>
> </comments>
>
</details>
Fixes Azure#3137
<!-- START COPILOT CODING AGENT TIPS -->
---
💬 Share your feedback on Copilot coding agent for the chance to win a
$200 gift card! Click
[here](https://survey3.medallia.com/?EAHeSx-AP01bZqG0Ld9QLQ) to start
the survey.
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: heaths <[email protected]>1 parent 28cf840 commit aded76e
2 files changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| |||
0 commit comments