Skip to content

Commit 27a6b6e

Browse files
committed
Only use nub on SrcSpan for ghc>=9
1 parent 9de9962 commit 27a6b6e

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
@@ -861,9 +861,14 @@ suggestImportDisambiguation df (Just txt) ps@(L _ HsModule {hsmodImports}) diag@
861861
HideOthers restImports :
862862
[ ToQualified parensed qual
863863
| ExistingImp imps <- [modTarget]
864+
#if MIN_GHC_API_VERSION(9,0,0)
865+
{- HLINT ignore suggestImportDisambiguation "Use nubOrd" -}
864866
-- TODO: The use of nub here is slow and maybe wrong for UnhelpfulLocation
865867
-- nubOrd can't be used since SrcSpan is intentionally no Ord
866868
, L _ qual <- nub $ mapMaybe (ideclAs . unLoc)
869+
#else
870+
, L _ qual <- nubOrd $ mapMaybe (ideclAs . unLoc)
871+
#endif
867872
$ NE.toList imps
868873
]
869874
++ [ToQualified parensed modName

0 commit comments

Comments
 (0)