Skip to content

Commit a55eb71

Browse files
authored
Merge branch 'master' into retrie-9.2
2 parents ac9f3fb + 9a0684e commit a55eb71

File tree

9 files changed

+19
-19
lines changed

9 files changed

+19
-19
lines changed

ghcide/src/Development/IDE/Plugin/HLS.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ extensiblePlugins recorder xs = mempty { P.pluginHandlers = handlers }
197197
case nonEmpty fs of
198198
Nothing -> logAndReturnError recorder InvalidRequest (pluginNotEnabled m fs')
199199
Just fs -> do
200-
let msg e pid = "Exception in plugin " <> T.pack (show pid) <> "while processing " <> T.pack (show m) <> ": " <> T.pack (show e)
200+
let msg e pid = "Exception in plugin " <> T.pack (show pid) <> " while processing " <> T.pack (show m) <> ": " <> T.pack (show e)
201201
handlers = fmap (\(plid,_,handler) -> (plid,handler)) fs
202202
es <- runConcurrently msg (show m) handlers ide params
203203
let (errs,succs) = partitionEithers $ toList es

hls-plugin-api/src/Ide/PluginUtils.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,12 @@ allLspCmdIds pid commands = concatMap go commands
235235

236236
-- ---------------------------------------------------------------------
237237

238-
getNormalizedFilePath :: Monad m => PluginId -> Uri -> ExceptT String m NormalizedFilePath
239-
getNormalizedFilePath (PluginId plId) uri = handleMaybe errMsg
238+
getNormalizedFilePath :: Monad m => Uri -> ExceptT String m NormalizedFilePath
239+
getNormalizedFilePath uri = handleMaybe errMsg
240240
$ uriToNormalizedFilePath
241241
$ toNormalizedUri uri
242242
where
243-
errMsg = T.unpack $ "Error(" <> plId <> "): converting " <> getUri uri <> " to NormalizedFilePath"
243+
errMsg = T.unpack $ "Failed converting " <> getUri uri <> " to NormalizedFilePath"
244244

245245
-- ---------------------------------------------------------------------
246246
throwPluginError :: Monad m => String -> ExceptT String m b

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ collectLiteralsRule recorder = define (cmapWithPrio LogShake recorder) $ \Collec
8787
getExtensions = map GhcExtension . toList . extensionFlags . ms_hspp_opts . pm_mod_summary
8888

8989
codeActionHandler :: PluginMethodHandler IdeState 'TextDocumentCodeAction
90-
codeActionHandler state plId (CodeActionParams _ _ docId currRange _) = pluginResponse $ do
91-
nfp <- getNormalizedFilePath plId (docId ^. L.uri)
90+
codeActionHandler state _ (CodeActionParams _ _ docId currRange _) = pluginResponse $ do
91+
nfp <- getNormalizedFilePath (docId ^. L.uri)
9292
CLR{..} <- requestLiterals state nfp
9393
pragma <- getFirstPragma state nfp
9494
-- remove any invalid literals (see validTarget comment)

plugins/hls-call-hierarchy-plugin/src/Ide/Plugin/CallHierarchy/Internal.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ callHierarchyId = PluginId "callHierarchy"
4949

5050
-- | Render prepare call hierarchy request.
5151
prepareCallHierarchy :: PluginMethodHandler IdeState TextDocumentPrepareCallHierarchy
52-
prepareCallHierarchy state pluginId param = pluginResponse $ do
53-
nfp <- getNormalizedFilePath pluginId (param ^. L.textDocument ^. L.uri)
52+
prepareCallHierarchy state _ param = pluginResponse $ do
53+
nfp <- getNormalizedFilePath (param ^. L.textDocument ^. L.uri)
5454
items <- liftIO (runAction "CallHierarchy.prepareHierarchy" state (prepareCallHierarchyItem nfp (param ^. L.position)))
5555
pure (List <$> items)
5656

plugins/hls-change-type-signature-plugin/src/Ide/Plugin/ChangeTypeSignature.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ descriptor :: PluginDescriptor IdeState
3838
descriptor = (defaultPluginDescriptor changeTypeSignatureId) { pluginHandlers = mkPluginHandler STextDocumentCodeAction codeActionHandler }
3939

4040
codeActionHandler :: PluginMethodHandler IdeState 'TextDocumentCodeAction
41-
codeActionHandler ideState plId CodeActionParams {_textDocument = TextDocumentIdentifier uri, _context = CodeActionContext (List diags) _} = pluginResponse $ do
42-
nfp <- getNormalizedFilePath plId uri
41+
codeActionHandler ideState _ CodeActionParams {_textDocument = TextDocumentIdentifier uri, _context = CodeActionContext (List diags) _} = pluginResponse $ do
42+
nfp <- getNormalizedFilePath uri
4343
decls <- getDecls ideState nfp
4444
let actions = mapMaybe (generateAction uri decls) diags
4545
pure $ List actions

plugins/hls-class-plugin/src/Ide/Plugin/Class/CodeAction.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ import Language.LSP.Types
3737
import qualified Language.LSP.Types.Lens as J
3838

3939
addMethodPlaceholders :: PluginId -> CommandFunction IdeState AddMinimalMethodsParams
40-
addMethodPlaceholders plId state param@AddMinimalMethodsParams{..} = do
40+
addMethodPlaceholders _ state param@AddMinimalMethodsParams{..} = do
4141
caps <- getClientCapabilities
4242
pluginResponse $ do
43-
nfp <- getNormalizedFilePath plId uri
43+
nfp <- getNormalizedFilePath uri
4444
pm <- handleMaybeM "Unable to GetParsedModule"
4545
$ liftIO
4646
$ runAction "classplugin.addMethodPlaceholders.GetParsedModule" state
@@ -81,7 +81,7 @@ addMethodPlaceholders plId state param@AddMinimalMethodsParams{..} = do
8181
-- sensitive to the format of diagnostic messages from GHC.
8282
codeAction :: Recorder (WithPriority Log) -> PluginMethodHandler IdeState TextDocumentCodeAction
8383
codeAction recorder state plId (CodeActionParams _ _ docId _ context) = pluginResponse $ do
84-
nfp <- getNormalizedFilePath plId uri
84+
nfp <- getNormalizedFilePath uri
8585
actions <- join <$> mapM (mkActions nfp) methodDiags
8686
pure $ List actions
8787
where

plugins/hls-class-plugin/src/Ide/Plugin/Class/CodeLens.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import qualified Language.LSP.Types.Lens as J
2424

2525
codeLens :: PluginMethodHandler IdeState TextDocumentCodeLens
2626
codeLens state plId CodeLensParams{..} = pluginResponse $ do
27-
nfp <- getNormalizedFilePath plId uri
27+
nfp <- getNormalizedFilePath uri
2828
tmr <- handleMaybeM "Unable to typecheck"
2929
$ liftIO
3030
$ runAction "classplugin.TypeCheck" state

plugins/hls-explicit-fixity-plugin/src/Ide/Plugin/ExplicitFixity.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ descriptor recorder = (defaultPluginDescriptor pluginId)
4949
}
5050

