1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-01 06:37:46 +00:00

Merge pull request #38 from fdncred/main

tweak to include subcommand command names
This commit is contained in:
Darren Schroeder 2021-04-06 09:55:57 -05:00 committed by GitHub
commit a9ec44083e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 <kbd>SpaceBar</kbd> 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