Skip to content

Commit 665e992

Browse files
authored
escape the dollar sign for snipper insert (firebase#8614)
* escape the dollar sign for snipper insert * change replaceAll to replace
1 parent 1ce60f5 commit 665e992

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

firebase-vscode/src/data-connect/file-utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@ export function insertToBottomOfActiveFile(text: string) {
6969
return;
7070
}
7171
const lastLine = editor.document.lineAt(editor.document.lineCount - 1);
72+
const escapedText = text.replace(/\$/g, "\\\$"); // escape $ symbols
73+
7274
editor.insertSnippet(
73-
new vscode.SnippetString(`\n\n${text}`),
75+
new vscode.SnippetString(`\n\n${escapedText}`),
7476
lastLine.range.end,
7577
);
7678
}

0 commit comments

Comments
 (0)