A volunteer group’s Python intake tool imports a CSV roster. A line with a quoted comma in an organization name currently splits into extra columns, and the code owner wants a narrow fix without redesigning the importer. GitHub Copilot Edit Mode is designed for changes to a user-selected working set, with each proposed edit available for review. Unlike broader agent-driven work, this workflow deliberately limits the model to one parser file and one test file. The hypothetical input includes an identifier ‘0042’ and a field ‘A, B Workshop’; the expected result preserves both. This article does not claim to have executed Copilot or tested a real repository.
State the bug and the invariants
Write a failing case before inviting AI suggestions. The example CSV contains id 0042, an organization name written as ‘A, B Workshop’ inside quotes and a valid date. The expected parser returns one field for the organization, preserves the leading zeros in the ID and rejects malformed records with a clear error. Save the current program behavior and the acceptance criteria in a small issue. A correct fix must not change deduplication logic, file encoding, the way existing users download reports or the published schema. Narrow constraints help the reviewer identify unrelated modifications.
Know which IDEs offer Edit Mode
GitHub’s current documentation places Edit Mode in Visual Studio Code and JetBrains IDEs. It lets the user choose which files Copilot can edit and review suggestions after each turn. GitHub’s feature matrix distinguishes Edit Mode from Agent Mode and from Next Edit Suggestions; do not assume every IDE exposes the same controls. Open Copilot Chat and select the edit workflow available in the current extension. If the feature is unavailable, a developer can still prepare a manual patch using ordinary version control and the same tests. An AI toggle is not necessary for good engineering control.
Build a two-file working set
Add only the parser module and its unit test module to the working set. Exclude configuration secrets, database credentials, unrelated UI files and deployment scripts. GitHub documents explicitly adding individual files so the model knows which code it can edit. Use a branch or disposable working tree with an initial clean status. Record the base commit before starting. If Copilot recommends changing a third file, decide separately whether that is genuinely required rather than silently widening the scope. The goal is traceability: a reviewer should be able to explain every changed line and which acceptance criterion it supports.

Prompt for standard CSV behavior
Ask Copilot to use a proper CSV parser or an equivalent robust quoted-field handling approach rather than splitting each line on a comma. Tell it to maintain string identifiers, reject rows with the wrong number of columns and add tests for doubled quotes where relevant. Avoid prompts like ‘rewrite this importer in a cleaner way,’ which invite unnecessary refactors. The model should work within the existing Python version and package policy. If it suggests a dependency, require human review of compatibility and supply-chain implications. The prompt should mention tests and the narrow file boundary explicitly.
Review each edit before acceptance
GitHub explains that Edit Mode provides proposals you can accept or discard after each turn. Inspect the diff for accidental changes to ID conversion, error handling and file output formats. A parser that converts 0042 into the integer 42 is wrong even if the main quoted-comma test passes. Look for code that swallows exceptions and silently drops malformed rows, or tests that merely duplicate the implementation’s assumptions. Do not accept code because it compiles or because the assistant confidently summarizes its changes. Demand a line-by-line account of behavior relevant to the bug and revert unrelated edits.
Add positive and negative regression cases
A minimal test table should include a plain two-column row, a quoted comma, an escaped quote, a blank optional field, a missing required field, duplicate IDs and an ID with leading zeros. Verify that an invalid row yields an expected validation outcome rather than a partial import. Also consider a Unicode organization name and CRLF line endings if the existing importer supports them. State expected values in tests before running them. The visual comparison illustrates an intentionally broken parser versus a reviewed candidate; it is not an observed test report. A good patch makes edge cases visible to future maintainers.

Run tests outside the chat summary
Use the project’s established Python test command locally and compare the results with the baseline. Confirm that the intended tests fail on the old behavior and pass on the proposed change when practical. Record the actual output in the project log; do not invent timing, code-coverage percentages or a green CI status. If the environment lacks the required dependencies, mark the patch unverified until a maintainer can run the suite. Test on safe synthetic data rather than real registrant records. For importers, a destructive integration test should never be run against live production tables just to confirm a model suggestion.
Inspect boundaries and downstream files
Review the output writer, validation rules and consumers that expect a stable set of columns. Even with only two files edited, a behavior change can affect downstream systems; check relevant fixtures or a safe staging pipeline. Confirm duplicate handling still uses textual IDs. Ensure users receive an actionable error instead of a success message for a rejected row. If the fix requires an unavoidable schema change, stop and create a separate reviewed work item. The narrow edit is a deliberate design constraint, not an excuse to ignore side effects. Human code review remains responsible for correctness and security.

Use source control as the final gate
Inspect git status and the staged diff after Copilot finishes. Only the two expected files should be modified unless a reviewer approves and documents an exception. Commit a descriptive change such as ‘Respect quoted CSV fields without normalizing IDs’ and reference the failing test. A second maintainer should review the patch before merge where the project requires it. An AI-generated explanation is useful background but cannot replace test results or repository policy. Save the minimal example CSV in a safe fixture, avoiding real email addresses, access tokens or sensitive participant information.
Distinguish Edit Mode from more autonomous workflows
Agent Mode can choose tasks and run commands, while Edit Mode focuses on a selected working set and user-controlled review. Choose the latter when the defect is bounded and the maintainer wants to inspect each proposed revision. No interface guarantees correctness, and the IDE may rename a control in a newer version. Follow GitHub’s current docs and the actual extension’s behavior rather than a static screenshot. The finished result is a reviewed patch with tests and an explicit boundary around changed files. This tutorial provides a proposed procedure; it is not a claim that a particular model successfully fixed the code.
How We Research
Our research used the following named official vendor documentation: GitHub Docs — Asking Copilot questions in your IDE; GitHub Docs — Copilot feature matrix. We checked the existence and intended purpose of each named feature, documented availability or configuration requirements, and explicit limitations. The workflows were then written around a fictional example that exposes common editorial risks, not around an account we operated. No hands-on product benchmark, real output file, recorded participant, measured accuracy score or legal/compliance review is claimed. All diagrams are independently drawn explanatory illustrations; they are not screenshots. A real project must verify live settings, permissions, source documents, relevant policy and human approval before release.
Frequently Asked Questions
Edit Mode uses a user-selected file working set and offers tighter per-turn review. Agent Mode can plan and act across more of a project.
GitHub documents it for Visual Studio Code and JetBrains IDEs; check current extension support for your account.
Yes. GitHub describes adding individual files to the Edit Mode working set for scoped changes.
Converting them to integers discards leading zeros and can break joins, lookups and downstream records.
No. Run the project tests, inspect the diff and follow human code review before merge.
