mirror of
https://github.com/github/semantic.git
synced 2024-12-21 13:51:44 +03:00
Tighten up toTermName.
This commit is contained in:
parent
76002f08c0
commit
9df2a73e38
@ -165,12 +165,9 @@ toTermName parentOffset parentSource term = case unwrap term of
|
||||
_ -> toMethodNameWithReceiver receiver identifier
|
||||
_ -> toText source
|
||||
where
|
||||
source = Source.slice (offsetRange (range term) (negate parentOffset)) parentSource
|
||||
source = Source.slice (offsetRange (byteRange (extract term)) (negate parentOffset)) parentSource
|
||||
toMethodNameWithReceiver receiver name = toTermName' receiver <> "." <> toTermName' name
|
||||
offset = start (range term)
|
||||
toTermName' :: SyntaxTerm leaf fields -> Text
|
||||
toTermName' = toTermName offset source
|
||||
range = byteRange . extract
|
||||
toTermName' = toTermName (start (byteRange (extract term))) source
|
||||
|
||||
-- The user-facing category name
|
||||
toCategoryName :: Category -> Text
|
||||
|
Loading…
Reference in New Issue
Block a user