mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-23 03:44:23 +00:00
fix errors
This commit is contained in:
parent
3a0234d60f
commit
2f82a84d2a
4 changed files with 11 additions and 6 deletions
|
@ -62,6 +62,8 @@ function parseSnippet(snip: string): [string, [number, number]] | undefined {
|
|||
const m = snip.match(/\$(0|\{0:([^}]*)\})/);
|
||||
if (!m) return undefined;
|
||||
const placeholder = m[2] ?? "";
|
||||
if (m.index == null)
|
||||
return undefined;
|
||||
const range: [number, number] = [m.index, placeholder.length];
|
||||
const insert = snip.replace(m[0], placeholder);
|
||||
return [insert, range];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue