Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: return empty response to textDocument/formatting if no changes #3142

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

Merged

Conversation

Copy link
Contributor

@danielleontiev danielleontiev commented Mar 30, 2025

Do not send "edits" if the content remains unchanged after LSP formatting. Otherwise, Neovim reports an unsaved buffer even when no actual changes were made

vladimir-popov reacted with thumbs up emoji
Do not send "edits" if the content remains unchanged after LSP
formatting. Otherwise, Neovim reports an unsaved buffer even when no
actual changes were made
@danielleontiev danielleontiev force-pushed the text-document-format-no-changes branch from 7ea9e7c to aa273e3 Compare March 30, 2025 14:31
@danielleontiev danielleontiev changed the title (削除) feat: return empty response to textDocument/formatting if no changes (削除ここまで) (追記) fix: return empty response to textDocument/formatting if no changes (追記ここまで) Mar 30, 2025
@CppCXY CppCXY requested a review from Copilot March 31, 2025 06:59
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR ensures that no edits are sent when the LSP formatting results in no content changes, preventing Neovim from marking buffers as unsaved.

  • Updated changelog entry documenting the fix
  • Clarified behavior of textDocument/formatting
Files not reviewed (1)
  • script/core/formatting.lua: Language not supported

danielleontiev reacted with laugh emoji
Copy link
Collaborator

sumneko commented Apr 5, 2025

Thank you!

@sumneko sumneko merged commit c3334eb into LuaLS:master Apr 5, 2025
11 checks passed
@danielleontiev danielleontiev deleted the text-document-format-no-changes branch April 5, 2025 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

Copilot code review Copilot Copilot left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /