Skip to content

Conversation

@kczimm
Copy link

@kczimm kczimm commented May 21, 2020

Trying to add a Pkg search feature after reading discussion in #616. Uses an implementation of the Damerau-Levenshtein string distance REPL.levsort to compare search names against those in the available registries.

@kczimm kczimm marked this pull request as draft May 21, 2020 14:51
@kczimm
Copy link
Author

kczimm commented May 21, 2020

I'm not sure how to test this with the REPL interface. I've only tested it by,

julia> import Pkg
julia> Pkg.search(["helloworld", "and", "other", "package", "names"])
For `helloworld` found:
    WORLD, HelloWorldC_jll, LOLTools, Electron, and Millboard
For `and` found:
    AMD, Ant, PVD, Onda, and JLD
For `other` found:
    Tower, OneHot, Torch, FEHM, and OpSel
For `package` found:
    Packing, ACME, Pathogen, Pages, and GLMakie
For `names` found:
    Andes, NMEA, Mads, GCMAES, and Pages

@oxinabox
Copy link
Contributor

Test Pkg repl mode using Pkg.pkg"search Exampol"

@kczimm
Copy link
Author

kczimm commented May 21, 2020

Thanks, @oxinabox. I'll give it a try.

@kczimm
Copy link
Author

kczimm commented May 21, 2020

Okay, cool. That failed. I'll have to figure out where/how to hook into that functionality.

@oxinabox
Copy link
Contributor

Also rather than implementing own D.L distance can just use REPL.levsort which is a perfectly fine string metric.

@kczimm
Copy link
Author

kczimm commented May 21, 2020

Whoa, that's great. I didn't know that existed. I was just following the discussion in #616.

@kczimm kczimm marked this pull request as ready for review May 23, 2020 01:42
@kczimm
Copy link
Author

kczimm commented May 23, 2020

TODO: tests

@kczimm
Copy link
Author

kczimm commented Jun 19, 2020

So maybe this isn't that useful, as one can just tab-complete inside of pkg>. Any thoughts @oxinabox ?

@StefanKarpinski
Copy link
Member

No, I like it. We just need someone to review and then we can merge it, imo. Anyone strongly against having this?

explain REPL dependency

Co-authored-by: Lyndon White <oxinabox@ucc.asn.au>
@KristofferC
Copy link
Member

I think tab completion is good enough for simple things and for more complicated things it is better to use https://juliahub.com/ui/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants