-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Haskell Language Server API for plugin communication
--
-- Please see the README on GitHub at
-- https://github.com/haskell/haskell-language-server#readme
@package hls-plugin-api
@version 1.0.0.0
-- | Provides an implementation of the ghcide Logger which uses
-- System.Log.Logger under the hood.
module Ide.Logger
logm :: MonadIO m => String -> m ()
debugm :: MonadIO m => String -> m ()
warningm :: MonadIO m => String -> m ()
errorm :: MonadIO m => String -> m ()
module Ide.Plugin.Config
-- | Given a DidChangeConfigurationNotification message, this function
-- returns the parsed Config object if possible.
getConfigFromNotification :: Config -> Value -> Either Text Config
-- | We (initially anyway) mirror the hie configuration, so that existing
-- clients can simply switch executable and not have any nasty surprises.
-- There will be surprises relating to config options being ignored,
-- initially though.
data Config
Config :: CheckParents -> !Bool -> !Bool -> !Bool -> !Int -> !Int -> !Bool -> !Bool -> !Bool -> !Text -> !Int -> !Map Text PluginConfig -> Config
[checkParents] :: Config -> CheckParents
[checkProject] :: Config -> !Bool
[hlintOn] :: Config -> !Bool
[diagnosticsOnChange] :: Config -> !Bool
[maxNumberOfProblems] :: Config -> !Int
[diagnosticsDebounceDuration] :: Config -> !Int
[liquidOn] :: Config -> !Bool
[completionSnippetsOn] :: Config -> !Bool
[formatOnImportOn] :: Config -> !Bool
[formattingProvider] :: Config -> !Text
[maxCompletions] :: Config -> !Int
[plugins] :: Config -> !Map Text PluginConfig
parseConfig :: Config -> Value -> Parser Config
-- | A PluginConfig is a generic configuration for a given HLS plugin. It
-- provides a "big switch" to turn it on or off as a whole, as well as
-- small switches per feature, and a slot for custom config. This
-- provides a regular naming scheme for all plugin config.
data PluginConfig
PluginConfig :: !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Object -> PluginConfig
[plcGlobalOn] :: PluginConfig -> !Bool
[plcCodeActionsOn] :: PluginConfig -> !Bool
[plcCodeLensOn] :: PluginConfig -> !Bool
[plcDiagnosticsOn] :: PluginConfig -> !Bool
[plcHoverOn] :: PluginConfig -> !Bool
[plcSymbolsOn] :: PluginConfig -> !Bool
[plcCompletionOn] :: PluginConfig -> !Bool
[plcRenameOn] :: PluginConfig -> !Bool
[plcConfig] :: PluginConfig -> !Object
data CheckParents
NeverCheck :: CheckParents
CheckOnClose :: CheckParents
CheckOnSaveAndClose :: CheckParents
AlwaysCheck :: CheckParents
instance Data.Aeson.Types.ToJSON.ToJSON Ide.Plugin.Config.CheckParents
instance Data.Aeson.Types.FromJSON.FromJSON Ide.Plugin.Config.CheckParents
instance GHC.Generics.Generic Ide.Plugin.Config.CheckParents
instance GHC.Show.Show Ide.Plugin.Config.CheckParents
instance GHC.Classes.Ord Ide.Plugin.Config.CheckParents
instance GHC.Classes.Eq Ide.Plugin.Config.CheckParents
instance GHC.Classes.Eq Ide.Plugin.Config.PluginConfig
instance GHC.Show.Show Ide.Plugin.Config.PluginConfig
instance GHC.Classes.Eq Ide.Plugin.Config.Config
instance GHC.Show.Show Ide.Plugin.Config.Config
instance Data.Default.Class.Default Ide.Plugin.Config.Config
instance Data.Aeson.Types.ToJSON.ToJSON Ide.Plugin.Config.Config
instance Data.Default.Class.Default Ide.Plugin.Config.PluginConfig
instance Data.Aeson.Types.ToJSON.ToJSON Ide.Plugin.Config.PluginConfig
instance Data.Aeson.Types.FromJSON.FromJSON Ide.Plugin.Config.PluginConfig
module Ide.Types
newtype IdePlugins ideState
IdePlugins :: Map PluginId (PluginDescriptor ideState) -> IdePlugins ideState
[ipMap] :: IdePlugins ideState -> Map PluginId (PluginDescriptor ideState)
data PluginDescriptor ideState
PluginDescriptor :: !PluginId -> !Rules () -> ![PluginCommand ideState] -> PluginHandlers ideState -> PluginDescriptor ideState
[pluginId] :: PluginDescriptor ideState -> !PluginId
[pluginRules] :: PluginDescriptor ideState -> !Rules ()
[pluginCommands] :: PluginDescriptor ideState -> ![PluginCommand ideState]
[pluginHandlers] :: PluginDescriptor ideState -> PluginHandlers ideState
-- | Methods that can be handled by plugins. ExtraParams captures
-- any extra data the IDE passes to the handlers for this method Only
-- methods for which we know how to combine responses can be instances of
-- PluginMethod
class HasTracing (MessageParams m) => PluginMethod m
-- | Parse the configuration to check if this plugin is enabled
pluginEnabled :: PluginMethod m => SMethod m -> PluginId -> Config -> Bool
-- | How to combine responses from different plugins
combineResponses :: PluginMethod m => SMethod m -> Config -> ClientCapabilities -> MessageParams m -> NonEmpty (ResponseResult m) -> ResponseResult m
-- | How to combine responses from different plugins
combineResponses :: (PluginMethod m, Semigroup (ResponseResult m)) => SMethod m -> Config -> ClientCapabilities -> MessageParams m -> NonEmpty (ResponseResult m) -> ResponseResult m
-- | Methods which have a PluginMethod instance
data IdeMethod (m :: Method FromClient Request)
IdeMethod :: SMethod m -> IdeMethod (m :: Method FromClient Request)
-- | Combine handlers for the
newtype PluginHandler a (m :: Method FromClient Request)
PluginHandler :: (PluginId -> a -> MessageParams m -> LspM Config (NonEmpty (Either ResponseError (ResponseResult m)))) -> PluginHandler a (m :: Method FromClient Request)
newtype PluginHandlers a
PluginHandlers :: DMap IdeMethod (PluginHandler a) -> PluginHandlers a
type PluginMethodHandler a m = a -> PluginId -> MessageParams m -> LspM Config (Either ResponseError (ResponseResult m))
-- | Make a handler for plugins with no extra data
mkPluginHandler :: PluginMethod m => SClientMethod m -> PluginMethodHandler ideState m -> PluginHandlers ideState
defaultPluginDescriptor :: PluginId -> PluginDescriptor ideState
newtype CommandId
CommandId :: Text -> CommandId
data PluginCommand ideState
PluginCommand :: CommandId -> Text -> CommandFunction ideState a -> PluginCommand ideState
[commandId] :: PluginCommand ideState -> CommandId
[commandDesc] :: PluginCommand ideState -> Text
[commandFunc] :: PluginCommand ideState -> CommandFunction ideState a
type CommandFunction ideState a = ideState -> a -> LspM Config (Either ResponseError Value)
newtype WithSnippets
WithSnippets :: Bool -> WithSnippets
newtype PluginId
PluginId :: Text -> PluginId
configForPlugin :: Config -> PluginId -> PluginConfig
-- | Checks that a given plugin is both enabled and the specific feature is
-- enabled
pluginEnabledConfig :: (PluginConfig -> Bool) -> PluginId -> Config -> Bool
-- | Format the given Text as a whole or only a Range of it. Range
-- must be relative to the text to format. To format the whole document,
-- read the Text from the file and use FormatText as the
-- FormattingType.
data FormattingType
FormatText :: FormattingType
FormatRange :: Range -> FormattingType
type FormattingMethod m = (HasOptions (MessageParams m) FormattingOptions, HasTextDocument (MessageParams m) TextDocumentIdentifier, ResponseResult m ~ List TextEdit)
type FormattingHandler a = a -> FormattingType -> Text -> NormalizedFilePath -> FormattingOptions -> LspM Config (Either ResponseError (List TextEdit))
mkFormattingHandlers :: forall a. FormattingHandler a -> PluginHandlers a
responseError :: Text -> ResponseError
data FallbackCodeActionParams
FallbackCodeActionParams :: Maybe WorkspaceEdit -> Maybe Command -> FallbackCodeActionParams
[fallbackWorkspaceEdit] :: FallbackCodeActionParams -> Maybe WorkspaceEdit
[fallbackCommand] :: FallbackCodeActionParams -> Maybe Command
otSetUri :: SpanInFlight -> Uri -> IO ()
class HasTracing a
traceWithSpan :: HasTracing a => SpanInFlight -> a -> IO ()
pROCESS_ID :: Text
mkLspCommand :: PluginId -> CommandId -> Text -> Maybe [Value] -> Command
mkLspCmdId :: Text -> PluginId -> CommandId -> Text
-- | Get the operating system process id for the running server instance.
-- This should be the same for the lifetime of the instance, and
-- different from that of any other currently running instance.
getPid :: IO Text
getProcessID :: IO Int
installSigUsr1Handler :: IO () -> IO ()
instance GHC.Classes.Ord Ide.Types.CommandId
instance GHC.Classes.Eq Ide.Types.CommandId
instance GHC.Read.Read Ide.Types.CommandId
instance GHC.Show.Show Ide.Types.CommandId
instance GHC.Classes.Ord Ide.Types.PluginId
instance GHC.Classes.Eq Ide.Types.PluginId
instance GHC.Read.Read Ide.Types.PluginId
instance GHC.Show.Show Ide.Types.PluginId
instance Data.Aeson.Types.FromJSON.FromJSON Ide.Types.FallbackCodeActionParams
instance Data.Aeson.Types.ToJSON.ToJSON Ide.Types.FallbackCodeActionParams
instance GHC.Generics.Generic Ide.Types.FallbackCodeActionParams
instance GHC.Base.Semigroup (Ide.Types.PluginHandlers a)
instance GHC.Base.Monoid (Ide.Types.PluginHandlers a)
instance Data.GADT.Internal.GEq Ide.Types.IdeMethod
instance Data.GADT.Internal.GCompare Ide.Types.IdeMethod
instance Ide.Types.PluginMethod 'Language.LSP.Types.Method.TextDocumentCodeAction
instance Ide.Types.PluginMethod 'Language.LSP.Types.Method.TextDocumentCodeLens
instance Ide.Types.PluginMethod 'Language.LSP.Types.Method.TextDocumentRename
instance Ide.Types.PluginMethod 'Language.LSP.Types.Method.TextDocumentHover
instance Ide.Types.PluginMethod 'Language.LSP.Types.Method.TextDocumentDocumentSymbol
instance Ide.Types.PluginMethod 'Language.LSP.Types.Method.TextDocumentCompletion
instance Ide.Types.PluginMethod 'Language.LSP.Types.Method.TextDocumentFormatting
instance Ide.Types.PluginMethod 'Language.LSP.Types.Method.TextDocumentRangeFormatting
instance (Language.LSP.Types.Lens.HasTextDocument a doc, Language.LSP.Types.Lens.HasUri doc Language.LSP.Types.Uri.Uri) => Ide.Types.HasTracing a
instance Ide.Types.HasTracing Data.Aeson.Types.Internal.Value
instance Ide.Types.HasTracing Language.LSP.Types.Command.ExecuteCommandParams
instance Ide.Types.HasTracing Language.LSP.Types.WatchedFiles.DidChangeWatchedFilesParams
instance Ide.Types.HasTracing Language.LSP.Types.WorkspaceFolders.DidChangeWorkspaceFoldersParams
instance Ide.Types.HasTracing Language.LSP.Types.Configuration.DidChangeConfigurationParams
instance Ide.Types.HasTracing Language.LSP.Types.Initialize.InitializeParams
instance Ide.Types.HasTracing (GHC.Maybe.Maybe Language.LSP.Types.Initialize.InitializedParams)
instance Ide.Types.HasTracing Language.LSP.Types.WorkspaceSymbol.WorkspaceSymbolParams
instance Data.String.IsString Ide.Types.PluginId
instance Data.String.IsString Ide.Types.CommandId
module Ide.PluginUtils
data WithDeletions
IncludeDeletions :: WithDeletions
SkipDeletions :: WithDeletions
getProcessID :: IO Int
-- | Extend to the line below and above to replace newline character.
normalize :: Range -> Range
makeDiffTextEdit :: Text -> Text -> List TextEdit
makeDiffTextEditAdditive :: Text -> Text -> List TextEdit
-- | Generate a WorkspaceEdit value from a pair of source Text
diffText :: ClientCapabilities -> (Uri, Text) -> Text -> WithDeletions -> WorkspaceEdit
-- | A pure version of diffText for testing
diffText' :: Bool -> (Uri, Text) -> Text -> WithDeletions -> WorkspaceEdit
pluginDescToIdePlugins :: [PluginDescriptor ideState] -> IdePlugins ideState
responseError :: Text -> ResponseError
-- | Returns the current client configuration. It is not wise to
-- permanently cache the returned value of this function, as clients can
-- at runitime change their configuration.
getClientConfig :: MonadLsp Config m => m (Maybe Config)
-- | Returns the current plugin configuration. It is not wise to
-- permanently cache the returned value of this function, as clients can
-- change their configuration at runtime.
getPluginConfig :: MonadLsp Config m => PluginId -> m (Maybe PluginConfig)
configForPlugin :: Config -> PluginId -> PluginConfig
-- | Parse the configuration to check if this plugin is enabled
pluginEnabled :: PluginMethod m => SMethod m -> PluginId -> Config -> Bool
extractRange :: Range -> Text -> Text
-- | Gets the range that covers the entire text
fullRange :: Text -> Range
mkLspCommand :: PluginId -> CommandId -> Text -> Maybe [Value] -> Command
mkLspCmdId :: Text -> PluginId -> CommandId -> Text
-- | Get the operating system process id for the running server instance.
-- This should be the same for the lifetime of the instance, and
-- different from that of any other currently running instance.
getPid :: IO Text
allLspCmdIds :: Text -> [(PluginId, [PluginCommand ideState])] -> [Text]
allLspCmdIds' :: Text -> IdePlugins ideState -> [Text]
installSigUsr1Handler :: IO () -> IO ()
subRange :: Range -> Range -> Bool
instance GHC.Classes.Eq Ide.PluginUtils.WithDeletions