Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ide.Types
Synopsis
- newtype IdePlugins ideState = IdePlugins {
- ipMap :: Map PluginId (PluginDescriptor ideState)
- data PluginDescriptor ideState = PluginDescriptor {
- pluginId :: !PluginId
- pluginRules :: !(Rules ())
- pluginCommands :: ![PluginCommand ideState]
- pluginCodeActionProvider :: !(Maybe (CodeActionProvider ideState))
- pluginCodeLensProvider :: !(Maybe (CodeLensProvider ideState))
- pluginDiagnosticProvider :: !(Maybe DiagnosticProvider)
- pluginHoverProvider :: !(Maybe (HoverProvider ideState))
- pluginSymbolsProvider :: !(Maybe (SymbolsProvider ideState))
- pluginFormattingProvider :: !(Maybe (FormattingProvider ideState IO))
- pluginCompletionProvider :: !(Maybe (CompletionProvider ideState))
- pluginRenameProvider :: !(Maybe (RenameProvider ideState))
- defaultPluginDescriptor :: PluginId -> PluginDescriptor ideState
- data PluginCommand ideState = forall a.FromJSON a => PluginCommand {
- commandId :: CommandId
- commandDesc :: Text
- commandFunc :: CommandFunction ideState a
- newtype PluginId = PluginId Text
- newtype CommandId = CommandId Text
- data DiagnosticProvider = DiagnosticProvider {
- dpTrigger :: Set DiagnosticTrigger
- dpFunc :: DiagnosticProviderFunc
- data DiagnosticProviderFunc
- = DiagnosticProviderSync DiagnosticProviderFuncSync
- | DiagnosticProviderAsync DiagnosticProviderFuncAsync
- type SymbolsProvider ideState = LspFuncs Config -> ideState -> DocumentSymbolParams -> IO (Either ResponseError [DocumentSymbol])
- data FormattingType
- type FormattingProvider ideState m = LspFuncs Config -> ideState -> FormattingType -> Text -> NormalizedFilePath -> FormattingOptions -> m (Either ResponseError (List TextEdit))
- 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
Documentation
newtype IdePlugins ideState Source #
Constructors
IdePlugins | |
Fields
|
data PluginDescriptor ideState Source #
Constructors
PluginDescriptor | |
Fields
|
defaultPluginDescriptor :: PluginId -> PluginDescriptor ideState Source #
data PluginCommand ideState Source #
Constructors
forall a.FromJSON a => PluginCommand | |
Fields
|
Instances
Eq CommandId Source # | |
Ord CommandId Source # | |
Read CommandId Source # | |
Show CommandId Source # | |
IsString CommandId Source # | |
Defined in Ide.Types Methods fromString :: String -> CommandId # |
data DiagnosticProvider Source #
Constructors
DiagnosticProvider | |
Fields
|
data DiagnosticProviderFunc Source #
Constructors
DiagnosticProviderSync DiagnosticProviderFuncSync | |
DiagnosticProviderAsync DiagnosticProviderFuncAsync |
type SymbolsProvider ideState = LspFuncs Config -> ideState -> DocumentSymbolParams -> IO (Either ResponseError [DocumentSymbol]) Source #
data FormattingType Source #
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.
Constructors
FormatText | |
FormatRange Range |
type FormattingProvider ideState m Source #
Arguments
= 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 |
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.
noneProvider :: FormattingProvider ideState IO Source #
type HoverProvider ideState = ideState -> TextDocumentPositionParams -> IO (Either ResponseError (Maybe Hover)) Source #
type CodeActionProvider ideState = LspFuncs Config -> ideState -> PluginId -> TextDocumentIdentifier -> Range -> CodeActionContext -> IO (Either ResponseError (List CAResult)) Source #
type CodeLensProvider ideState = LspFuncs Config -> ideState -> PluginId -> CodeLensParams -> IO (Either ResponseError (List CodeLens)) Source #
type CommandFunction ideState a = LspFuncs Config -> ideState -> a -> IO (Either ResponseError Value, Maybe (ServerMethod, ApplyWorkspaceEditParams)) Source #
type ExecuteCommandProvider ideState = ideState -> ExecuteCommandParams -> IO (Either ResponseError Value, Maybe (ServerMethod, ApplyWorkspaceEditParams)) Source #
type CompletionProvider ideState = LspFuncs Config -> ideState -> CompletionParams -> IO (Either ResponseError CompletionResponseResult) Source #
type RenameProvider ideState = LspFuncs Config -> ideState -> RenameParams -> IO (Either ResponseError WorkspaceEdit) Source #
newtype WithSnippets Source #
Constructors
WithSnippets Bool |