summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChrisDone <>2016-05-12 16:16:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2016-05-12 16:16:00 (GMT)
commit01f91d3170a4f573a237d1aed7c922181b977aec (patch)
tree06edda66a2a8f1feaa52cf5ac24c8f132eacc245
parent82458180040166d5efff3df9a3f2d8a9f6983088 (diff)
version 0.1.20.1.2
-rw-r--r--intero.cabal2
-rw-r--r--src/GhciFind.hs11
-rw-r--r--src/InteractiveUI.hs1
3 files changed, 12 insertions, 2 deletions
diff --git a/intero.cabal b/intero.cabal
index cb75628..47fe1ed 100644
--- a/intero.cabal
+++ b/intero.cabal
@@ -1,7 +1,7 @@
name:
intero
version:
- 0.1.1
+ 0.1.2
synopsis:
Complete interactive development program for Haskell
license:
diff --git a/src/GhciFind.hs b/src/GhciFind.hs
index 7f8d2e4..a204817 100644
--- a/src/GhciFind.hs
+++ b/src/GhciFind.hs
@@ -59,7 +59,8 @@ findNameUses infos fp string sl sc el ec =
return (Right (stripSurrounding
(span' :
map makeSrcSpan
- (filter ((== Just name') .
+ (filter (fromMaybe False .
+ fmap (reliableNameEquality name') .
fmap getName .
spaninfoVar)
(modinfoSpans info)))))
@@ -73,6 +74,14 @@ findNameUses infos fp string sl sc el ec =
el'
(1 + ec')))
+-- | Reliable equality for two names. This tests based on the start
+-- line and start column and module.
+--
+-- We don't use standard equality. The unique can differ. Even the end
+-- column can differ.
+reliableNameEquality :: Name -> Name -> Bool
+reliableNameEquality name1 name2 = nameSrcLoc name1 == nameSrcLoc name2
+
-- | Strip out spans which surrounding other spans in a parent->child
-- fashion. Those are useless.
stripSurrounding :: [SrcSpan] -> [SrcSpan]
diff --git a/src/InteractiveUI.hs b/src/InteractiveUI.hs
index 8f72385..c6e1cf7 100644
--- a/src/InteractiveUI.hs
+++ b/src/InteractiveUI.hs
@@ -165,6 +165,7 @@ ghciWelcomeMsg =
unlines [versionString
,"Type :intro and press enter for an introduction of the standard commands."]
+versionString :: [Char]
versionString =
"Intero " ++
showVersion Paths_intero.version ++