packageEdit :: PackageAction
packageEdit = do
    idePackage <- ask
    let dirName = dropFileName (ipdCabalFile idePackage)
    modules <- liftIO $ allModules dirName
    package <- liftIO $ readPackageDescription normal (ipdCabalFile idePackage)
    if hasConfigs package
        then do
            liftIDE $ ideMessage High
                (__ "Cabal file with configurations can't be edited with the current version of the editor")
            liftIDE $ fileOpenThis $ ipdCabalFile idePackage
            return ()
        else do
            let flat = flattenPackageDescription package
            if hasUnknownTestTypes flat || hasUnknownBenchmarkTypes flat
                then do
                    liftIDE $ ideMessage High
                        (__ "Cabal file with tests or benchmarks of this type can't be edited with the current version of the editor")
                    liftIDE $ fileOpenThis $ ipdCabalFile idePackage
                    return ()
                else do
                    liftIDE $ editPackage flat dirName  modules (\ _ -> return ())
                    return ()
packageEdit :: PackageAction
packageEdit = do
    idePackage <- ask
    let dirName = dropFileName (ipdCabalFile idePackage)
    modules <- liftIO $ allModules dirName
    package <- liftIO $ readPackageDescription normal (ipdCabalFile idePackage)
    if hasConfigs package
        then do
            liftIDE $ ideMessage High
                (__ "Cabal file with configurations can't be edited with the current version of the editor")
            liftIDE $ fileOpenThis $ ipdCabalFile idePackage
            return ()
        else do
            let flat = flattenPackageDescription package
            if hasUnknownTestTypes flat || hasUnknownBenchmarkTypes flat
                then do
                    liftIDE $ ideMessage High
                        (__ "Cabal file with tests or benchmarks of this type can't be edited with the current version of the editor")
                    liftIDE $ fileOpenThis $ ipdCabalFile idePackage
                    return ()
                else do
                    liftIDE $ editPackage flat dirName  modules (\ _ -> return ())
                    return ()
packageEdit = do
    idePackage <- ask
    let dirName = dropFileName (ipdCabalFile idePackage)
    modules <- liftIO $ allModules dirName
    package <- liftIO $ readPackageDescription normal (ipdCabalFile idePackage)
    if hasConfigs package
        then do
            liftIDE $ ideMessage High
                (__ "Cabal file with configurations can't be edited with the current version of the editor")
            liftIDE $ fileOpenThis $ ipdCabalFile idePackage
            return ()
        else do
            let flat = flattenPackageDescription package
            if hasUnknownTestTypes flat || hasUnknownBenchmarkTypes flat
                then do
                    liftIDE $ ideMessage High
                        (__ "Cabal file with tests or benchmarks of this type can't be edited with the current version of the editor")
                    liftIDE $ fileOpenThis $ ipdCabalFile idePackage
                    return ()
                else do
                    liftIDE $ editPackage flat dirName  modules (\ _ -> return ())
                    return ()