escape the special character (#22141)

This commit is contained in:
Alan Ren
2023-03-03 23:57:40 -08:00
committed by GitHub
parent 0f813a9900
commit b5a9a3647b

View File

@@ -375,7 +375,8 @@ class DropOverlay extends Themable {
// {{SQL CARBON EDIT}}
const editor = this.editorService.activeTextEditorControl as ICodeEditor;
if (supportsNodeNameDrop(untitledOrFileResources[0].resource.scheme) || untitledOrFileResources[0].resource.scheme === 'Folder') {
SnippetController2.get(editor).insert(untitledOrFileResources[0].resource.query);
// Snippet support variable and $ is the reserved character, need to escape it so that it will treated as a normal character.
SnippetController2.get(editor).insert(untitledOrFileResources[0].resource.query?.replace(/\$/g, '\\$'));
editor.focus();
return;
}