1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 14:21:31 +03:00

Don’t trim the source for recursive calls into termToDiffInfo.

This commit is contained in:
Rob Rix 2017-02-13 15:19:06 -05:00
parent 6a2f773a1d
commit 52025ac5e5

View File

@ -155,7 +155,7 @@ termToDiffInfo source term = case unwrap term of
toTermName' subterm = toTermName (Source.slice (subtermRange subterm) source) subterm
range = characterRange . extract
subtermRange subterm = offsetRange (range subterm) (negate (start (range term)))
termToDiffInfo' subterm = termToDiffInfo (Source.slice (subtermRange subterm) source) subterm
termToDiffInfo' = termToDiffInfo source
toLeafInfo term = LeafInfo (category $ extract term) (toTermName' term) (getField $ extract term)
toTermName :: forall leaf fields. DefaultFields fields => Source -> SyntaxTerm leaf fields -> Text