Commit e7dc1f07 authored by Camil Staps's avatar Camil Staps
Browse files

Add documentation

parent 5f3f266d
......@@ -89,6 +89,7 @@ makeResult orgsearchtype tdes usedsyns (entry, annots) db
, fromMaybe 0 $ fromIntAnnot <$> 'M'.get UnifierSize annots
, length usedsyns
])
, documentation = docDescription =<< fe.fe_documentation
},
{ kind = fe.fe_kind
, func = fromJust (fe.fe_representation <|> pure (concat $ print False (name,fe)))
......@@ -175,7 +176,10 @@ makeResult orgsearchtype tdes usedsyns (entry, annots) db
# (TypeDefEntry tde) = entry
# (insts,db) = getIndices tde.tde_instances db
# (derivs,db) = getIndices tde.tde_derivations db
= (TypeResult (general,
= (TypeResult (
{ general
& documentation = docDescription =<< tde.tde_doc
},
{ type = concat $ print False tde.tde_typedef
, type_instances = sortBy ((<) `on` fst3)
[(ie.ie_class, map snd ie.ie_types, map locResult ie.ie_locations)
......@@ -189,7 +193,10 @@ makeResult orgsearchtype tdes usedsyns (entry, annots) db
| entry =: (ModuleEntry _)
# (ModuleEntry me) = entry
= (ModuleResult (general,
= (ModuleResult (
{ general
& documentation = docDescription =<< me.me_documentation
},
{ module_is_core = me.me_is_core
}), db)
......@@ -197,7 +204,10 @@ makeResult orgsearchtype tdes usedsyns (entry, annots) db
# (ClassEntry ce) = entry
# (ies,db) = getIndices ce.ce_instances db
# (mems,db) = getIndices ce.ce_members db
= (ClassResult (general,
= (ClassResult (
{ general
& documentation = docDescription =<< ce.ce_documentation
},
{ class_name = name
, class_heading = foldl ((+) o (flip (+) " ")) name ce.ce_vars +
if (isEmpty ce.ce_context) "" " | " + concat (print False ce.ce_context)
......@@ -205,7 +215,6 @@ makeResult orgsearchtype tdes usedsyns (entry, annots) db
, class_instances = sortBy ((<) `on` fst)
[(map snd ie.ie_types, map locResult ie.ie_locations)
\\ {value=InstanceEntry ie} <- ies]
, class_derivations = [] // TODO
}), db)
| entry =: (SyntaxEntry _)
......@@ -213,13 +222,13 @@ makeResult orgsearchtype tdes usedsyns (entry, annots) db
= (SyntaxResult (
{ general
& distance = 0
, documentation = Just se.syntax_description
},
{ SyntaxResultExtras
| syntax_title = se.SyntaxEntry.syntax_title
, syntax_code = se.SyntaxEntry.syntax_code
, syntax_examples = se.SyntaxEntry.syntax_examples
}), db)
// TODO
where
mbLoc = getLocation entry
name = getName $ fromJust mbLoc
......@@ -229,12 +238,14 @@ where
, filename = fromMaybe "" (getFilename =<< mbLoc)
, dcl_line = getDclLine =<< mbLoc
, icl_line = getIclLine =<< mbLoc
, distance = distance // TODO
, distance = distance
, builtin = case mbLoc of
Just (Builtin _ _) -> Just True
_ -> Nothing
, documentation = Nothing // TODO
, langrep_documentation = Nothing // TODO
, documentation = Nothing // Added after pattern match on Entry type
, langrep_documentation = case mbLoc of
Just (Builtin _ d) -> Just d
_ -> Nothing
}
distance = sum
[ case 'M'.get MatchingNGrams annots of
......
Subproject commit d7f34b39472939993fc9c0fdf0e8d9a0821c7c92
Subproject commit 04ca6f2158881c65bcec32d1a9c6d521a1316181
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