2024-02-19 release returns different newText for Implement missing members
compares before release #16714
Closed
Description
rust-analyzer https://github.com/rust-lang/rust-analyzer/releases/tag/2024-02-19 release returns different or error newText for Implement missing members
quickfix, different with 2024-02-12 and before releases.
code snippet to reproduce:
struct Hi {
field: String,
}
impl std::fmt::Debug for Hi {
}
- request code action on
std::fmt::Debug
error - apply
Implement missing members
2024-02-19 release result (omit unnecessary text), the end text is \\}\n
.
Received response 'codeAction/resolve - (22)' in 14ms.
Result: {
"title": "Implement missing members",
"kind": "quickfix",
"edit": {
"documentChanges": [
{
"textDocument": ...,
"edits": [
{
"range": ...,
"newText": "\n $0fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {\n f.debug_struct(\"Hi\").field(\"field\", &self.field).finish()\n \\}\n",
"insertTextFormat": 2
}
]
}
],
"changeAnnotations": ...
}
}
2024-02-12 release, the end is }\n
Received response 'codeAction/resolve - (31)' in 12ms.
Result: {
"title": "Implement missing members",
"kind": "quickfix",
"edit": {
"documentChanges": [
{
"textDocument": ...,
"edits": [
{
"range": ...,
"newText": "\n $0fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {\n f.debug_struct(\"Hi\").field(\"field\", &self.field).finish()\n }\n",
"insertTextFormat": 2
}
]
}
],
"changeAnnotations": ...
}
}
2024-02-19 release added \\
, is this expected or something error? This made the client applied error text fannheyward/coc-rust-analyzer#1228