Feature Request: Add Line Numbers to Code Snippets
Why It Matters:
When working on large code files (e.g., a 300-line lib.rs
or a very large HTML file), debugging becomes challenging without line numbers. ChatGPT often suggests changes that may be just a line or two of code - and say "add this above the test section in your lib.rs file” - but without line references, users can’t easily pinpoint the target and will ask GPT to provide the entire file over and over for each minor change to prevent errors when pasting in the modified code and perhaps missing a closing bracket, etc.
How It Helps:
- Clarity: ChatGPT could reference exact line numbers (e.g., “Add modified code directly above line 72”).
- Efficiency: Reduces the need to re-share large files, saving tokens and time.
- Reliability: Helps prevent misplacement of code edits.
Proposed Implementation:
- Display line numbers in code snippets - or provide option.
- Reference specific lines in instructions (e.g., “Replace lines 120–122”).
I use ChatGPT many hours each day for programming Rust libraries and binaries - I think this would improve collaboration between the user and AI and would save tokens and reduce unnecessary server use.
Thanks for considering this request.