Skip to content
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

handle content when it's an empty string #1100

Merged
merged 1 commit into from
Apr 14, 2023
Merged

handle content when it's an empty string #1100

merged 1 commit into from
Apr 14, 2023

Conversation

augustfengd
Copy link
Contributor

@augustfengd augustfengd commented Apr 12, 2023

WHAT

🤖 Generated by Copilot at 19c74a2

Fix text document change handling for whole first line replacements in FsAutoComplete.Lsp.fs. Use named text instead of text edit to avoid line ending and offset issues.

🤖 Generated by Copilot at 19c74a2

text document change
special case for first line
autumn leaves falling

📝🐛🚀

WHY

FSAC currently crashes when the buffer is empty and we type something. I thought I saw the same behaviour on the F# Data Adaptive version, but I was wrong. Since the latter doesn't suffer from this edge case so no need for code change there.

Fixes #1091

HOW

🤖 Generated by Copilot at 19c74a2

  • Add a special case for text document changes that replace the entire first line (link). This avoids potential issues with line endings and offsets when applying the change to the file system. This affects the FsAutoComplete.Lsp.fs file, which implements the F# language server protocol.

@TheAngryByrd TheAngryByrd merged commit 6407c0f into ionide:main Apr 14, 2023
@TheAngryByrd
Copy link
Member

Thanks!

@augustfengd augustfengd deleted the handle-empty-string branch April 15, 2023 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fsac crashes when the file is empty
2 participants