1
1
mirror of https://github.com/github/semantic.git synced 2025-01-06 23:46:21 +03:00

Add Import and Export render cases

This commit is contained in:
Rick Winfrey 2016-10-06 18:21:59 -05:00
parent f85ee8991a
commit 7b24a6ba22
2 changed files with 4 additions and 0 deletions

View File

@ -101,6 +101,8 @@ termFields info syntax = "range" .= characterRange info : "category" .= category
S.Class identifier superclass definitions -> [ "classIdentifier" .= identifier ] <> [ "superclass" .= superclass ] <> [ "definitions" .= definitions ]
S.Method identifier params definitions -> [ "methodIdentifier" .= identifier ] <> [ "params" .= params ] <> [ "definitions" .= definitions ]
S.Module identifier definitions-> [ "moduleIdentifier" .= identifier ] <> [ "definitions" .= definitions ]
S.Import identifier expr -> [ "importIdentifier" .= identifier ] <> [ "importStatements" .= expr ]
S.Export identifier expr -> [ "exportIdentifier" .= identifier ] <> [ "exportStatements" .= expr ]
where childrenFields c = [ "children" .= c ]
patchFields :: (KeyValue kv, HasField fields Category, HasField fields Range) => SplitPatch (SyntaxTerm leaf fields) -> [kv]

View File

@ -81,6 +81,8 @@ styleName category = "category-" <> case category of
C.CommaOperator -> "comma_operator"
Other string -> string
C.Module -> "module_statement"
C.Import -> "import_statement"
C.Export -> "export_statement"
-- | Pick the class name for a split patch.
splitPatchToClassName :: SplitPatch a -> AttributeValue