From 1fc9819288fc679f983d2a8e662b10161bd48f0e Mon Sep 17 00:00:00 2001 From: alexanderwoehler Date: Fri, 10 May 2024 11:16:54 +0200 Subject: [PATCH] fix(snippets): add missing "then" to existence checks --- server/src/snippets.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/server/src/snippets.ts b/server/src/snippets.ts index 3996c099..5f471805 100644 --- a/server/src/snippets.ts +++ b/server/src/snippets.ts @@ -153,16 +153,20 @@ export const SNIPPETS: BashCompletionItem[] = [ { label: 'if-defined', documentation: 'if with variable existence check', - insertText: ['if [[ -n "${${1:variable}+x}" ]]', '\t${2:command ...}', 'fi'].join( - '\n', - ), + insertText: [ + 'if [[ -n "${${1:variable}+x}" ]]; then', + '\t${2:command ...}', + 'fi', + ].join('\n'), }, { label: 'if-not-defined', documentation: 'if with variable existence check', - insertText: ['if [[ -z "${${1:variable}+x}" ]]', '\t${2:command ...}', 'fi'].join( - '\n', - ), + insertText: [ + 'if [[ -z "${${1:variable}+x}" ]]; then', + '\t${2:command ...}', + 'fi', + ].join('\n'), }, { label: 'while',