Skip to content

Commit 07e729e

Browse files
authored
Merge pull request #1258 from dezza/patch-1
fix(snippets): escape literal $
2 parents ba8e6eb + 1fce98a commit 07e729e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

server/src/snippets.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export const SNIPPETS: BashCompletionItem[] = [
154154
label: 'if-defined',
155155
documentation: 'if with variable existence check',
156156
insertText: [
157-
'if [[ -n "${${1:variable}+x}" ]]; then',
157+
'if [[ -n "\\${${1:variable}+x}" ]]; then',
158158
'\t${2:command ...}',
159159
'fi',
160160
].join('\n'),
@@ -163,7 +163,7 @@ export const SNIPPETS: BashCompletionItem[] = [
163163
label: 'if-not-defined',
164164
documentation: 'if with variable existence check',
165165
insertText: [
166-
'if [[ -z "${${1:variable}+x}" ]]; then',
166+
'if [[ -z "\\${${1:variable}+x}" ]]; then',
167167
'\t${2:command ...}',
168168
'fi',
169169
].join('\n'),
@@ -278,7 +278,7 @@ export const SNIPPETS: BashCompletionItem[] = [
278278
label: 'while-defined',
279279
documentation: 'while with variable existence check',
280280
insertText: [
281-
'while [[ -n "${${1:variable}+x}" ]]',
281+
'while [[ -n "\\${${1:variable}+x}" ]]',
282282
'\t${2:command ...}',
283283
'done',
284284
].join('\n'),
@@ -287,7 +287,7 @@ export const SNIPPETS: BashCompletionItem[] = [
287287
label: 'while-not-defined',
288288
documentation: 'while with variable existence check',
289289
insertText: [
290-
'while [[ -z "${${1:variable}+x}" ]]',
290+
'while [[ -z "\\${${1:variable}+x}" ]]',
291291
'\t${2:command ...}',
292292
'done',
293293
].join('\n'),
@@ -402,7 +402,7 @@ export const SNIPPETS: BashCompletionItem[] = [
402402
label: 'until-defined',
403403
documentation: 'until with variable existence check',
404404
insertText: [
405-
'until [[ -n "${${1:variable}+x}" ]]',
405+
'until [[ -n "\\${${1:variable}+x}" ]]',
406406
'\t${2:command ...}',
407407
'done',
408408
].join('\n'),
@@ -411,7 +411,7 @@ export const SNIPPETS: BashCompletionItem[] = [
411411
label: 'until-not-defined',
412412
documentation: 'until with variable existence check',
413413
insertText: [
414-
'until [[ -z "${${1:variable}+x}" ]]',
414+
'until [[ -z "\\${${1:variable}+x}" ]]',
415415
'\t${2:command ...}',
416416
'done',
417417
].join('\n'),
@@ -429,7 +429,7 @@ export const SNIPPETS: BashCompletionItem[] = [
429429
label: 'for-range',
430430
documentation: 'for with range',
431431
insertText: [
432-
'for ${1:item} in $(seq ${2:from} ${3:to}); do',
432+
'for ${1:item} in \\$(seq ${2:from} ${3:to}); do',
433433
'\t${4:command ...}',
434434
'done',
435435
].join('\n'),
@@ -438,7 +438,7 @@ export const SNIPPETS: BashCompletionItem[] = [
438438
label: 'for-stepped-range',
439439
documentation: 'for with stepped range',
440440
insertText: [
441-
'for ${1:item} in $(seq ${2:from} ${3:step} ${4:to}); do',
441+
'for ${1:item} in \\$(seq ${2:from} ${3:step} ${4:to}); do',
442442
'\t${5:command ...}',
443443
'done',
444444
].join('\n'),

0 commit comments

Comments
 (0)