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
improve completions of use
and overlay use
#11330
Conversation
this checks if `search dir + it + mod.nu` exists and adds that to the completion items if so. i renamed the outter `it` to `search_dir` to avoid it being shadowed by the innermost one and avoid defining a binding with the same name.
the CI should fail here.
the CI should go green again here.
the CI does not pass in the last commit because the new completion directory module broke other tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! It looks good to me
@WindSoilder |
Isn't it expected? It seems that it only shows module if it contains |
yeah, i think it's expected 👍 |
# Description this PR is two-fold - make `use` and `overlay use` use the same completion algorithm in 48f29b6 - list directory modules in completions of both with 402acde # User-Facing Changes i currently have the following in my `NU_LIB_DIRS` <details> <summary>click to see the script</summary> ```nushell for dir in $env.NU_LIB_DIRS { print $dir print (ls $dir --short-names | select name type) } ``` </details> ``` /home/amtoine/.local/share/nupm/modules #┬────────name────────┬type 0│nu-git-manager │dir 1│nu-git-manager-sugar│dir 2│nu-hooks │dir 3│nu-scripts │dir 4│nu-themes │dir 5│nupm │dir ─┴────────────────────┴──── /home/amtoine/.config/nushell/overlays #┬──name──┬type 0│ocaml.nu│file ─┴────────┴──── ``` > **Note** > all the samples below are run from the Nushell repo, i.e. a directory with a `toolkit.nu` module ## before the changes - `use` would give me `["ocaml.nu", "toolkit.nu"]` - `overlay use` would give me `[]` ## after the changes both commands give me ```nushell [ "nupm/", "ocaml.nu", "toolkit.nu", "nu-scripts/", "nu-git-manager/", "nu-git-manager-sugar/", ] ``` # Tests + Formatting - adds a new `directory_completion/mod.nu` to the completion fixtures - make sure `source-env`, `use` and `overlay-use` are all tested in the _dotnu_ test - fix all the other tests that use completions in the fixtures directory for completions # After Submitting
Description
this PR is two-fold
use
andoverlay use
use the same completion algorithm in 48f29b6User-Facing Changes
i currently have the following in my
NU_LIB_DIRS
click to see the script
before the changes
use
would give me["ocaml.nu", "toolkit.nu"]
overlay use
would give me[]
after the changes
both commands give me
Tests + Formatting
directory_completion/mod.nu
to the completion fixturessource-env
,use
andoverlay-use
are all tested in the dotnu testAfter Submitting