mirror of
https://github.com/github/semantic.git
synced 2024-12-19 21:01:35 +03:00
Disambiguate between Syntax Comment and Category Comment
This commit is contained in:
parent
60d10c483e
commit
e9240b5b6e
@ -108,7 +108,7 @@ toTermName source term = case unwrap term of
|
|||||||
S.Array _ -> termNameFromSource term
|
S.Array _ -> termNameFromSource term
|
||||||
S.Class identifier _ _ -> toTermName' identifier
|
S.Class identifier _ _ -> toTermName' identifier
|
||||||
S.Method identifier _ _ -> toTermName' identifier
|
S.Method identifier _ _ -> toTermName' identifier
|
||||||
Comment a -> toCategoryName a
|
S.Comment a -> toCategoryName a
|
||||||
S.Commented _ _ -> termNameFromChildren term
|
S.Commented _ _ -> termNameFromChildren term
|
||||||
where toTermName' = toTermName source
|
where toTermName' = toTermName source
|
||||||
termNameFromChildren term = termNameFromRange (unionRangesFrom (range term) (range <$> toList (unwrap term)))
|
termNameFromChildren term = termNameFromRange (unionRangesFrom (range term) (range <$> toList (unwrap term)))
|
||||||
@ -174,6 +174,7 @@ instance HasCategory Category where
|
|||||||
BinaryOperator -> "binary operator"
|
BinaryOperator -> "binary operator"
|
||||||
Boolean -> "boolean"
|
Boolean -> "boolean"
|
||||||
DictionaryLiteral -> "dictionary"
|
DictionaryLiteral -> "dictionary"
|
||||||
|
C.Comment -> "comment"
|
||||||
C.Error -> "error"
|
C.Error -> "error"
|
||||||
ExpressionStatements -> "expression statements"
|
ExpressionStatements -> "expression statements"
|
||||||
C.Assignment -> "assignment"
|
C.Assignment -> "assignment"
|
||||||
|
Loading…
Reference in New Issue
Block a user