Skip to content

Commit 329754d

Browse files
EmilySeville7cfgEmilySeville7cfg
authored andcommitted
feat(snippets): completion
1 parent 86c1ee4 commit 329754d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

server/src/snippets.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,18 @@ export const SNIPPETS: BashCompletionItem[] = [
639639
label: 'device',
640640
insertText: '/dev/${1|null,stdin,stdout,stderr|}',
641641
},
642+
{
643+
documentation: 'completion',
644+
label: 'completion definition',
645+
insertText: [
646+
'_$1_completions()',
647+
'{',
648+
'\treadarray -t COMPREPLY < <(compgen -W "-h --help -v --version" "${COMP_WORDS[1]}")',
649+
'}',
650+
'',
651+
'complete -F _$1_completions ${1:command}',
652+
].join('\n'),
653+
},
642654
{
643655
documentation: 'comment',
644656
label: 'comment definition',

0 commit comments

Comments
 (0)