Skip to content

Commit 2b49d9d

Browse files
authored
Give plugins descriptions, include versions of key dependencies (#3903)
* Plugins have descriptions * Plugins based on external tools report the version they are built with * Sort plugins
1 parent 7b4f54d commit 2b49d9d

File tree

39 files changed

+105
-62
lines changed

39 files changed

+105
-62
lines changed

exe/Main.hs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ import Data.Function ((&))
1313
import Data.Functor ((<&>))
1414
import Data.Maybe (catMaybes)
1515
import Data.Text (Text)
16-
import Ide.Logger (Doc, Priority (Error, Info),
16+
import qualified HlsPlugins as Plugins
17+
import Ide.Arguments (Arguments (..),
18+
GhcideArguments (..),
19+
getArguments)
20+
import Ide.Logger (Doc, Priority (Error, Info),
1721
Recorder,
1822
WithPriority (WithPriority, priority),
1923
cfilter, cmapWithPrio,
2024
defaultLayoutOptions,
2125
layoutPretty, logWith,
2226
makeDefaultStderrRecorder,
2327
renderStrict, withFileRecorder)
24-
import qualified Ide.Logger as Logger
25-
import qualified HlsPlugins as Plugins
26-
import Ide.Arguments (Arguments (..),
27-
GhcideArguments (..),
28-
getArguments)
28+
import qualified Ide.Logger as Logger
2929
import Ide.Main (defaultMain)
3030
import qualified Ide.Main as IdeMain
3131
import Ide.PluginUtils (pluginDescToIdePlugins)
@@ -70,7 +70,7 @@ main = do
7070
])
7171
-- This plugin just installs a handler for the `initialized` notification, which then
7272
-- picks up the LSP environment and feeds it to our recorders
73-
let lspRecorderPlugin = (defaultPluginDescriptor "LSPRecorderCallback")
73+
let lspRecorderPlugin = (defaultPluginDescriptor "LSPRecorderCallback" "Internal plugin")
7474
{ pluginNotificationHandlers = mkPluginNotificationHandler LSP.SMethod_Initialized $ \_ _ _ _ -> do
7575
env <- LSP.getLspEnv
7676
liftIO $ (cb1 <> cb2) env

ghcide/exe/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ main = withTelemetryLogger $ \telemetryLogger -> do
100100
(lspMessageRecorder, cb2) <- Logger.withBacklog Logger.lspClientMessageRecorder
101101
-- This plugin just installs a handler for the `initialized` notification, which then
102102
-- picks up the LSP environment and feeds it to our recorders
103-
let lspRecorderPlugin = (defaultPluginDescriptor "LSPRecorderCallback")
103+
let lspRecorderPlugin = (defaultPluginDescriptor "LSPRecorderCallback" "Internal plugin")
104104
{ pluginNotificationHandlers = mkPluginNotificationHandler LSP.SMethod_Initialized $ \_ _ _ _ -> do
105105
env <- LSP.getLspEnv
106106
liftIO $ (cb1 <> cb2) env

ghcide/src/Development/IDE/LSP/Notifications.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ whenUriFile :: Uri -> (NormalizedFilePath -> IO ()) -> IO ()
5454
whenUriFile uri act = whenJust (LSP.uriToFilePath uri) $ act . toNormalizedFilePath'
5555

5656
descriptor :: Recorder (WithPriority Log) -> PluginId -> PluginDescriptor IdeState
57-
descriptor recorder plId = (defaultPluginDescriptor plId) { pluginNotificationHandlers = mconcat
57+
descriptor recorder plId = (defaultPluginDescriptor plId desc) { pluginNotificationHandlers = mconcat
5858
[ mkPluginNotificationHandler LSP.SMethod_TextDocumentDidOpen $
5959
\ide vfs _ (DidOpenTextDocumentParams TextDocumentItem{_uri,_version}) -> liftIO $ do
6060
atomically $ updatePositionMapping ide (VersionedTextDocumentIdentifier _uri _version) []
@@ -142,6 +142,8 @@ descriptor recorder plId = (defaultPluginDescriptor plId) { pluginNotificationHa
142142
-- (which restart the Shake build) run after everything else
143143
pluginPriority = ghcideNotificationsPluginPriority
144144
}
145+
where
146+
desc = "Handles basic notifications for ghcide"
145147

146148
ghcideNotificationsPluginPriority :: Natural
147149
ghcideNotificationsPluginPriority = defaultPluginPriority - 900

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,15 @@ ghcideCompletionsPluginPriority :: Natural
7171
ghcideCompletionsPluginPriority = defaultPluginPriority
7272

7373
descriptor :: Recorder (WithPriority Log) -> PluginId -> PluginDescriptor IdeState
74-
descriptor recorder plId = (defaultPluginDescriptor plId)
74+
descriptor recorder plId = (defaultPluginDescriptor plId desc)
7575
{ pluginRules = produceCompletions recorder
7676
, pluginHandlers = mkPluginHandler SMethod_TextDocumentCompletion getCompletionsLSP
7777
<> mkResolveHandler SMethod_CompletionItemResolve resolveCompletion
7878
, pluginConfigDescriptor = defaultConfigDescriptor {configCustomConfig = mkCustomConfig properties}
7979
, pluginPriority = ghcideCompletionsPluginPriority
8080
}
81+
where
82+
desc = "Provides Haskell completions"
8183

8284

8385
produceCompletions :: Recorder (WithPriority Log) -> Rules ()

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ descriptors recorder =
4242
-- ---------------------------------------------------------------------
4343

4444
descriptor :: PluginId -> PluginDescriptor IdeState
45-
descriptor plId = (defaultPluginDescriptor plId)
45+
descriptor plId = (defaultPluginDescriptor plId desc)
4646
{ pluginHandlers = mkPluginHandler SMethod_TextDocumentHover hover'
4747
<> mkPluginHandler SMethod_TextDocumentDocumentSymbol moduleOutline
4848
<> mkPluginHandler SMethod_TextDocumentDefinition (\ide _ DefinitionParams{..} ->
@@ -56,6 +56,8 @@ descriptor plId = (defaultPluginDescriptor plId)
5656

5757
pluginConfigDescriptor = defaultConfigDescriptor
5858
}
59+
where
60+
desc = "Provides core IDE features for Haskell"
5961

6062
-- ---------------------------------------------------------------------
6163

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ newtype WaitForIdeRuleResult = WaitForIdeRuleResult { ideResultSuccess::Bool}
7777
deriving newtype (FromJSON, ToJSON)
7878

7979
plugin :: PluginDescriptor IdeState
80-
plugin = (defaultPluginDescriptor "test") {
80+
plugin = (defaultPluginDescriptor "test" "") {
8181
pluginHandlers = mkPluginHandler (SMethod_CustomMethod (Proxy @"test")) $ \st _ ->
8282
testRequestHandler' st
8383
}
@@ -166,7 +166,7 @@ blockCommandId :: Text
166166
blockCommandId = "ghcide.command.block"
167167

168168
blockCommandDescriptor :: PluginId -> PluginDescriptor state
169-
blockCommandDescriptor plId = (defaultPluginDescriptor plId) {
169+
blockCommandDescriptor plId = (defaultPluginDescriptor plId "") {
170170
pluginCommands = [PluginCommand (CommandId blockCommandId) "blocks forever" blockCommandHandler]
171171
}
172172

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,15 @@ typeLensCommandId = "typesignature.add"
9494

9595
descriptor :: Recorder (WithPriority Log) -> PluginId -> PluginDescriptor IdeState
9696
descriptor recorder plId =
97-
(defaultPluginDescriptor plId)
97+
(defaultPluginDescriptor plId desc)
9898
{ pluginHandlers = mkPluginHandler SMethod_TextDocumentCodeLens codeLensProvider
9999
<> mkResolveHandler SMethod_CodeLensResolve codeLensResolveProvider
100100
, pluginCommands = [PluginCommand (CommandId typeLensCommandId) "adds a signature" commandHandler]
101101
, pluginRules = rules recorder
102102
, pluginConfigDescriptor = defaultConfigDescriptor {configCustomConfig = mkCustomConfig properties}
103103
}
104+
where
105+
desc = "Provides code lenses type signatures"
104106

105107
properties :: Properties '[ 'PropertyKey "mode" (TEnum Mode)]
106108
properties = emptyProperties

ghcide/test/exe/ExceptionTests.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ tests recorder logger = do
4141
[ testCase "PluginHandlers" $ do
4242
let pluginId = "plugin-handler-exception"
4343
plugins = pluginDescToIdePlugins $
44-
[ (defaultPluginDescriptor pluginId)
44+
[ (defaultPluginDescriptor pluginId "")
4545
{ pluginHandlers = mconcat
4646
[ mkPluginHandler SMethod_TextDocumentCodeLens $ \_ _ _-> do
4747
_ <- liftIO $ throwIO DivideByZero
@@ -62,7 +62,7 @@ tests recorder logger = do
6262
let pluginId = "command-exception"
6363
commandId = CommandId "exception"
6464
plugins = pluginDescToIdePlugins $
65-
[ (defaultPluginDescriptor pluginId)
65+
[ (defaultPluginDescriptor pluginId "")
6666
{ pluginCommands =
6767
[ PluginCommand commandId "Causes an exception" $ \_ (_::Int) -> do
6868
_ <- liftIO $ throwIO DivideByZero
@@ -84,7 +84,7 @@ tests recorder logger = do
8484
, testCase "Notification Handlers" $ do
8585
let pluginId = "notification-exception"
8686
plugins = pluginDescToIdePlugins $
87-
[ (defaultPluginDescriptor pluginId)
87+
[ (defaultPluginDescriptor pluginId "")
8888
{ pluginNotificationHandlers = mconcat
8989
[ mkPluginNotificationHandler SMethod_TextDocumentDidOpen $ \_ _ _ _ ->
9090
liftIO $ throwIO DivideByZero
@@ -137,7 +137,7 @@ pluginOrderTestCase recorder logger msg err1 err2 =
137137
testCase msg $ do
138138
let pluginId = "error-order-test"
139139
plugins = pluginDescToIdePlugins $
140-
[ (defaultPluginDescriptor pluginId)
140+
[ (defaultPluginDescriptor pluginId "")
141141
{ pluginHandlers = mconcat
142142
[ mkPluginHandler SMethod_TextDocumentCodeLens $ \_ _ _-> do
143143
throwError $ err1 "error test"

ghcide/test/exe/UnitTests.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ tests recorder logger = do
8080
}
8181
| i <- [1..20]
8282
] ++ Ghcide.descriptors (cmapWithPrio LogGhcIde recorder)
83-
priorityPluginDescriptor i = (defaultPluginDescriptor $ fromString $ show i){pluginPriority = i}
83+
priorityPluginDescriptor i = (defaultPluginDescriptor (fromString $ show i) ""){pluginPriority = i}
8484

8585
testIde recorder (IDE.testing (cmapWithPrio LogIDEMain recorder) logger plugins) $ do
8686
_ <- createDoc "A.hs" "haskell" "module A where"

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
module Ide.Types
2626
( PluginDescriptor(..), defaultPluginDescriptor, defaultCabalPluginDescriptor
2727
, defaultPluginPriority
28+
, describePlugin
2829
, IdeCommand(..)
2930
, IdeMethod(..)
3031
, IdeNotification(..)
@@ -104,6 +105,7 @@ import Language.LSP.VFS
104105
import Numeric.Natural
105106
import OpenTelemetry.Eventlog
106107
import Options.Applicative (ParserInfo)
108+
import Prettyprinter as PP
107109
import System.FilePath
108110
import System.IO.Unsafe
109111
import Text.Regex.TDFA.Text ()
@@ -266,6 +268,7 @@ instance ToJSON PluginConfig where
266268

267269
data PluginDescriptor (ideState :: Type) =
268270
PluginDescriptor { pluginId :: !PluginId
271+
, pluginDescription :: !T.Text
269272
-- ^ Unique identifier of the plugin.
270273
, pluginPriority :: Natural
271274
-- ^ Plugin handlers are called in priority order, higher priority first
@@ -283,6 +286,13 @@ data PluginDescriptor (ideState :: Type) =
283286
-- The file extension must have a leading '.'.
284287
}
285288

289+
describePlugin :: PluginDescriptor c -> Doc ann
290+
describePlugin p =
291+
let
292+
PluginId pid = pluginId p
293+
pdesc = pluginDescription p
294+
in pretty pid <> ":" <> nest 4 (PP.line <> pretty pdesc)
295+
286296
-- | Check whether the given plugin descriptor is responsible for the file with the given path.
287297
-- Compares the file extension of the file at the given path with the file extension
288298
-- the plugin is responsible for.
@@ -894,10 +904,11 @@ defaultPluginPriority = 1000
894904
--
895905
-- and handlers will be enabled for files with the appropriate file
896906
-- extensions.
897-
defaultPluginDescriptor :: PluginId -> PluginDescriptor ideState
898-
defaultPluginDescriptor plId =
907+
defaultPluginDescriptor :: PluginId -> T.Text -> PluginDescriptor ideState
908+
defaultPluginDescriptor plId desc =
899909
PluginDescriptor
900910
plId
911+
desc
901912
defaultPluginPriority
902913
mempty
903914
mempty
@@ -914,10 +925,11 @@ defaultPluginDescriptor plId =
914925
--
915926
-- Handles files with the following extensions:
916927
-- * @.cabal@
917-
defaultCabalPluginDescriptor :: PluginId -> PluginDescriptor ideState
918-
defaultCabalPluginDescriptor plId =
928+
defaultCabalPluginDescriptor :: PluginId -> T.Text -> PluginDescriptor ideState
929+
defaultCabalPluginDescriptor plId desc =
919930
PluginDescriptor
920931
plId
932+
desc
921933
defaultPluginPriority
922934
mempty
923935
mempty

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ instance Pretty Log where
4444
LogShake log -> pretty log
4545

4646
descriptor :: Recorder (WithPriority Log) -> PluginId -> PluginDescriptor IdeState
47-
descriptor recorder pId = (defaultPluginDescriptor pId)
47+
descriptor recorder pId = (defaultPluginDescriptor pId "Provides code actions to convert numeric literals to different formats")
4848
{ pluginHandlers = mkPluginHandler SMethod_TextDocumentCodeAction codeActionHandler
4949
, pluginRules = collectLiteralsRule recorder
5050
}

plugins/hls-cabal-fmt-plugin/src/Ide/Plugin/CabalFmt.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ instance Pretty Log where
3939

4040
descriptor :: Recorder (WithPriority Log) -> PluginId -> PluginDescriptor IdeState
4141
descriptor recorder plId =
42-
(defaultCabalPluginDescriptor plId)
42+
(defaultCabalPluginDescriptor plId "Provides formatting of cabal files with cabal-fmt")
4343
{ pluginHandlers = mkFormattingHandlers (provider recorder)
4444
}
4545

plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ instance Pretty Log where
8080

8181
descriptor :: Recorder (WithPriority Log) -> PluginId -> PluginDescriptor IdeState
8282
descriptor recorder plId =
83-
(defaultCabalPluginDescriptor plId)
83+
(defaultCabalPluginDescriptor plId "Provides a variety of IDE features in cabal files")
8484
{ pluginRules = cabalRules recorder
8585
, pluginHandlers =
8686
mconcat

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE OverloadedStrings #-}
12
module Ide.Plugin.CallHierarchy (descriptor) where
23

34
import Development.IDE
@@ -6,7 +7,7 @@ import Ide.Types
67
import Language.LSP.Protocol.Message
78

89
descriptor :: PluginId -> PluginDescriptor IdeState
9-
descriptor plId = (defaultPluginDescriptor plId)
10+
descriptor plId = (defaultPluginDescriptor plId "Provides call-hierarchy support in Haskell")
1011
{ Ide.Types.pluginHandlers =
1112
mkPluginHandler SMethod_TextDocumentPrepareCallHierarchy X.prepareCallHierarchy
1213
<> mkPluginHandler SMethod_CallHierarchyIncomingCalls X.incomingCalls

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ import Language.LSP.Protocol.Types
3333
import Text.Regex.TDFA ((=~))
3434

3535
descriptor :: PluginId -> PluginDescriptor IdeState
36-
descriptor plId = (defaultPluginDescriptor plId) { pluginHandlers = mkPluginHandler SMethod_TextDocumentCodeAction (codeActionHandler plId) }
36+
descriptor plId = (defaultPluginDescriptor plId "Provides a code action to change the type signature of a binding if it is wrong")
37+
{ pluginHandlers = mkPluginHandler SMethod_TextDocumentCodeAction (codeActionHandler plId) }
3738

3839
codeActionHandler :: PluginId -> PluginMethodHandler IdeState 'Method_TextDocumentCodeAction
3940
codeActionHandler plId ideState _ CodeActionParams {_textDocument = TextDocumentIdentifier uri, _context = CodeActionContext diags _ _} = do

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Ide.Plugin.Class.Types
88
import Ide.Types
99
import Language.LSP.Protocol.Message
1010
descriptor :: Recorder (WithPriority Log) -> PluginId -> PluginDescriptor IdeState
11-
descriptor recorder plId = (defaultPluginDescriptor plId)
11+
descriptor recorder plId = (defaultPluginDescriptor plId "Provides code actions and lenses for working with typeclasses")
1212
{ pluginCommands = commands plId
1313
, pluginRules = getInstanceBindTypeSigsRule recorder >> getInstanceBindLensRule recorder
1414
, pluginHandlers = mkPluginHandler SMethod_TextDocumentCodeAction (codeAction recorder)

plugins/hls-code-range-plugin/src/Ide/Plugin/CodeRange.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ import Language.LSP.Protocol.Types (FoldingRange (..),
5757
import Prelude hiding (log, span)
5858

5959
descriptor :: Recorder (WithPriority Log) -> PluginId -> PluginDescriptor IdeState
60-
descriptor recorder plId = (defaultPluginDescriptor plId)
60+
descriptor recorder plId = (defaultPluginDescriptor plId "Provides selection and folding ranges for Haskell")
6161
{ pluginHandlers = mkPluginHandler SMethod_TextDocumentSelectionRange (selectionRangeHandler recorder)
6262
<> mkPluginHandler SMethod_TextDocumentFoldingRange (foldingRangeHandler recorder)
6363
, pluginRules = codeRangeRule (cmapWithPrio LogRules recorder)

plugins/hls-eval-plugin/src/Ide/Plugin/Eval.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{-# LANGUAGE DuplicateRecordFields #-}
2+
{-# LANGUAGE OverloadedStrings #-}
23
{-# LANGUAGE ScopedTypeVariables #-}
34
{-# OPTIONS_GHC -Wwarn #-}
45
{-# LANGUAGE LambdaCase #-}
@@ -34,7 +35,7 @@ instance Pretty Log where
3435
-- |Plugin descriptor
3536
descriptor :: Recorder (WithPriority Log) -> PluginId -> PluginDescriptor IdeState
3637
descriptor recorder plId =
37-
(defaultPluginDescriptor plId)
38+
(defaultPluginDescriptor plId "Provies a code lens to evaluate expressions in doctest comments")
3839
{ pluginHandlers = mkPluginHandler SMethod_TextDocumentCodeLens CL.codeLens
3940
, pluginCommands = [CL.evalCommand plId]
4041
, pluginRules = rules (cmapWithPrio LogEvalRules recorder)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import Language.LSP.Protocol.Message
3434
import Language.LSP.Protocol.Types
3535

3636
descriptor :: Recorder (WithPriority Log) -> PluginId -> PluginDescriptor IdeState
37-
descriptor recorder pluginId = (defaultPluginDescriptor pluginId)
37+
descriptor recorder pluginId = (defaultPluginDescriptor pluginId "Provides fixity information in hovers")
3838
{ pluginRules = fixityRule recorder
3939
, pluginHandlers = mkPluginHandler SMethod_TextDocumentHover hover
4040
-- Make this plugin has a lower priority than ghcide's plugin to ensure

plugins/hls-explicit-imports-plugin/src/Ide/Plugin/ExplicitImports.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ descriptorForModules
9191
descriptorForModules recorder modFilter plId =
9292
let resolveRecorder = cmapWithPrio LogResolve recorder
9393
codeActionHandlers = mkCodeActionHandlerWithResolve resolveRecorder (codeActionProvider recorder) (codeActionResolveProvider recorder)
94-
in (defaultPluginDescriptor plId)
94+
in (defaultPluginDescriptor plId "Provides a code action to make imports explicit")
9595
{
9696
-- This plugin provides a command handler
9797
pluginCommands = [PluginCommand importCommandId "Explicit import command" (runImportCommand recorder)],

plugins/hls-explicit-record-fields-plugin/src/Ide/Plugin/ExplicitFields.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ descriptor :: Recorder (WithPriority Log) -> PluginId -> PluginDescriptor IdeSta
106106
descriptor recorder plId =
107107
let resolveRecorder = cmapWithPrio LogResolve recorder
108108
(carCommands, caHandlers) = mkCodeActionWithResolveAndCommand resolveRecorder plId codeActionProvider codeActionResolveProvider
109-
in (defaultPluginDescriptor plId)
109+
in (defaultPluginDescriptor plId "Provides a code action to make record wildcards explicit")
110110
{ pluginHandlers = caHandlers
111111
, pluginCommands = carCommands
112112
, pluginRules = collectRecordsRule recorder *> collectNamesRule

plugins/hls-floskell-plugin/src/Ide/Plugin/Floskell.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE OverloadedStrings #-}
23

34
module Ide.Plugin.Floskell
@@ -20,9 +21,11 @@ import Language.LSP.Protocol.Types
2021
-- ---------------------------------------------------------------------
2122

2223
descriptor :: PluginId -> PluginDescriptor IdeState
23-
descriptor plId = (defaultPluginDescriptor plId)
24+
descriptor plId = (defaultPluginDescriptor plId desc)
2425
{ pluginHandlers = mkFormattingHandlers provider
2526
}
27+
where
28+
desc = "Provides formatting of Haskell files via floskell. Built with floskell-" <> VERSION_floskell
2629

2730
-- ---------------------------------------------------------------------
2831

plugins/hls-fourmolu-plugin/src/Ide/Plugin/Fourmolu.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ import Text.Read (readMaybe)
4949

5050
descriptor :: Recorder (WithPriority LogEvent) -> PluginId -> PluginDescriptor IdeState
5151
descriptor recorder plId =
52-
(defaultPluginDescriptor plId)
52+
(defaultPluginDescriptor plId desc)
5353
{ pluginHandlers = mkFormattingHandlers $ provider recorder plId
5454
, pluginConfigDescriptor = defaultConfigDescriptor{configCustomConfig = mkCustomConfig properties}
5555
}
56+
where
57+
desc = "Provides formatting of Haskell files via fourmolu. Built with fourmolu-" <> VERSION_fourmolu
5658

5759
properties :: Properties '[ 'PropertyKey "external" 'TBoolean]
5860
properties =

0 commit comments

Comments
 (0)