tools.completion: allow fuzzy vocab name in qualified-matching.
parent
03e62f3bc5
commit
cc08ad38a4
|
@ -78,23 +78,24 @@ PRIVATE>
|
||||||
: name-completions ( str seq -- seq' )
|
: name-completions ( str seq -- seq' )
|
||||||
[ dup name>> ] { } map>assoc completions ;
|
[ dup name>> ] { } map>assoc completions ;
|
||||||
|
|
||||||
|
: vocabs-matching ( str -- seq )
|
||||||
|
all-disk-vocabs-recursive filter-vocabs name-completions ;
|
||||||
|
|
||||||
: vocab-words-matching ( str vocab -- seq )
|
: vocab-words-matching ( str vocab -- seq )
|
||||||
vocab-words name-completions ;
|
vocab-words name-completions ;
|
||||||
|
|
||||||
: qualified-matching ( str -- seq/f )
|
: qualified-matching ( str -- seq/f )
|
||||||
":" split1 [
|
":" split1 [
|
||||||
swap
|
swap vocabs-matching keys [
|
||||||
[ vocab-words-matching ]
|
[ vocab-words ] [ vocab-name ] bi ":" append
|
||||||
[ ":" append [ prepend ] curry assoc-map ] bi
|
[ over name>> append ] curry { } map>assoc
|
||||||
|
] map! concat completions
|
||||||
] [ drop f ] if* ;
|
] [ drop f ] if* ;
|
||||||
|
|
||||||
: words-matching ( str -- seq )
|
: words-matching ( str -- seq )
|
||||||
[ all-words name-completions ]
|
[ all-words name-completions ]
|
||||||
[ qualified-matching [ prepend ] unless-empty ] bi ;
|
[ qualified-matching [ prepend ] unless-empty ] bi ;
|
||||||
|
|
||||||
: vocabs-matching ( str -- seq )
|
|
||||||
all-disk-vocabs-recursive filter-vocabs name-completions ;
|
|
||||||
|
|
||||||
: chars-matching ( str -- seq )
|
: chars-matching ( str -- seq )
|
||||||
name-map keys dup zip completions ;
|
name-map keys dup zip completions ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue