Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom descriptions not work #8825

Closed
aa1ss2 opened this issue Apr 9, 2023 · 6 comments
Closed

Custom descriptions not work #8825

aa1ss2 opened this issue Apr 9, 2023 · 6 comments
Labels
completions Issues related to tab completion parser Issues related to parsing regression Something that worked does not work anymore. type-system Problems or features related to nushell's type system
Milestone

Comments

@aa1ss2
Copy link

aa1ss2 commented Apr 9, 2023

Describe the bug

Custom descriptions return error type ,missing string identifier.

How to reproduce

  1. book example https://www.nushell.sh/book/custom_completions.html#custom-completion-and-extern
  2. define
def my_commits [] {
    [
        { value: "5c2464", description: "Add .gitignore" },
        { value: "f3a377", description: "Initial commit" }
    ]
}
  1. define
def my-command [commit: string@my_commits] {
    print $commit
}

Expected behavior

Return the correct type

Screenshots

1

Configuration

key value
version 0.78.1
branch main
commit_hash 637283f
build_os windows-x86_64
build_target x86_64-pc-windows-msvc
rust_version rustc 1.66.1 (90743e729 2023-01-10)
rust_channel 1.66.1-x86_64-pc-windows-msvc
cargo_version cargo 1.66.1 (ad779e08b 2023-01-10)
build_time 2023-04-09 09:55:02 +08:00
build_rust_channel release
features dataframe, default, sqlite, zip
installed_plugins custom-value generate, custom-value generate2, custom-value update, from eml, from ics, from ini, from vcf, gstat, inc, nu-example-1, nu-example-2, nu-example-3, query, query json, query web, query xml

Additional context

No response

@amtoine
Copy link
Member

amtoine commented Apr 9, 2023

@aa1ss2

i think this has been introduced in #8635 and i can reproduce it the latest main 👍

a correct call would be

my-command "5c2464"

and not

my-command 5c2464

as given by the auto-completion 🤔

@amtoine
Copy link
Member

amtoine commented Apr 9, 2023

even worse, if you try to tab-complete on f it works as expected, but nothing happens on 5 🤔

@aa1ss2
Copy link
Author

aa1ss2 commented Apr 9, 2023

Thanks for the answer,i know correct call is my-command "5c2464" ,the problem is i input my-command " and press tab
nothing happens ,If don't enter double quotes ,return wrong value ,this is very troubling for me

@amtoine
Copy link
Member

amtoine commented Apr 9, 2023

that looks like a bug to me 👍

@sholderbach sholderbach added parser Issues related to parsing completions Issues related to tab completion type-system Problems or features related to nushell's type system regression Something that worked does not work anymore. labels Apr 9, 2023
@1Kinoti
Copy link
Contributor

1Kinoti commented Oct 5, 2023

i believe this has been fixed by #8845.

@amtoine
Copy link
Member

amtoine commented Oct 5, 2023

good catch @1Kinoti, i cannot reproduce with the latest revision of Nushell 👌
will be closing this for now 😌

@amtoine amtoine closed this as completed Oct 5, 2023
@hustcer hustcer added this to the v0.79.0 milestone Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completions Issues related to tab completion parser Issues related to parsing regression Something that worked does not work anymore. type-system Problems or features related to nushell's type system
Projects
None yet
Development

No branches or pull requests

5 participants