[ fuzzysearch ] don't print holes

This commit is contained in:
Guillaume Allais 2022-06-08 19:34:22 +01:00 committed by G. Allais
parent 7bd7f1da9c
commit a6a4593aba

View File

@ -53,7 +53,7 @@ fuzzySearch expr = do
guard (isJust $ userNameRoot (fullname d))
pure d
allDefs <- traverse (resolved ctxt) defs
filterM (\def => fuzzyMatch neg pos def.type) allDefs
filterM (predicate neg pos) allDefs
put Ctxt defs
doc <- traverse (docsOrSignature EmptyFC) $ fullname <$> filteredDefs
pure $ PrintedDoc $ vsep doc
@ -153,3 +153,11 @@ fuzzySearch expr = do
let refsB = doFind [] tm
refsB <- traverse toFullNames' refsB
pure (isNil $ diffBy isApproximationOf' pos refsB)
predicate : (neg : List NameOrConst)
-> (pos : List NameOrConst)
-> GlobalDef
-> Core Bool
predicate neg pos def = case definition def of
Hole{} => pure False
_ => fuzzyMatch neg pos def.type