diff --git a/src/DiffSummary.hs b/src/DiffSummary.hs index 6f496a1df..8bef5f747 100644 --- a/src/DiffSummary.hs +++ b/src/DiffSummary.hs @@ -180,6 +180,7 @@ toTermName source term = case unwrap term of S.Method identifier _ _ -> toTermName' identifier S.Comment a -> toCategoryName a S.Commented _ _ -> termNameFromChildren term (toList $ unwrap term) + S.Module identifier _ -> toTermName' identifier where toTermName' = toTermName source termNameFromChildren term children = termNameFromRange (unionRangesFrom (range term) (range <$> children)) termNameFromSource term = termNameFromRange (range term) @@ -296,6 +297,7 @@ instance HasCategory Category where C.If -> "if statement" C.CommaOperator -> "comma operator" C.Empty -> "empty statement" + C.Module -> "module statement" instance HasField fields Category => HasCategory (SyntaxTerm leaf fields) where toCategoryName = toCategoryName . category . extract diff --git a/src/Renderer/JSON.hs b/src/Renderer/JSON.hs index 04d25ec37..a4c9aaa06 100644 --- a/src/Renderer/JSON.hs +++ b/src/Renderer/JSON.hs @@ -100,6 +100,7 @@ termFields info syntax = "range" .= characterRange info : "category" .= category S.Array c -> childrenFields c 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 ] where childrenFields c = [ "children" .= c ] patchFields :: (KeyValue kv, HasField fields Category, HasField fields Range) => SplitPatch (SyntaxTerm leaf fields) -> [kv] diff --git a/src/Renderer/Split.hs b/src/Renderer/Split.hs index 1467755b8..4b386f7c0 100644 --- a/src/Renderer/Split.hs +++ b/src/Renderer/Split.hs @@ -81,6 +81,7 @@ styleName category = "category-" <> case category of C.Empty -> "empty_statement" C.CommaOperator -> "comma_operator" Other string -> string + C.Module -> "module_statement" -- | Pick the class name for a split patch. splitPatchToClassName :: SplitPatch a -> AttributeValue