You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- A plugin may be configurable as can be seen below:
306
306
--
307
307
-- @
308
308
-- {
@@ -317,7 +317,7 @@ data CustomConfig = forall r. CustomConfig (Properties r)
317
317
-- }
318
318
-- @
319
319
--
320
-
-- @globalOn@, @codeActionsOn@, and @codeLensOn@ etc. are called generic configs,
320
+
-- @globalOn@, @codeActionsOn@, and @codeLensOn@ etc. are called generic configs
321
321
-- which can be inferred from handlers registered by the plugin.
322
322
-- @config@ is called custom config, which is defined using 'Properties'.
323
323
dataConfigDescriptor=ConfigDescriptor{
@@ -344,38 +344,38 @@ defaultConfigDescriptor =
344
344
classHasTracing (MessageParamsm) =>PluginMethod (k::MethodType) (m::MethodFromClientk) where
345
345
346
346
--| Parse the configuration to check if this plugin is enabled.
347
-
-- Perform sanity checks on the message to see whether plugin is enabled
347
+
-- Perform sanity checks on the message to see whether the plugin is enabled
348
348
-- for this message in particular.
349
-
-- If a plugin is not enabled, its handlers, commands, etc... will not be
349
+
-- If a plugin is not enabled, its handlers, commands, etc. will not be
350
350
-- run for the given message.
351
351
--
352
-
-- Semantically, this method described whether a Plugin is enabled configuration wise
352
+
-- Semantically, this method describes whether a plugin is enabled configuration wise
353
353
-- and is allowed to respond to the message. This might depend on the URI that is
354
-
-- associated to the Message Parameters, but doesn't have to. There are requests
355
-
-- with no associated URI that, consequentially, can't inspect the URI.
354
+
-- associated to the Message Parameters. There are requests
355
+
-- with no associated URI that, consequentially, cannot inspect the URI.
356
356
--
357
-
--Common reason why a plugin might not be allowed to respond although it is enabled:
358
-
-- * Plugin can not handle requests associated to the specific URI
357
+
--A common reason why a plugin might not be allowed to respond although it is enabled:
358
+
-- * The plugin cannot handle requests associated with the specific URI
359
359
-- * Since the implementation of [cabal plugins](https://github.com/haskell/haskell-language-server/issues/2940)
360
-
-- HLS knows plugins specific for Haskell and specific for [Cabal file descriptions](https://cabal.readthedocs.io/en/3.6/cabal-package.html)
360
+
-- HLS knows plugins specific to Haskell and specific to [Cabal file descriptions](https://cabal.readthedocs.io/en/3.6/cabal-package.html)
361
361
--
362
362
-- Strictly speaking, we are conflating two concepts here:
363
-
-- * Dynamically enabled (e.g. enabled on a per-message basis)
363
+
-- * Dynamically enabled (e.g. on a per-message basis)
364
364
-- * Statically enabled (e.g. by configuration in the lsp-client)
365
365
-- * Strictly speaking, this might also change dynamically
366
366
--
367
-
-- But there is no use to split it up currently into two different methods for now.
367
+
-- But there is no use to split it up into two different methods for now.
368
368
pluginEnabled
369
369
::SMethodm
370
370
--^ Method type.
371
371
->MessageParamsm
372
372
--^ Whether a plugin is enabled might depend on the message parameters
373
-
--eg 'pluginFileType' specifies what file extension a plugin is allowed to handle
373
+
--e.g. 'pluginFileType' specifies which file extensions a plugin is allowed to handle
374
374
->PluginDescriptorc
375
-
--^ Contains meta information such as PluginId and what file types this
375
+
--^ Contains meta information such as PluginId and which file types this
376
376
-- plugin is able to handle.
377
377
->Config
378
-
--^ Generic config description, expected to hold 'PluginConfig' configuration
378
+
--^ Generic config description, expected to contain 'PluginConfig' configuration
379
379
-- for this plugin
380
380
->Bool
381
381
--^ Is this plugin enabled and allowed to respond to the given request
@@ -395,12 +395,12 @@ class PluginMethod Request m => PluginRequestMethod (m :: Method FromClient Requ
395
395
--| How to combine responses from different plugins.
396
396
--
397
397
-- For example, for Hover requests, we might have multiple producers of
398
-
-- Hover information, we do not want to decide which one to display to the user
399
-
-- but allow here to define how to merge two hover request responses into one
398
+
-- Hover information. We do not want to decide which one to display to the user
399
+
-- but instead allow to define how to merge two hover request responses into one
400
400
-- glorious hover box.
401
401
--
402
-
-- However, sometimes only one handler of a request can realistically exist,
403
-
-- such as TextDocumentFormatting, it is safe to just unconditionally report
402
+
-- However, as sometimes only one handler of a request can realistically exist
403
+
--(such as TextDocumentFormatting), it is safe to just unconditionally report
404
404
-- back one arbitrary result (arbitrary since it should only be one anyway).
0 commit comments