mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 06:37:46 +00:00
tweak to include subcommand command names
This commit is contained in:
parent
0521f8290a
commit
538e9f7613
1 changed files with 3 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue