Verified Commit 625bd76f authored by Camil Staps's avatar Camil Staps 🚀

Added MAX_RESULTS to not break the frontend

parent 411151ed
......@@ -48,6 +48,8 @@ instance < Result where (<) r1 r2 = r1.distance < r2.distance
err :: Int String -> Response
err c m = {return=c, data=[], msg=m}
MAX_RESULTS :== 100
Start w
# (io, w) = stdio w
# (cmdline, w) = getCommandLine w
......@@ -72,8 +74,9 @@ where
# filters = catMaybes $ [ isUnifiable <$> mbType
, pure $ isNameMatch (size name - 2) name
]
# results = map (makeResult name mbType) $ findType`` filters db
= ({return=0,msg="Success",data=sort results}, w)
# results = take MAX_RESULTS $ sort
$ map (makeResult name mbType) $ findType`` filters db
= ({return=0,msg="Success",data=results}, w)
makeResult :: String (Maybe Type) (FunctionLocation, Type) -> Result
makeResult orgsearch orgsearchtype (FL lib mod fname, type)
......
......@@ -93,20 +93,6 @@ OtherModules
ReadableABC: False
ReuseUniqueNodes: True
Fusion: False
Module
Name: Jones
Dir: {Project}/CleanTypeUnifier
Compiler
NeverMemoryProfile: False
NeverTimeProfile: False
StrictnessAnalysis: True
ListTypes: StrictExportTypes
ListAttributes: True
Warnings: True
Verbose: True
ReadableABC: False
ReuseUniqueNodes: True
Fusion: False
Module
Name: Type
Dir: {Project}/CleanTypeUnifier
......@@ -725,20 +711,6 @@ OtherModules
ReadableABC: False
ReuseUniqueNodes: True
Fusion: False
Module
Name: StdDebug
Dir: {Application}/lib/StdEnv
Compiler
NeverMemoryProfile: False
NeverTimeProfile: False
StrictnessAnalysis: True
ListTypes: StrictExportTypes
ListAttributes: True
Warnings: True
Verbose: True
ReadableABC: False
ReuseUniqueNodes: True
Fusion: False
Module
Name: StdEnum
Dir: {Application}/lib/StdEnv
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment