fix(tools): normalize line endings on document write and replace operations#93
Open
Gh61 wants to merge 1 commit into
Open
fix(tools): normalize line endings on document write and replace operations#93Gh61 wants to merge 1 commit into
Gh61 wants to merge 1 commit into
Conversation
…ations Agents receive document content with LF line endings but write back with LF regardless of the document native line ending (CRLF on Windows). - detect document line ending via VS ITextBuffer snapshot (same source as the status bar CRLF/LF indicator), with content scan as fallback - normalize incoming content to the document native line ending in document_write, editor_replace, and editor_insert - document_read now consistently outputs LF so agents always see \n
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, thank you for this extension. I use it almost daily when working with Visual Studio.
I came across an issue that has been causing some inconvenience, so I tried to implement a fix for it.
More details are below.
Description
Agents receive document content with LF line endings but write back with LF regardless of the document native line ending (CRLF on Windows).
This caused two issues:
document_writeandeditor_insertsilently converted CRLF files (or its parts) to LFeditor_replacemight fail to find multi-line patterns because\nin the search text didn't match\r\nin the document bufferChanges:
document_write,editor_replace, andeditor_insertdocument_readnow consistently outputs LF so agents always see\nType of Change
feat- New featurefix- Bug fixdocs- Documentation onlyrefactor- Code change that neither fixes a bug nor adds a featuretest- Adding or updating testschore- Maintenance tasksci- CI/CD changesChecklist