Skip to content

Commit 95f99f3

Browse files
committed
Change of module decl and imports on rename
Add handling of WillRename Notification which changes the module declaration and all imports of the module to rename to the new name.
1 parent 1873226 commit 95f99f3

2 files changed

Lines changed: 1 addition & 4 deletions

File tree

plugins/hls-rename-plugin/src/Ide/Plugin/Rename.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,12 @@ import Control.Monad.Except (ExceptT, throwError)
1616
import Control.Monad.IO.Class (MonadIO, liftIO)
1717
import Control.Monad.Trans.Class (lift)
1818
import Control.Monad.Trans.Except (mapExceptT)
19-
import Control.Monad.Trans.Maybe (hoistMaybe,
20-
maybeToExceptT)
2119
import Data.Either (rights)
2220
import Data.Foldable (fold, minimumBy)
2321
import Data.Generics
2422
import Data.Hashable
2523
import Data.HashSet (HashSet)
2624
import qualified Data.HashSet as HS
27-
import Data.List (foldl')
2825
import Data.List.NonEmpty (NonEmpty ((:|)),
2926
groupWith)
3027
import qualified Data.List.NonEmpty as NE

plugins/hls-rename-plugin/src/Ide/Plugin/Rename/ModuleRename.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ instance Pretty Log where
5050
pretty log =
5151
"ModuleRename." <> case log of
5252
CorrectNames log -> "CorrectNames" <> colon <+> pretty log
53-
LogRenameDependencies oldName fps -> "Rename of" <+> pretty oldName <+> "in" <+> (pretty $ map fromNormalizedFilePath fps)
53+
LogRenameDependencies oldName fps -> "Rename of" <+> pretty oldName <+> "in files:" <+> (pretty $ map fromNormalizedFilePath fps)
5454
NoModuleName nfp -> "Could not execute rename of" <+> pretty (fromNormalizedFilePath nfp) <+> "as no module path could be determined."
5555
LogRenameModuleDeclaration nfp -> "Renaming module declaration for file" <+> pretty (fromNormalizedFilePath nfp)
5656

0 commit comments

Comments
 (0)