@@ -1403,13 +1403,8 @@ newImportToEdit (unNewImport -> imp) ps fileContents
1403
1403
-- * If the file has neither existing imports nor a module declaration,
1404
1404
-- the import will be inserted at line zero if there are no pragmas,
1405
1405
-- * 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
1410
1406
newImportInsertRange :: Annotated ParsedSource -> T. Text -> Maybe (Range , Int )
1411
1407
newImportInsertRange ps fileContents
1412
- #endif
1413
1408
| Just ((l, c), col) <- case hsmodImports of
1414
1409
[] -> (\ line -> ((line, 0 ), 0 )) <$> findPositionNoImports ps fileContents
1415
1410
_ -> findPositionFromImportsOrModuleDecl (map reLoc hsmodImports) last
@@ -1428,11 +1423,13 @@ findPositionNoImports ps fileContents =
1428
1423
where
1429
1424
L _ HsModule {.. } = astA ps
1430
1425
1426
+ findPositionAfterModuleName :: Annotated ParsedSource
1431
1427
#if MIN_VERSION_ghc(9,2,0)
1432
- findPositionAfterModuleName :: ParsedSource -> LocatedA ModuleName -> Maybe Int
1428
+ -> LocatedA ModuleName
1433
1429
#else
1434
- findPositionAfterModuleName :: Annotated ParsedSource -> Located ModuleName -> Maybe Int
1430
+ -> Located ModuleName
1435
1431
#endif
1432
+ -> Maybe Int
1436
1433
findPositionAfterModuleName ps hsmodName' = do
1437
1434
lineOffset <- whereKeywordLineOffset
1438
1435
case prevSrcSpan of
0 commit comments