Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data WithDeletions
- getProcessID :: IO Int
- normalize :: Range -> Range
- makeDiffTextEdit :: Text -> Text -> List TextEdit
- makeDiffTextEditAdditive :: Text -> Text -> List TextEdit
- diffText :: ClientCapabilities -> (Uri, Text) -> Text -> WithDeletions -> WorkspaceEdit
- diffText' :: Bool -> (Uri, Text) -> Text -> WithDeletions -> WorkspaceEdit
- pluginDescToIdePlugins :: [PluginDescriptor ideState] -> IdePlugins ideState
- idePluginsToPluginDesc :: IdePlugins ideState -> [PluginDescriptor ideState]
- responseError :: Text -> ResponseError
- getClientConfig :: MonadLsp Config m => m Config
- getPluginConfig :: MonadLsp Config m => PluginId -> m PluginConfig
- configForPlugin :: Config -> PluginId -> PluginConfig
- pluginEnabled :: PluginMethod k m => SMethod m -> MessageParams m -> PluginDescriptor c -> Config -> Bool
- extractRange :: Range -> Text -> Text
- fullRange :: Text -> Range
- mkLspCommand :: PluginId -> CommandId -> Text -> Maybe [Value] -> Command
- mkLspCmdId :: Text -> PluginId -> CommandId -> Text
- getPid :: IO Text
- allLspCmdIds :: Text -> [(PluginId, [PluginCommand ideState])] -> [Text]
- allLspCmdIds' :: Text -> IdePlugins ideState -> [Text]
- installSigUsr1Handler :: IO () -> IO ()
- subRange :: Range -> Range -> Bool
- positionInRange :: Position -> Range -> Bool
- usePropertyLsp :: (HasProperty s k t r, MonadLsp Config m) => KeyNameProxy s -> PluginId -> Properties r -> m (ToHsType t)
- getNormalizedFilePath :: Monad m => Uri -> ExceptT String m NormalizedFilePath
- pluginResponse :: Monad m => ExceptT String m a -> m (Either ResponseError a)
- handleMaybe :: Monad m => e -> Maybe b -> ExceptT e m b
- handleMaybeM :: Monad m => e -> m (Maybe b) -> ExceptT e m b
- throwPluginError :: Monad m => String -> ExceptT String m b
Documentation
data WithDeletions Source #
Instances
Eq WithDeletions Source # | |
Defined in Ide.PluginUtils (==) :: WithDeletions -> WithDeletions -> Bool # (/=) :: WithDeletions -> WithDeletions -> Bool # |
getProcessID :: IO Int Source #
normalize :: Range -> Range Source #
Extend to the line below and above to replace newline character.
diffText :: ClientCapabilities -> (Uri, Text) -> Text -> WithDeletions -> WorkspaceEdit Source #
Generate a WorkspaceEdit
value from a pair of source Text
diffText' :: Bool -> (Uri, Text) -> Text -> WithDeletions -> WorkspaceEdit Source #
A pure version of diffText
for testing
pluginDescToIdePlugins :: [PluginDescriptor ideState] -> IdePlugins ideState Source #
idePluginsToPluginDesc :: IdePlugins ideState -> [PluginDescriptor ideState] Source #
responseError :: Text -> ResponseError Source #
getClientConfig :: MonadLsp Config m => m Config Source #
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.
getPluginConfig :: MonadLsp Config m => PluginId -> m PluginConfig Source #
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.
configForPlugin :: Config -> PluginId -> PluginConfig Source #
:: PluginMethod k m | |
=> SMethod m | Method type. |
-> MessageParams m | Whether a plugin is enabled might depend on the message parameters
eg |
-> PluginDescriptor c | Contains meta information such as PluginId and what file types this plugin is able to handle. |
-> Config | Generic config description, expected to hold |
-> Bool | Is this plugin enabled and allowed to respond to the given request with the given parameters? |
Parse the configuration to check if this plugin is enabled. Perform sanity checks on the message to see whether plugin is enabled for this message in particular. If a plugin is not enabled, its handlers, commands, etc... will not be run for the given message.
Semantically, this method described whether a Plugin is enabled configuration wise and is allowed to respond to the message. This might depend on the URI that is associated to the Message Parameters, but doesn't have to. There are requests with no associated URI that, consequentially, can't inspect the URI.
Common reason why a plugin might not be allowed to respond although it is enabled: * Plugin can not handle requests associated to the specific URI * Since the implementation of cabal plugins HLS knows plugins specific for Haskell and specific for Cabal file descriptions
Strictly speaking, we are conflating two concepts here: * Dynamically enabled (e.g. enabled on a per-message basis) * Statically enabled (e.g. by configuration in the lsp-client) * Strictly speaking, this might also change dynamically
But there is no use to split it up currently into two different methods for now.
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.
allLspCmdIds :: Text -> [(PluginId, [PluginCommand ideState])] -> [Text] Source #
allLspCmdIds' :: Text -> IdePlugins ideState -> [Text] Source #
installSigUsr1Handler :: IO () -> IO () Source #
positionInRange :: Position -> Range -> Bool #
positionInRange
returns true if the given Position
is in the Range
.
usePropertyLsp :: (HasProperty s k t r, MonadLsp Config m) => KeyNameProxy s -> PluginId -> Properties r -> m (ToHsType t) Source #
Returns the value of a property defined by the current plugin.
getNormalizedFilePath :: Monad m => Uri -> ExceptT String m NormalizedFilePath Source #
pluginResponse :: Monad m => ExceptT String m a -> m (Either ResponseError a) Source #