-- 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 0.6.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 an InitializeRequest message, this function returns the parsed -- Config object if possible. Otherwise, it returns the default -- configuration getInitialConfig :: InitializeRequest -> Either Text Config -- | Given a DidChangeConfigurationNotification message, this function -- returns the parsed Config object if possible. getConfigFromNotification :: DidChangeConfigurationNotification -> 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 -> !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 [plugins] :: Config -> !Map Text PluginConfig -- | 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.FromJSON.FromJSON 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] -> !Maybe (CodeActionProvider ideState) -> !Maybe (CodeLensProvider ideState) -> !Maybe DiagnosticProvider -> !Maybe (HoverProvider ideState) -> !Maybe (SymbolsProvider ideState) -> !Maybe (FormattingProvider ideState IO) -> !Maybe (CompletionProvider ideState) -> !Maybe (RenameProvider ideState) -> PluginDescriptor ideState [pluginId] :: PluginDescriptor ideState -> !PluginId [pluginRules] :: PluginDescriptor ideState -> !Rules () [pluginCommands] :: PluginDescriptor ideState -> ![PluginCommand ideState] [pluginCodeActionProvider] :: PluginDescriptor ideState -> !Maybe (CodeActionProvider ideState) [pluginCodeLensProvider] :: PluginDescriptor ideState -> !Maybe (CodeLensProvider ideState) -- | TODO: diagnostics are generally provided via rules, this is probably -- redundant. [pluginDiagnosticProvider] :: PluginDescriptor ideState -> !Maybe DiagnosticProvider [pluginHoverProvider] :: PluginDescriptor ideState -> !Maybe (HoverProvider ideState) [pluginSymbolsProvider] :: PluginDescriptor ideState -> !Maybe (SymbolsProvider ideState) [pluginFormattingProvider] :: PluginDescriptor ideState -> !Maybe (FormattingProvider ideState IO) [pluginCompletionProvider] :: PluginDescriptor ideState -> !Maybe (CompletionProvider ideState) [pluginRenameProvider] :: PluginDescriptor ideState -> !Maybe (RenameProvider ideState) defaultPluginDescriptor :: PluginId -> PluginDescriptor ideState 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 newtype PluginId PluginId :: Text -> PluginId newtype CommandId CommandId :: Text -> CommandId data DiagnosticProvider DiagnosticProvider :: Set DiagnosticTrigger -> DiagnosticProviderFunc -> DiagnosticProvider [dpTrigger] :: DiagnosticProvider -> Set DiagnosticTrigger [dpFunc] :: DiagnosticProvider -> DiagnosticProviderFunc data DiagnosticProviderFunc DiagnosticProviderSync :: DiagnosticProviderFuncSync -> DiagnosticProviderFunc DiagnosticProviderAsync :: DiagnosticProviderFuncAsync -> DiagnosticProviderFunc type SymbolsProvider ideState = LspFuncs Config -> ideState -> DocumentSymbolParams -> IO (Either ResponseError [DocumentSymbol]) -- | 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 -- | To format a whole document, the FormatText -- FormattingType can be used. It is required to pass in the -- whole Document Text for that to happen, an empty text and file uri, -- does not suffice. type FormattingProvider ideState m = LspFuncs Config -> ideState -> FormattingType " How much to format " -> Text " Text to format " -> NormalizedFilePath " location of the file being formatted " -> FormattingOptions " Options for the formatter " -> m (Either ResponseError (List TextEdit)) " Result of the formatting " noneProvider :: FormattingProvider ideState IO type HoverProvider ideState = ideState -> TextDocumentPositionParams -> IO (Either ResponseError (Maybe Hover)) type CodeActionProvider ideState = LspFuncs Config -> ideState -> PluginId -> TextDocumentIdentifier -> Range -> CodeActionContext -> IO (Either ResponseError (List CAResult)) type CodeLensProvider ideState = LspFuncs Config -> ideState -> PluginId -> CodeLensParams -> IO (Either ResponseError (List CodeLens)) type CommandFunction ideState a = LspFuncs Config -> ideState -> a -> IO (Either ResponseError Value, Maybe (ServerMethod, ApplyWorkspaceEditParams)) type ExecuteCommandProvider ideState = ideState -> ExecuteCommandParams -> IO (Either ResponseError Value, Maybe (ServerMethod, ApplyWorkspaceEditParams)) type CompletionProvider ideState = LspFuncs Config -> ideState -> CompletionParams -> IO (Either ResponseError CompletionResponseResult) type RenameProvider ideState = LspFuncs Config -> ideState -> RenameParams -> IO (Either ResponseError WorkspaceEdit) newtype WithSnippets WithSnippets :: Bool -> WithSnippets 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.Eq Ide.Types.DiagnosticTrigger instance GHC.Classes.Ord Ide.Types.DiagnosticTrigger instance GHC.Show.Show Ide.Types.DiagnosticTrigger 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.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. -- -- If no custom configuration has been set by the client, this function -- returns our own defaults. getClientConfig :: LspFuncs Config -> IO 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. -- -- If no custom configuration has been set by the client, this function -- returns our own defaults. getPluginConfig :: LspFuncs Config -> PluginId -> IO PluginConfig configForPlugin :: Config -> PluginId -> PluginConfig -- | Checks that a given plugin is both enabled and the specific feature is -- enabled pluginEnabled :: PluginConfig -> (PluginConfig -> Bool) -> Bool extractRange :: Range -> Text -> Text -- | Gets the range that covers the entire text fullRange :: Text -> Range mkLspCommand :: PluginId -> CommandId -> Text -> Maybe [Value] -> IO Command mkLspCmdId :: Text -> PluginId -> CommandId -> Text allLspCmdIds :: Text -> [(PluginId, [PluginCommand ideState])] -> [Text] allLspCmdIds' :: Text -> IdePlugins ideState -> [Text] installSigUsr1Handler :: IO () -> IO () instance GHC.Classes.Eq Ide.PluginUtils.WithDeletions