Ide.Plugin.Config

hls-plugin-api-2.9.0.0: Haskell Language Server API for plugin communication

Safe Haskell | None
Language | GHC2021

Ide.Plugin.Config

Synopsis

- getConfigFromNotification :: IdePlugins s -> Config -> Value -> Either Text Config
- data Config = Config {
  - checkParents :: CheckParents
  - checkProject :: !Bool
  - formattingProvider :: !Text
  - cabalFormattingProvider :: !Text
  - maxCompletions :: !Int
  - sessionLoading :: !SessionLoadingPreferenceConfig
  - plugins :: !(Map PluginId PluginConfig)
  }
- parseConfig :: IdePlugins s -> Config -> Value -> Parser Config
- data PluginConfig = PluginConfig {
  - plcGlobalOn :: !Bool
  - plcCallHierarchyOn :: !Bool
  - plcCodeActionsOn :: !Bool
  - plcCodeLensOn :: !Bool
  - plcDiagnosticsOn :: !Bool
  - plcHoverOn :: !Bool
  - plcSymbolsOn :: !Bool
  - plcCompletionOn :: !Bool
  - plcRenameOn :: !Bool
  - plcSelectionRangeOn :: !Bool
  - plcFoldingRangeOn :: !Bool
  - plcSemanticTokensOn :: !Bool
  - plcConfig :: !Object
  }
- data CheckParents
  - = NeverCheck
  - | CheckOnSave
  - | AlwaysCheck

# Documentation

getConfigFromNotification :: IdePlugins s -> Config -> Value -> Either Text Config #

Given a DidChangeConfigurationNotification message, this function returns the parsed Config object if possible.

data Config #

We (initially anyway) mirror the hie configuration, so that existing clients can simply switch executable and not have any nasty surprises. There will initially be surprises relating to config options being ignored though.

Constructors

Config |
Fields checkParents :: CheckParents checkProject :: !Bool formattingProvider :: !Text cabalFormattingProvider :: !Text maxCompletions :: !Int sessionLoading :: !SessionLoadingPreferenceConfig plugins :: !(Map PluginId PluginConfig)

#### Instances

Instances details

ToJSON Config # |
Instance details Defined in Ide.Types Methods toJSON :: Config -> Value # toEncoding :: Config -> Encoding # toJSONList :: [Config] -> Value # toEncodingList :: [Config] -> Encoding # omitField :: Config -> Bool #
Default Config # |
Instance details Defined in Ide.Types Methods def :: Config #
Show Config # |
Instance details Defined in Ide.Types Methods showsPrec :: Int -> Config -> ShowS # show :: Config -> String # showList :: [Config] -> ShowS #
Eq Config # |
Instance details Defined in Ide.Types Methods (==) :: Config -> Config -> Bool # (/=) :: Config -> Config -> Bool #

parseConfig :: IdePlugins s -> Config -> Value -> Parser Config #

data 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.

Constructors

PluginConfig |
Fields plcGlobalOn :: !Bool plcCallHierarchyOn :: !Bool plcCodeActionsOn :: !Bool plcCodeLensOn :: !Bool plcDiagnosticsOn :: !Bool plcHoverOn :: !Bool plcSymbolsOn :: !Bool plcCompletionOn :: !Bool plcRenameOn :: !Bool plcSelectionRangeOn :: !Bool plcFoldingRangeOn :: !Bool plcSemanticTokensOn :: !Bool plcConfig :: !Object

#### Instances

Instances details

ToJSON PluginConfig # |
Instance details Defined in Ide.Types Methods toJSON :: PluginConfig -> Value # toEncoding :: PluginConfig -> Encoding # toJSONList :: [PluginConfig] -> Value # toEncodingList :: [PluginConfig] -> Encoding # omitField :: PluginConfig -> Bool #
Default PluginConfig # |
Instance details Defined in Ide.Types Methods def :: PluginConfig #
Show PluginConfig # |
Instance details Defined in Ide.Types Methods showsPrec :: Int -> PluginConfig -> ShowS # show :: PluginConfig -> String # showList :: [PluginConfig] -> ShowS #
Eq PluginConfig # |
Instance details Defined in Ide.Types Methods (==) :: PluginConfig -> PluginConfig -> Bool # (/=) :: PluginConfig -> PluginConfig -> Bool #

data CheckParents #

Constructors

NeverCheck |
CheckOnSave |
AlwaysCheck |

#### Instances

Instances details

FromJSON CheckParents # |
Instance details Defined in Ide.Types Methods parseJSON :: Value -> Parser CheckParents # parseJSONList :: Value -> Parser [CheckParents] # omittedField :: Maybe CheckParents #
ToJSON CheckParents # |
Instance details Defined in Ide.Types Methods toJSON :: CheckParents -> Value # toEncoding :: CheckParents -> Encoding # toJSONList :: [CheckParents] -> Value # toEncodingList :: [CheckParents] -> Encoding # omitField :: CheckParents -> Bool #
Generic CheckParents # |
Instance details Defined in Ide.Types Associated Types
type Rep CheckParents |
Instance details Defined in Ide.Types type Rep CheckParents = D1 ('MetaData "CheckParents" "Ide.Types" "hls-plugin-api-2.9.0.0-HER889dnREQKWJAwDe5OEw" 'False) (C1 ('MetaCons "NeverCheck" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "CheckOnSave" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AlwaysCheck" 'PrefixI 'False) (U1 :: Type -> Type)))
Methods from :: CheckParents -> Rep CheckParents x # to :: Rep CheckParents x -> CheckParents #
Show CheckParents # |
Instance details Defined in Ide.Types Methods showsPrec :: Int -> CheckParents -> ShowS # show :: CheckParents -> String # showList :: [CheckParents] -> ShowS #
Eq CheckParents # |
Instance details Defined in Ide.Types Methods (==) :: CheckParents -> CheckParents -> Bool # (/=) :: CheckParents -> CheckParents -> Bool #
Ord CheckParents # |
Instance details Defined in Ide.Types Methods compare :: CheckParents -> CheckParents -> Ordering # (<) :: CheckParents -> CheckParents -> Bool # (<=) :: CheckParents -> CheckParents -> Bool # (>) :: CheckParents -> CheckParents -> Bool # (>=) :: CheckParents -> CheckParents -> Bool # max :: CheckParents -> CheckParents -> CheckParents # min :: CheckParents -> CheckParents -> CheckParents #
type Rep CheckParents # |
Instance details Defined in Ide.Types type Rep CheckParents = D1 ('MetaData "CheckParents" "Ide.Types" "hls-plugin-api-2.9.0.0-HER889dnREQKWJAwDe5OEw" 'False) (C1 ('MetaCons "NeverCheck" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "CheckOnSave" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AlwaysCheck" 'PrefixI 'False) (U1 :: Type -> Type)))