-- 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.5.0.1 -- | Provides an implementation of the ghcide Logger which uses -- System.Log.Logger under the hood. module Ide.Logger hlsLogger :: 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 :: Bool -> Bool -> Int -> Int -> Bool -> Bool -> Bool -> Text -> Config [hlintOn] :: Config -> Bool [diagnosticsOnChange] :: Config -> Bool [maxNumberOfProblems] :: Config -> Int [diagnosticsDebounceDuration] :: Config -> Int [liquidOn] :: Config -> Bool [completionSnippetsOn] :: Config -> Bool [formatOnImportOn] :: Config -> Bool [formattingProvider] :: Config -> Text 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 module Ide.PluginUtils -- | Extend to the line below and above to replace newline character. normalize :: Range -> Range data WithDeletions IncludeDeletions :: WithDeletions SkipDeletions :: WithDeletions -- | Generate a WorkspaceEdit value from a pair of source Text diffText :: ClientCapabilities -> (Uri, Text) -> Text -> WithDeletions -> WorkspaceEdit makeDiffTextEdit :: Text -> Text -> List TextEdit makeDiffTextEditAdditive :: Text -> Text -> List TextEdit diffTextEdit :: Text -> Text -> WithDeletions -> List TextEdit -- | A pure version of diffText for testing diffText' :: Bool -> (Uri, Text) -> Text -> WithDeletions -> WorkspaceEdit clientSupportsDocumentChanges :: ClientCapabilities -> Bool instance GHC.Classes.Eq Ide.PluginUtils.WithDeletions module Ide.Types newtype IdePlugins IdePlugins :: Map PluginId PluginDescriptor -> IdePlugins [ipMap] :: IdePlugins -> Map PluginId PluginDescriptor data PluginDescriptor PluginDescriptor :: !PluginId -> !Rules () -> ![PluginCommand] -> !Maybe CodeActionProvider -> !Maybe CodeLensProvider -> !Maybe DiagnosticProvider -> !Maybe HoverProvider -> !Maybe SymbolsProvider -> !Maybe (FormattingProvider IO) -> !Maybe CompletionProvider -> !Maybe RenameProvider -> PluginDescriptor [pluginId] :: PluginDescriptor -> !PluginId [pluginRules] :: PluginDescriptor -> !Rules () [pluginCommands] :: PluginDescriptor -> ![PluginCommand] [pluginCodeActionProvider] :: PluginDescriptor -> !Maybe CodeActionProvider [pluginCodeLensProvider] :: PluginDescriptor -> !Maybe CodeLensProvider -- | TODO: diagnostics are generally provided via rules, this is probably -- redundant. [pluginDiagnosticProvider] :: PluginDescriptor -> !Maybe DiagnosticProvider [pluginHoverProvider] :: PluginDescriptor -> !Maybe HoverProvider [pluginSymbolsProvider] :: PluginDescriptor -> !Maybe SymbolsProvider [pluginFormattingProvider] :: PluginDescriptor -> !Maybe (FormattingProvider IO) [pluginCompletionProvider] :: PluginDescriptor -> !Maybe CompletionProvider [pluginRenameProvider] :: PluginDescriptor -> !Maybe RenameProvider defaultPluginDescriptor :: PluginId -> PluginDescriptor data PluginCommand PluginCommand :: CommandId -> Text -> CommandFunction a -> PluginCommand [commandId] :: PluginCommand -> CommandId [commandDesc] :: PluginCommand -> Text [commandFunc] :: PluginCommand -> CommandFunction 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 = 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 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" type HoverProvider = IdeState -> TextDocumentPositionParams -> IO (Either ResponseError (Maybe Hover)) type CodeActionProvider = LspFuncs Config -> IdeState -> PluginId -> TextDocumentIdentifier -> Range -> CodeActionContext -> IO (Either ResponseError (List CAResult)) type CodeLensProvider = LspFuncs Config -> IdeState -> PluginId -> CodeLensParams -> IO (Either ResponseError (List CodeLens)) type CommandFunction a = LspFuncs Config -> IdeState -> a -> IO (Either ResponseError Value, Maybe (ServerMethod, ApplyWorkspaceEditParams)) type ExecuteCommandProvider = IdeState -> ExecuteCommandParams -> IO (Either ResponseError Value, Maybe (ServerMethod, ApplyWorkspaceEditParams)) type CompletionProvider = LspFuncs Config -> IdeState -> CompletionParams -> IO (Either ResponseError CompletionResponseResult) type RenameProvider = 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.Plugin.Formatter formatting :: Map PluginId (FormattingProvider IO) -> LspFuncs Config -> IdeState -> DocumentFormattingParams -> IO (Either ResponseError (List TextEdit)) rangeFormatting :: Map PluginId (FormattingProvider IO) -> LspFuncs Config -> IdeState -> DocumentRangeFormattingParams -> IO (Either ResponseError (List TextEdit)) noneProvider :: FormattingProvider IO responseError :: Text -> ResponseError extractRange :: Range -> Text -> Text -- | Gets the range that covers the entire text fullRange :: Text -> Range module Ide.Plugin -- | Map a set of plugins to the underlying ghcide engine. Main point is -- IdePlugins are arranged by kind of operation, Plugin is -- arranged by message category (Notifaction, Request -- etc). asGhcIdePlugin :: IdePlugins -> Plugin Config pluginDescToIdePlugins :: [PluginDescriptor] -> IdePlugins mkLspCommand :: PluginId -> CommandId -> Text -> Maybe [Value] -> IO Command mkLspCmdId :: Text -> PluginId -> CommandId -> Text allLspCmdIds :: Text -> [(PluginId, [PluginCommand])] -> [Text] allLspCmdIds' :: Text -> IdePlugins -> [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 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 client configurarion stored in the IdeState. You can use -- this function to access it from shake Rules getClientConfigAction :: Action Config instance Data.Aeson.Types.FromJSON.FromJSON Ide.Plugin.FallbackCodeActionParams instance Data.Aeson.Types.ToJSON.ToJSON Ide.Plugin.FallbackCodeActionParams instance GHC.Generics.Generic Ide.Plugin.FallbackCodeActionParams module Ide.Plugin.GhcIde descriptor :: PluginId -> PluginDescriptor