Skip to content

Commit bb91db0

Browse files
committed
relocate orphaned instances from rename plugin
1 parent b469eef commit bb91db0

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

ghcide/ghcide.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ library
6666
hiedb == 0.4.1.*,
6767
lsp-types ^>= 1.4.0.1,
6868
lsp ^>= 1.4.0.0 ,
69+
mod,
6970
monoid-subclasses,
7071
mtl,
7172
network-uri,

ghcide/src/Development/IDE/GHC/Orphans.hs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,22 @@ import Retrie.ExactPrint (Annotated)
3333

3434
import Development.IDE.GHC.Compat
3535
import Development.IDE.GHC.Util
36+
import Development.IDE.Types.Location
3637

3738
import Control.DeepSeq
3839
import Data.Aeson
3940
import Data.Bifunctor (Bifunctor (..))
4041
import Data.Hashable
42+
import Data.Mod.Word
4143
import Data.String (IsString (fromString))
4244
#if MIN_VERSION_ghc(9,0,0)
4345
import GHC.ByteCode.Types
4446
#else
4547
import ByteCodeTypes
4648
#endif
4749

50+
import Language.LSP.Types (UInt)
51+
4852
-- Orphan instances for types from the GHC API.
4953
instance Show CoreModule where show = prettyPrint
5054
instance NFData CoreModule where rnf = rwhnf
@@ -139,6 +143,11 @@ instance Show ModuleName where
139143
instance Hashable ModuleName where
140144
hashWithSalt salt = hashWithSalt salt . show
141145

146+
instance Hashable Location
147+
instance Hashable Range
148+
instance Hashable Position
149+
instance Hashable UInt
150+
instance Hashable (Mod a) where hash n = hash (unMod n)
142151

143152
instance NFData a => NFData (IdentifierDetails a) where
144153
rnf (IdentifierDetails a b) = rnf a `seq` rnf (length b)

plugins/hls-rename-plugin/hls-rename-plugin.cabal

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ library
3131
, hls-plugin-api ^>=1.3
3232
, lsp
3333
, lsp-types
34-
, mod
3534
, syb
3635
, text
3736
, transformers

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import Data.Hashable
2626
import Data.List.Extra
2727
import qualified Data.Map as M
2828
import Data.Maybe
29-
import Data.Mod.Word
3029
import qualified Data.Text as T
3130
import Development.IDE.Core.PositionMapping
3231
import Development.IDE.Core.RuleTypes
@@ -48,12 +47,6 @@ import Ide.Types
4847
import Language.LSP.Server
4948
import Language.LSP.Types
5049

51-
instance Hashable Location
52-
instance Hashable Range
53-
instance Hashable Position
54-
instance Hashable UInt
55-
instance Hashable (Mod a) where hash n = hash (unMod n)
56-
5750
descriptor :: PluginId -> PluginDescriptor IdeState
5851
descriptor pluginId = (defaultPluginDescriptor pluginId)
5952
{ pluginHandlers = mkPluginHandler STextDocumentRename renameProvider

0 commit comments

Comments
 (0)