@@ -8,8 +8,7 @@ module Ide.Plugin.AlternateNumberFormat (descriptor, Log(..)) where
8
8
import Control.Lens ((^.) )
9
9
import Control.Monad.Except (ExceptT , MonadIO , liftIO )
10
10
import qualified Data.HashMap.Strict as HashMap
11
- import Data.String (IsString )
12
- import Data.Text (Text )
11
+ import Data.Text (Text , unpack )
13
12
import qualified Data.Text as T
14
13
import Development.IDE (GetParsedModule (GetParsedModule ),
15
14
GhcSession (GhcSession ),
@@ -143,15 +142,15 @@ isInsideRealSrcSpan :: Position -> RealSrcSpan -> Bool
143
142
p `isInsideRealSrcSpan` r = let (Range sp ep) = realSrcSpanToRange r in sp <= p && p <= ep
144
143
145
144
getFirstPragma :: MonadIO m => PluginId -> IdeState -> NormalizedFilePath -> ExceptT String m NextPragmaInfo
146
- getFirstPragma pId state nfp = handleMaybeM " Could not get NextPragmaInfo" $ do
147
- ghcSession <- liftIO $ runAction (show pId <> " .GhcSession" ) state $ useWithStale GhcSession nfp
148
- (_, fileContents) <- liftIO $ runAction (show pId <> " .GetFileContents" ) state $ getFileContents nfp
145
+ getFirstPragma ( PluginId pId) state nfp = handleMaybeM " Could not get NextPragmaInfo" $ do
146
+ ghcSession <- liftIO $ runAction (unpack pId <> " .GhcSession" ) state $ useWithStale GhcSession nfp
147
+ (_, fileContents) <- liftIO $ runAction (unpack pId <> " .GetFileContents" ) state $ getFileContents nfp
149
148
case ghcSession of
150
149
Just (hscEnv -> hsc_dflags -> sessionDynFlags, _) -> pure $ Just $ getNextPragmaInfo sessionDynFlags fileContents
151
150
Nothing -> pure Nothing
152
151
153
152
requestLiterals :: MonadIO m => PluginId -> IdeState -> NormalizedFilePath -> ExceptT String m CollectLiteralsResult
154
- requestLiterals pId state = handleMaybeM " Could not Collect Literals"
153
+ requestLiterals ( PluginId pId) state = handleMaybeM " Could not Collect Literals"
155
154
. liftIO
156
- . runAction (show pId <> " .CollectLiterals" ) state
155
+ . runAction (unpack pId <> " .CollectLiterals" ) state
157
156
. use CollectLiterals
0 commit comments