{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# OPTIONS_GHC -Wwarn #-}

{- |
Eval Plugin entry point.
-}
module Ide.Plugin.Eval (
    descriptor,
) where

import Development.IDE (IdeState)
import qualified Ide.Plugin.Eval.CodeLens as CL
import Ide.Types (
    PluginDescriptor (..),
    PluginId,
    defaultPluginDescriptor,
 )

-- |Plugin descriptor
descriptor :: PluginId -> PluginDescriptor IdeState
descriptor :: PluginId -> PluginDescriptor IdeState
descriptor PluginId
plId =
    (PluginId -> PluginDescriptor IdeState
forall ideState. PluginId -> PluginDescriptor ideState
defaultPluginDescriptor PluginId
plId)
        { pluginCodeLensProvider :: Maybe (CodeLensProvider IdeState)
pluginCodeLensProvider = CodeLensProvider IdeState -> Maybe (CodeLensProvider IdeState)
forall a. a -> Maybe a
Just CodeLensProvider IdeState
CL.codeLens
        , pluginCommands :: [PluginCommand IdeState]
pluginCommands = [PluginCommand IdeState
CL.evalCommand]
        }