mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-21 01:24:13 +00:00
f3e9b38e26
fix: escape receiver texts in completion This PR fixes #11897 by escaping '\\' and '$' in the text of the receiver position expression. See [here](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#snippet_syntax) for the specification of the snippet syntax (especially [this section](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#grammar) discusses escaping). Although not all occurrences of '\\' and '$' have to be replaced, I chose to replace all as that's simpler and easier to understand. There *are* more clever ways to implement it, but I thought they were premature optimization for the time being (maybe I should put FIXME notes?). |
||
---|---|---|
.. | ||
attribute | ||
item_list | ||
postfix | ||
attribute.rs | ||
dot.rs | ||
expr.rs | ||
extern_abi.rs | ||
field.rs | ||
flyimport.rs | ||
fn_param.rs | ||
format_string.rs | ||
item_list.rs | ||
keyword.rs | ||
lifetime.rs | ||
mod_.rs | ||
pattern.rs | ||
postfix.rs | ||
record.rs | ||
snippet.rs | ||
type.rs | ||
use_.rs | ||
vis.rs |