Skip to content

Commit 2313838

Browse files
committed
in commands table rename usage to description
1 parent ce89b5c commit 2313838

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

custom-menus/extra/commands.nu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@
2525
source: { |buffer, position|
2626
scope commands
2727
| where name =~ $buffer
28-
| each { |it| {value: $it.name description: $it.usage} }
28+
| each { |it| {value: $it.name description: $it.description } }
2929
}
3030
}

custom-menus/extra/commands_with_description.nu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@
2727
source: { |buffer, position|
2828
scope commands
2929
| where name =~ $buffer
30-
| each { |it| {value: $it.name description: $it.usage} }
30+
| each { |it| {value: $it.name description: $it.description} }
3131
}
3232
}

make_release/gen-ts-ext.nu

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function activate(context: vscode.ExtensionContext) {
1616

1717
# generate typescript from nushell commands
1818
def gen-ts-cmds [] {
19-
let cmds = (scope commands | where usage != '' | select name usage)
19+
let cmds = (scope commands | where description != '' | select name description)
2020
let updated_cmds = (echo $cmds | insert camel {|it| $it.name + 'Completion' | str camel-case } )
2121

2222
let ts = (echo $updated_cmds |
@@ -38,10 +38,10 @@ def gen-ts-cmds [] {
3838

3939
# generate typescript from nushell subcommands
4040
def gen-ts-subs [] {
41-
let cmds = (scope commands | where is_sub == true | select name usage | insert base { get name | split column ' ' base sub } | flatten --all)
41+
let cmds = (scope commands | where is_sub == true | select name description | insert base { get name | split column ' ' base sub } | flatten --all)
4242
let updated_cmds = (echo $cmds | insert camelProvider {|row| $row.base + 'SubCommandsProvider' | str camel-case } | insert method {|row| $row.name | str camel-case})
43-
let subs_count = (scope commands | where is_sub == true | select name usage | insert base { get name | split column ' ' base sub} | flatten --all | group-by base | transpose cmd cmd_count | update cmd_count { get cmd_count | length })
44-
let subs_collection = (scope commands | where is_sub == true | select name usage | insert base { get name | split column ' ' base sub} | flatten --all | group-by base | transpose cmd sub_cmds)
43+
let subs_count = (scope commands | where is_sub == true | select name description | insert base { get name | split column ' ' base sub} | flatten --all | group-by base | transpose cmd cmd_count | update cmd_count { get cmd_count | length })
44+
let subs_collection = (scope commands | where is_sub == true | select name description | insert base { get name | split column ' ' base sub} | flatten --all | group-by base | transpose cmd sub_cmds)
4545

4646
let ts = ($subs_collection | each {|it|
4747
let preamble = (get sub_cmds | enumerate | each {|it|
@@ -55,11 +55,11 @@ def gen-ts-subs [] {
5555
let line05 = ([ " const linePrefix = document.lineAt(position).text.substr(0, position.character);" (char nl) ] | str join)
5656
let line06 = ([ " if (linePrefix.endsWith('" $it.item.base " ')) {" (char nl) (char nl) ] | str join)
5757
let line07 = ([ " const " $method " = new vscode.CompletionItem('" $it.item.sub "', vscode.CompletionItemKind.Method);" (char nl) ] | str join)
58-
let line08 = ([ ' ' $method '.detail = "' $it.item.usage '";' (char nl) (char nl) ] | str join)
58+
let line08 = ([ ' ' $method '.detail = "' $it.item.description '";' (char nl) (char nl) ] | str join)
5959
$line01 + $line02 + $line03 + $line04 + $line05 + $line06 + $line07 + $line08
6060
} else {
6161
let line07 = ([ " const " $method " = new vscode.CompletionItem('" $it.item.sub "', vscode.CompletionItemKind.Method);" (char nl) ] | str join)
62-
let line08 = ([ ' ' $method '.detail = "' $it.item.usage '";' (char nl) (char nl) ] | str join)
62+
let line08 = ([ ' ' $method '.detail = "' $it.item.description '";' (char nl) (char nl) ] | str join)
6363
$line07 + $line08
6464
}
6565
} | str join)

modules/fuzzy/fuzzy_command_search.nu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export def fuzzy-command-search [] {
1717
let max_indent = ($max_len / $tablen | into int)
1818
let command = ((help commands | each {|it|
1919
let name = ($it.name | str trim | ansi strip)
20-
$"($name)(pad-tabs $name $max_indent)($it.usage)"
20+
$"($name)(pad-tabs $name $max_indent)($it.description)"
2121
}) | str join (char nl) | fzf | split column (char tab) | get column1.0)
2222
if ($command | is-not-empty) {
2323
help $command

0 commit comments

Comments
 (0)