@@ -2145,51 +2145,71 @@ fn bar(_: usize) {}
2145
2145
fn snippet_rendering_escape_snippet_bits ( ) {
2146
2146
// only needed for snippet formats
2147
2147
let mut edit = TextEdit :: builder ( ) ;
2148
- edit. insert ( 0 . into ( ) , r"abc\def$" . to_owned ( ) ) ;
2149
- edit. insert ( 8 . into ( ) , r"ghi\jkl$" . to_owned ( ) ) ;
2148
+ edit. insert ( 0 . into ( ) , r"$ab{}$c\def" . to_owned ( ) ) ;
2149
+ edit. insert ( 8 . into ( ) , r"ghi\jk<-check_insert_here$" . to_owned ( ) ) ;
2150
+ edit. insert ( 10 . into ( ) , r"a\\b\\c{}$" . to_owned ( ) ) ;
2150
2151
let edit = edit. finish ( ) ;
2151
- let snippets =
2152
- SnippetEdit :: new ( vec ! [ Snippet :: Placeholder ( TextRange :: new( 0 . into( ) , 3 . into( ) ) ) ] ) ;
2152
+ let snippets = SnippetEdit :: new ( vec ! [
2153
+ Snippet :: Placeholder ( TextRange :: new( 1 . into( ) , 9 . into( ) ) ) ,
2154
+ Snippet :: Tabstop ( 25 . into( ) ) ,
2155
+ ] ) ;
2153
2156
2154
2157
check_rendered_snippets (
2155
2158
edit,
2156
2159
snippets,
2157
2160
expect ! [ [ r#"
2158
- [
2159
- SnippetTextEdit {
2160
- range: Range {
2161
- start: Position {
2162
- line: 0,
2163
- character: 0,
2164
- },
2165
- end: Position {
2166
- line: 0,
2167
- character: 0,
2161
+ [
2162
+ SnippetTextEdit {
2163
+ range: Range {
2164
+ start: Position {
2165
+ line: 0,
2166
+ character: 0,
2167
+ },
2168
+ end: Position {
2169
+ line: 0,
2170
+ character: 0,
2171
+ },
2168
2172
},
2173
+ new_text: "\\$${1:ab{}\\$c\\\\d}ef",
2174
+ insert_text_format: Some(
2175
+ Snippet,
2176
+ ),
2177
+ annotation_id: None,
2169
2178
},
2170
- new_text: "${0:abc}\\\\def\\$",
2171
- insert_text_format: Some(
2172
- Snippet,
2173
- ),
2174
- annotation_id: None,
2175
- },
2176
- SnippetTextEdit {
2177
- range: Range {
2178
- start: Position {
2179
- line: 0,
2180
- character: 8,
2179
+ SnippetTextEdit {
2180
+ range: Range {
2181
+ start: Position {
2182
+ line: 0,
2183
+ character: 8,
2184
+ },
2185
+ end: Position {
2186
+ line: 0,
2187
+ character: 8,
2188
+ },
2181
2189
},
2182
- end: Position {
2183
- line: 0,
2184
- character: 8,
2190
+ new_text: "ghi\\\\jk$0<-check_insert_here\\$",
2191
+ insert_text_format: Some(
2192
+ Snippet,
2193
+ ),
2194
+ annotation_id: None,
2195
+ },
2196
+ SnippetTextEdit {
2197
+ range: Range {
2198
+ start: Position {
2199
+ line: 0,
2200
+ character: 10,
2201
+ },
2202
+ end: Position {
2203
+ line: 0,
2204
+ character: 10,
2205
+ },
2185
2206
},
2207
+ new_text: "a\\\\b\\\\c{}$",
2208
+ insert_text_format: None,
2209
+ annotation_id: None,
2186
2210
},
2187
- new_text: "ghi\\jkl$",
2188
- insert_text_format: None,
2189
- annotation_id: None,
2190
- },
2191
- ]
2192
- "# ] ] ,
2211
+ ]
2212
+ "# ] ] ,
2193
2213
) ;
2194
2214
}
2195
2215
0 commit comments