Skip to content

Commit bb7a03c

Browse files
committed
Avoid show
1 parent 9a8d879 commit bb7a03c

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

plugins/hls-alternate-number-format-plugin/src/Ide/Plugin/AlternateNumberFormat.hs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ module Ide.Plugin.AlternateNumberFormat (descriptor, Log(..)) where
88
import Control.Lens ((^.))
99
import Control.Monad.Except (ExceptT, MonadIO, liftIO)
1010
import qualified Data.HashMap.Strict as HashMap
11-
import Data.String (IsString)
12-
import Data.Text (Text)
11+
import Data.Text (Text, unpack)
1312
import qualified Data.Text as T
1413
import Development.IDE (GetParsedModule (GetParsedModule),
1514
GhcSession (GhcSession),
@@ -143,15 +142,15 @@ isInsideRealSrcSpan :: Position -> RealSrcSpan -> Bool
143142
p `isInsideRealSrcSpan` r = let (Range sp ep) = realSrcSpanToRange r in sp <= p && p <= ep
144143

145144
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
149148
case ghcSession of
150149
Just (hscEnv -> hsc_dflags -> sessionDynFlags, _) -> pure $ Just $ getNextPragmaInfo sessionDynFlags fileContents
151150
Nothing -> pure Nothing
152151

153152
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"
155154
. liftIO
156-
. runAction (show pId <> ".CollectLiterals") state
155+
. runAction (unpack pId <> ".CollectLiterals") state
157156
. use CollectLiterals

0 commit comments

Comments
 (0)