Skip to content

Commit cdabd1e

Browse files
committed
Only use nub on SrcSpan for ghc>=9
1 parent 8b3232b commit cdabd1e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ghcide/src/Development/IDE/Plugin/CodeAction.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,9 +869,14 @@ suggestImportDisambiguation df (Just txt) ps@(L _ HsModule {hsmodImports}) diag@
869869
, mode <-
870870
[ ToQualified parensed qual
871871
| ExistingImp imps <- [modTarget]
872+
#if MIN_GHC_API_VERSION(9,0,0)
873+
{- HLINT ignore suggestImportDisambiguation "Use nubOrd" -}
872874
-- TODO: The use of nub here is slow and maybe wrong for UnhelpfulLocation
873875
-- nubOrd can't be used since SrcSpan is intentionally no Ord
874876
, L _ qual <- nub $ mapMaybe (ideclAs . unLoc)
877+
#else
878+
, L _ qual <- nubOrd $ mapMaybe (ideclAs . unLoc)
879+
#endif
875880
$ NE.toList imps
876881
]
877882
++ [ToQualified parensed modName

0 commit comments

Comments
 (0)