-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
extract function broken the codes, add redundant slash #16867
Comments
Hmm... The |
With RA 2024-03-11 version, the problem exists. What's RA version your are using? @roife |
rust-analyzer version: 0.3.1877-standalone (574e23e 2024-03-09) |
I believe this is a dup of #16607. However, I agree with @xusd320 that this problem is not completely resolved. Coming from Neovim with The thing is that
#16475 being a purely TypeScript update, didn't fix anything on the LSP side of the things. Or is there anything wrong with Neovim's interpretation of (@DropDemBits maybe you can provide more insights on this one?) |
Yeah, I tried all versions after 2024-02-19, be sure the problem is not fixed. |
Just tried again with the debug logs on the following snippet: impl std::fmt::Display for SelfUpdateMode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(match self {
SelfUpdateMode::Enable => "enable",
SelfUpdateMode::Disable => "disable",
SelfUpdateMode::CheckOnly => "check-only",
})
}
} When I was making r-a generate a [DEBUG][2024-03-20 13:02:32] .../vim/lsp/rpc.lua:387 "rpc.receive" { id = 61, jsonrpc = "2.0", result = { edit = { documentChanges = { { edits = { { insertTextFormat = 2, newText = "\n fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {\n ${0:todo!()}\n \\}", range = { ["end"] = { character = 43, line = 134 }, start = { character = 43, line = 134 } } } }, textDocument = { uri = "file://<SNIP>/rustup/src/cli/self_update.rs", version = 5 } } } }, kind = "quickfix", title = "Implement missing members" }}
[DEBUG][2024-03-20 13:02:32] .../vim/lsp/rpc.lua:284 "rpc.send" { jsonrpc = "2.0", method = "textDocument/didChange", params = { contentChanges = { { range = { ["end"] = { character = 43, line = 134 }, start = { character = 43, line = 134 } }, rangeLength = 0, text = "\n fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {\n todo!()\n \\}" } }, textDocument = { uri = "file:///<SNIP>/rustup/src/cli/self_update.rs", version = 6 } }} I'm not sure where did this |
Per the grammar section of the LSP Snippet Syntax page,
So I believe this is a Neovim-side issue? |
@DropDemBits Thanks for the reply! After some discussions with @roife I have the same feeling. That same RPC response above can be correctly received by VSCode so in theory there could be a problem in its parsing with Neovim. We'll try to do some more investigations. |
Curious if you've tried the nightly version of Neovim, since it has this PR merged in which seems relevant 😁 |
@DropDemBits Thanks! Anyway, in that case I think it's okay for @xusd320 to close this issue as resolved 🤦 Sorry for all the trouble! |
Great!Thanks for your investigatiing. |
@xusd320 I did even more research on this. My previous report on Neovim 0.10 wasn't quite precise, but I'm sure it's a problem on Neovim's side anyway, so still safe to keep it closed on It's still about the experimental LSP flag |
update: add editor/extension information to bug report template When attempting to reproduce issues, I encounter difficulties due to differences in versions of LSP clients and editors (such as #16985, #16867, and more) This sometimes consumes a lot of efforts from contributors to communicate the details about LSP client information. Therefore, I believe adding editor/extension information to the issue template would be helpful for problem reproduction.
As you can see in blow gif, a redundant slash added before the end of extracted fn. With rust-analyzer 2024-02-12 version, no that redundant slash. I guess it may the related to #16618 according to the version timeline, not very sure.
rust-analyzer version: 0.3.1850-standalone (68c506f 2024-02-19)
rustc version: 1.76.0 (07dca489a 2024-02-04)
relevant settings:
repository link (if public, optional): None
code snippet to reproduce:
The text was updated successfully, but these errors were encountered: