Skip to content

Commit 9237972

Browse files
author
kokobd
committed
re-fix it for ghc-9.2
1 parent 04041b3 commit 9237972

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,13 +1403,8 @@ newImportToEdit (unNewImport -> imp) ps fileContents
14031403
-- * If the file has neither existing imports nor a module declaration,
14041404
-- the import will be inserted at line zero if there are no pragmas,
14051405
-- * otherwise inserted one line after the last file-header pragma
1406-
#if MIN_VERSION_ghc(9,2,0)
1407-
newImportInsertRange :: ParsedSource -> T.Text -> Maybe (Range, Int)
1408-
newImportInsertRange ps@(L _ HsModule {..}) fileContents
1409-
#else
14101406
newImportInsertRange :: Annotated ParsedSource -> T.Text -> Maybe (Range, Int)
14111407
newImportInsertRange ps fileContents
1412-
#endif
14131408
| Just ((l, c), col) <- case hsmodImports of
14141409
[] -> (\line -> ((line, 0), 0)) <$> findPositionNoImports ps fileContents
14151410
_ -> findPositionFromImportsOrModuleDecl (map reLoc hsmodImports) last
@@ -1428,11 +1423,13 @@ findPositionNoImports ps fileContents =
14281423
where
14291424
L _ HsModule {..} = astA ps
14301425

1426+
findPositionAfterModuleName :: Annotated ParsedSource
14311427
#if MIN_VERSION_ghc(9,2,0)
1432-
findPositionAfterModuleName :: ParsedSource -> LocatedA ModuleName -> Maybe Int
1428+
-> LocatedA ModuleName
14331429
#else
1434-
findPositionAfterModuleName :: Annotated ParsedSource -> Located ModuleName -> Maybe Int
1430+
-> Located ModuleName
14351431
#endif
1432+
-> Maybe Int
14361433
findPositionAfterModuleName ps hsmodName' = do
14371434
lineOffset <- whereKeywordLineOffset
14381435
case prevSrcSpan of

0 commit comments

Comments
 (0)