From 538e9f7613fc5b30505ae3fb004ca67bbde73015 Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Tue, 6 Apr 2021 09:55:15 -0500 Subject: [PATCH] tweak to include subcommand command names --- gen-ts-ext.nu | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/gen-ts-ext.nu b/gen-ts-ext.nu index a6077f2..a7ce95c 100644 --- a/gen-ts-ext.nu +++ b/gen-ts-ext.nu @@ -18,13 +18,8 @@ export function activate(context: vscode.ExtensionContext) { # generate typescript from nushell commands def gen-ts-cmds [] { - # help commands | do -i { each { where $it.subcommands == $nothing }} | where description != '' | select name description | insert camel foo | each { update camel { build-string $it.name 'Completion' | str camel-case }} - - # const ansiCompletion = new vscode.CompletionItem('ansi'); - # ansiCompletion.commitCharacters = [' ']; - # ansiCompletion.documentation = new vscode.MarkdownString('Press SpaceBar to get completions'); - - let cmds = $(help commands | do -i { each { where $it.subcommands == $nothing }} | where description != '' | select name description) + # let cmds = $(help commands | do -i { each { where $it.subcommands == $nothing }} | where description != '' | select name description) + let cmds = $(help commands | where description != '' | select name description) let updated_cmds = $(echo $cmds | insert camel { build-string $it.name 'Completion' | str camel-case } ) let ts = $(echo $updated_cmds | @@ -97,4 +92,4 @@ def gen-ts-subs [] { # echo $mess | autoview # } -build-string $(gen-ts-cmds-begin) $(gen-ts-cmds) $(gen-ts-subs) | save foo.ts +build-string $(gen-ts-cmds-begin) $(gen-ts-cmds) $(gen-ts-subs) | save extension.ts