JuliaLang / Pkg.jl

Pkg - Package manager for the Julia programming language
https://pkgdocs.julialang.org
Other
609 stars 251 forks source link

abort querying more packages for hint auto complete #3913

Closed KristofferC closed 4 weeks ago

KristofferC commented 4 weeks ago

the result of hint auto complete is only used if a unique entry is returned

fixes #3909

kimikage commented 4 weeks ago

If an abort occurs while entering the name of a remote package, will it display the only local directory (or something) with the same starting string as a hint? I would find that acceptable, but I want to know the behavior just to be sure.

KristofferC commented 4 weeks ago

If an abort occurs while entering the name of a remote package, will it display the only local directory (or something) with the same starting string as a hint?

I don't understand what this means. There should be no observable difference between the behavior here and the one on the current 1.11 julia.

kimikage commented 4 weeks ago

For example, When there is a directory named "Documents" in the active directory, and I type "Doc", will it not display a hint "Documents/" and then complete it when I press <TAB>? I.e., "Documenter" or "DocumenterTools", etc. will not be ignored?

Edit: I am a Windows user, but I believe macOS also has multiple directories in the home directory which start with uppercase.

KristofferC commented 4 weeks ago

Local directories are handled by complete_local_dir which is not touched here.

kimikage commented 4 weeks ago

In this PR, the fact that an abort occurred is not explicitly returned to the caller. As a result, it seems that there is no distinction between having no matches and having multiple matches. Personally, I don’t think that is particularly problematic. However, I believe there are ways to notify of an abort without type instability, such as returning a dummy package name (e.g., empty "").