Verified Commit 898bf915 authored by Camil Staps's avatar Camil Staps 🚀

Merge branch 'master' of github.com:clean-cloogle/Cloogle

parents 0f167708 4a1a8f27
......@@ -17,6 +17,7 @@ class docParams d :: !d -> [Description]
class docVars d :: !d -> [Description]
class docResults d :: !d -> [Description]
class docType d :: !d -> Maybe Type
class docThrows d :: !d -> [Description]
class docMembers d :: !d -> [Maybe ClassMemberDoc]
class docFields d :: !d -> Maybe [Maybe Description]
class docConstructors d :: !d -> Maybe [Maybe ConstructorDoc]
......@@ -41,6 +42,7 @@ derive gDefault ModuleDoc
, vars :: [Description] //* Descriptions of the type variables (for generics)
, results :: [Description] //* Descriptions of the result(s, for tuples)
, type :: Maybe Type //* The type (for macros)
, throws :: [Description] //* The exceptions it may throw (iTasks)
}
instance docDescription FunctionDoc
......@@ -48,6 +50,7 @@ instance docParams FunctionDoc
instance docVars FunctionDoc
instance docResults FunctionDoc
instance docType FunctionDoc
instance docThrows FunctionDoc
derive gDefault FunctionDoc
/**
......@@ -59,12 +62,14 @@ derive gDefault FunctionDoc
, params :: [Description]
, results :: [Description]
, type :: Maybe Type
, throws :: [Description]
}
instance docDescription ClassMemberDoc
instance docParams ClassMemberDoc
instance docResults ClassMemberDoc
instance docType ClassMemberDoc
instance docThrows ClassMemberDoc
derive gDefault ClassMemberDoc
/**
......
......@@ -32,11 +32,13 @@ instance docParams FunctionDoc where docParams d = d.FunctionDoc.param
instance docVars FunctionDoc where docVars d = d.FunctionDoc.vars
instance docResults FunctionDoc where docResults d = d.FunctionDoc.results
instance docType FunctionDoc where docType d = d.FunctionDoc.type
instance docThrows FunctionDoc where docThrows d = d.FunctionDoc.throws
instance docDescription ClassMemberDoc where docDescription d = d.ClassMemberDoc.description
instance docParams ClassMemberDoc where docParams d = d.ClassMemberDoc.params
instance docResults ClassMemberDoc where docResults d = d.ClassMemberDoc.results
instance docType ClassMemberDoc where docType d = d.ClassMemberDoc.type
instance docThrows ClassMemberDoc where docThrows d = d.ClassMemberDoc.throws
instance docDescription ConstructorDoc where docDescription d = d.ConstructorDoc.description
instance docParams ConstructorDoc where docParams d = d.ConstructorDoc.params
......@@ -69,6 +71,7 @@ functionToClassMemberDoc d =
, params = d.FunctionDoc.params
, results = d.FunctionDoc.results
, type = d.FunctionDoc.type
, throws = d.FunctionDoc.throws
}
addClassMemberDoc :: !ClassDoc !(Maybe ClassMemberDoc) -> ClassDoc
......
......@@ -89,18 +89,18 @@ Some simple markup is allowed in documentation:
The tables below describe which fields and documentation types can be used for
different syntax elements, and what they should document.
| | Description | `@param` | `@result` | `@type` | `@var` | `@representation`
|--------------|-------------|----------|-----------|---------|--------|-------------------
| Class | ![][y] | ![][y]<sup>1</sup> | ![][y]<sup>1</sup> | | ![][y] |
| Class member | ![][y] | ![][y] | ![][y] | | |
| Constructor | ![][y] | | | | |
| Function | ![][y] | ![][y] | ![][y] | | |
| Generic | ![][y] | ![][y] | ![][y] | | ![][y] |
| Instance | | | | | |
| Macro | ![][y] | ![][y] | ![][y] | ![][y]<sup>2</sup> | |
| Module | ![][y] | | | | |
| Record field | ![][y] | | | | |
| Type | ![][y] | | | | ![][y] | ![][y], for type synonyms
| | Description | `@param` | `@result` | `@type` | `@var` | `@representation` | `@throws`
|--------------|-------------|----------|-----------|---------|--------|-------------------|----------
| Class | ![][y] | ![][y]<sup>1</sup> | ![][y]<sup>1</sup> | | ![][y] | ![][y]
| Class member | ![][y] | ![][y] | ![][y] | | | | ![][y]
| Constructor | ![][y] | | | | | |
| Function | ![][y] | ![][y] | ![][y] | | | |
| Generic | ![][y] | ![][y] | ![][y] | | ![][y] | |
| Instance | | | | | | |
| Macro | ![][y] | ![][y] | ![][y] | ![][y]<sup>2</sup> | | |
| Module | ![][y] | | | | | |
| Record field | ![][y] | | | | | |
| Type | ![][y] | | | | ![][y] | ![][y], for type synonyms |
<sup>1: only for shorthand classes like `class zero a :: a`, where there is no
other place for the documentation of the class member.</sup>
......
......@@ -133,6 +133,7 @@ makeResult orgsearchtype allsyns usedsyns (entry, annots) db
, generic_var_doc = docVars <$> fe.fe_documentation
, result_doc = docResults <$> fe.fe_documentation
, type_doc = concat <$> print False <$> (docType =<< fe.fe_documentation)
, throws_doc = docThrows <$> fe.fe_documentation
}), db)
with
toStrUnifier :: Unifier -> StrUnifier
......
Subproject commit ffd6cfa0a8d6913c30b3fee9fe70ebaa596940b5
Subproject commit cac3a3050bbbd7d131e166c2a9a708e5338518c5
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