5151
hover :: PluginMethodHandler IdeState TextDocumentHover
52-
hover state plId (HoverParams (TextDocumentIdentifier uri) pos _) = pluginResponse $ do
53-
nfp <- getNormalizedFilePath plId uri
52+
hover state _ (HoverParams (TextDocumentIdentifier uri) pos _) = pluginResponse $ do
53+
nfp <- getNormalizedFilePath uri
5454
fixityTrees <- handleMaybeM "ExplicitFixity: Unable to get fixity"
5555
$ liftIO
5656
$ runAction "ExplicitFixity.GetFixity" state

plugins/hls-gadt-plugin/src/Ide/Plugin/GADT.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ toGADTSyntaxCommandId = "GADT.toGADT"
5252

5353
-- | A command replaces H98 data decl with GADT decl in place
5454
toGADTCommand :: PluginId -> CommandFunction IdeState ToGADTParams
55-
toGADTCommand plId state ToGADTParams{..} = pluginResponse $ do
56-
nfp <- getNormalizedFilePath plId uri
55+
toGADTCommand _ state ToGADTParams{..} = pluginResponse $ do
56+
nfp <- getNormalizedFilePath uri
5757
(decls, exts) <- getInRangeH98DeclsAndExts state range nfp
5858
(L ann decl) <- case decls of
5959
[d] -> pure d
@@ -83,7 +83,7 @@ toGADTCommand plId state ToGADTParams{..} = pluginResponse $ do
8383

8484
codeActionHandler :: PluginMethodHandler IdeState TextDocumentCodeAction
8585
codeActionHandler state plId (CodeActionParams _ _ doc range _) = pluginResponse $ do
86-
nfp <- getNormalizedFilePath plId (doc ^. L.uri)
86+
nfp <- getNormalizedFilePath (doc ^. L.uri)
8787
(inRangeH98Decls, _) <- getInRangeH98DeclsAndExts state range nfp
8888
let actions = map (mkAction . printOutputable . tcdLName . unLoc) inRangeH98Decls
8989
pure $ List actions

0 commit comments

Comments
 (0)