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

fix: resolve #986 avoid wrong offset on Neovim for some postfix snippets #966

Merged
merged 6 commits into from
Dec 18, 2024

Conversation

Eric-Song-Nop
Copy link
Collaborator

@Eric-Song-Nop Eric-Song-Nop commented Dec 8, 2024

resolve #986

image1
image2

According to lsp spec, additional text edit is not supposed to be used here.

/**

  • An optional array of additional text edits that are applied when
  • selecting this completion. Edits must not overlap (including the same
  • insert position) with the main edit nor with themselves.
  • Additional text edits should be used to change text unrelated to the
  • current cursor position (for example adding an import statement at the
  • top of the file if the completion item will insert an unqualified type).
    */

@Eric-Song-Nop
Copy link
Collaborator Author

Other uses of additional_text_edits should also be replaced gradually

@Eric-Song-Nop Eric-Song-Nop changed the title fix: avoid additional text_edit fix: avoid wrong offset on Neovim for some postfix snippets Dec 11, 2024
@Eric-Song-Nop
Copy link
Collaborator Author

Eric-Song-Nop commented Dec 11, 2024

I am not sure if this is a common problem, so I am turning this pr in to a specific one for #986, thus the current implementation should be enough.

@Eric-Song-Nop Eric-Song-Nop marked this pull request as ready for review December 11, 2024 15:45
@Eric-Song-Nop Eric-Song-Nop changed the title fix: avoid wrong offset on Neovim for some postfix snippets fix: fix #986 avoid wrong offset on Neovim for some postfix snippets Dec 11, 2024
@Eric-Song-Nop Eric-Song-Nop changed the title fix: fix #986 avoid wrong offset on Neovim for some postfix snippets fix: resolve #986 avoid wrong offset on Neovim for some postfix snippets Dec 11, 2024
@Eric-Song-Nop Eric-Song-Nop self-assigned this Dec 17, 2024
@Myriad-Dreamin Myriad-Dreamin merged commit 5f8a11b into Myriad-Dreamin:main Dec 18, 2024
14 checks passed
@Eric-Song-Nop Eric-Song-Nop deleted the snippet_neovim branch December 18, 2024 14:14
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.

Some postfix snippets are applied in wrong order in Neovim
2 participants