Skip to content

fix: use valid ranges for heading code actions - #486

Open
ShiroKSH wants to merge 1 commit into
Feel-ix-343:mainfrom
ShiroKSH:fix/codeaction-eof-range
Open

fix: use valid ranges for heading code actions#486
ShiroKSH wants to merge 1 commit into
Feel-ix-343:mainfrom
ShiroKSH:fix/codeaction-eof-range

Conversation

@ShiroKSH

@ShiroKSH ShiroKSH commented Aug 1, 2026

Copy link
Copy Markdown

Summary

Fix heading-creation code actions to insert at the actual end of the target document instead of returning a reversed TextEdit range.

Add regression coverage for new documents, files without a trailing newline, and files ending with a newline.

Why

The previous edit started one line after it ended, which makes the action invalid under the Language Server Protocol and causes compliant clients to reject it.

Checks

  • cargo fmt --check
  • cargo test (80 passed)

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.

1 participant