Skip to content

Commit

Permalink
Fix suffix search
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPenner committed Dec 7, 2023
1 parent a867ab0 commit 2f2b6b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions unison-share-api/src/Unison/Server/Backend.hs
Original file line number Diff line number Diff line change
Expand Up @@ -996,14 +996,15 @@ evalDocRef rt codebase r = do
docsForDefinitionName ::
Codebase IO Symbol Ann ->
NameSearch Sqlite.Transaction ->
NamesWithHistory.SearchType ->
Name ->
IO [TermReference]
docsForDefinitionName codebase (NameSearch {termSearch}) name = do
docsForDefinitionName codebase (NameSearch {termSearch}) searchType name = do
let potentialDocNames = [name, name Cons.:> "doc"]
Codebase.runTransaction codebase do
refs <-
potentialDocNames & foldMapM \name ->
lookupRelativeHQRefs' termSearch NamesWithHistory.ExactName (HQ'.NameOnly name)
lookupRelativeHQRefs' termSearch searchType (HQ'.NameOnly name)
filterForDocs (toList refs)
where
filterForDocs :: [Referent] -> Sqlite.Transaction [TermReference]
Expand Down
2 changes: 1 addition & 1 deletion unison-share-api/src/Unison/Server/Local/Definitions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ prettyDefinitionsForHQName perspective shallowRoot renderWidth suffixifyBindings
let width = mayDefaultWidth renderWidth
let docResults :: Name -> IO [(HashQualifiedName, UnisonHash, Doc.Doc)]
docResults name = do
docRefs <- docsForDefinitionName codebase nameSearch name
docRefs <- docsForDefinitionName codebase nameSearch NamesWithHistory.ExactName name
renderDocRefs pped width codebase rt docRefs

let fqnPPE = PPED.unsuffixifiedPPE pped
Expand Down

0 comments on commit 2f2b6b6

Please sign in to comment.