From 9df2a73e38f7ec23c49414a083d671f9af0dde22 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 8 May 2017 11:16:23 -0400 Subject: [PATCH] Tighten up toTermName. --- src/Renderer/TOC.hs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Renderer/TOC.hs b/src/Renderer/TOC.hs index 10a7d9798..d8cbb460e 100644 --- a/src/Renderer/TOC.hs +++ b/src/Renderer/TOC.hs @@ -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