Skip to content

Commit 2d51e28

Browse files
authored
Merge pull request #1160 from alexanderwoehler/fix-snippets
fix(snippets): fixed existence-check snippets
2 parents 81125b8 + 1fc9819 commit 2d51e28

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Diff for: server/src/snippets.ts

+10-6
Original file line numberDiff line numberDiff line change
@@ -153,16 +153,20 @@ export const SNIPPETS: BashCompletionItem[] = [
153153
{
154154
label: 'if-defined',
155155
documentation: 'if with variable existence check',
156-
insertText: ['if [[ -n "${${1:variable}+x}" ]]', '\t${2:command ...}', 'fi'].join(
157-
'\n',
158-
),
156+
insertText: [
157+
'if [[ -n "${${1:variable}+x}" ]]; then',
158+
'\t${2:command ...}',
159+
'fi',
160+
].join('\n'),
159161
},
160162
{
161163
label: 'if-not-defined',
162164
documentation: 'if with variable existence check',
163-
insertText: ['if [[ -z "${${1:variable}+x}" ]]', '\t${2:command ...}', 'fi'].join(
164-
'\n',
165-
),
165+
insertText: [
166+
'if [[ -z "${${1:variable}+x}" ]]; then',
167+
'\t${2:command ...}',
168+
'fi',
169+
].join('\n'),
166170
},
167171
{
168172
label: 'while',

0 commit comments

Comments
 (0)