Skip to content

Commit 7f91fad

Browse files
committed
Actually realize that the dropEnd1 is old code and revert "Get rid of redundant dropEnd1"
This reverts commit 723d56c.
1 parent 753b8e7 commit 7f91fad

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

ghcide/src/Development/IDE/Spans/AtPoint.hs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ import qualified Data.Text as T
5757

5858
import qualified Data.Array as A
5959
import Data.Either
60-
import Data.List.Extra (nubOrd)
60+
import Data.List.Extra (dropEnd1, nubOrd)
6161

6262

6363
import Control.Lens ((^.))
@@ -279,9 +279,14 @@ atPoint opts@IdeOptions{} shakeExtras@ShakeExtras{ withHieDb, hiedbWriter } har@
279279
Left _moduleName -> Nothing) $ fromMaybe [] locationsWithIdentifier
280280

281281
prettyNames <- mapM (prettyName locationsMap) names
282-
283-
pure (Just range, prettyNames ++ prettyTypes Nothing locationsMap)
282+
pure (Just range, prettyNames ++ pTypes locationsMap)
284283
where
284+
pTypes :: M.Map Name Location -> [T.Text]
285+
pTypes locationsMap =
286+
case names of
287+
[_singleName] -> dropEnd1 $ prettyTypes Nothing locationsMap
288+
_ -> prettyTypes Nothing locationsMap
289+
285290
range :: Range
286291
range = realSrcSpanToRange $ nodeSpan ast
287292

0 commit comments

Comments
 (0)