Remove 'SrcSpanInfo' string when serializing node.
diff --git a/elisp/shm-node.el b/elisp/shm-node.el
index 72e6ad2..92325fe 100644
--- a/elisp/shm-node.el
+++ b/elisp/shm-node.el
@@ -211,7 +211,7 @@
(cdr (shm-node-child-pair node-pair)))
(defun shm-get-parent-top-level-decl (node-pair)
- (shm-node-parent node-pair "Decl SrcSpanInfo"))
+ (shm-node-parent node-pair "Decl"))
(defun shm-node-ancestor-at-point (node-pair point)
"Find the highest up ancestor that still starts at this point."
diff --git a/src/ParseAST.hs b/src/ParseAST.hs
index 996e040..3e3ab20 100644
--- a/src/ParseAST.hs
+++ b/src/ParseAST.hs
@@ -75,13 +75,16 @@
spanHSE :: String -> String -> SrcSpan -> String
spanHSE typ cons SrcSpan{..} = "[" ++ (intercalate "," spanContent) ++ "]"
where unqualify = dropUntilLast '.'
- spanContent =
- unwords [unqualify typ
- ,cons
- ,show srcSpanStartLine
- ,show srcSpanStartColumn
- ,show srcSpanEndLine
- ,show srcSpanEndColumn]
+ spanContent = [ show $ dropSrcSpanText (filter (/= '"') (unqualify typ))
+ , show cons
+ , show srcSpanStartLine
+ , show srcSpanStartColumn
+ , show srcSpanEndLine
+ , show srcSpanEndColumn]
+ where
+ dropSrcSpanText str = if "SrcSpanInfo" `isSuffixOf` str
+ then takeWhile (/= ' ') str
+ else str
------------------------------------------------------------------------------
-- | Like 'dropWhile', but repeats until the last match.