module Development.IDE.Plugin
  ( Plugin(..)
  ) where

import Data.Default
import Development.Shake
import Development.IDE.LSP.Server


data Plugin c = Plugin
    {Plugin c -> Rules ()
pluginRules :: Rules ()
    ,Plugin c -> PartialHandlers c
pluginHandler :: PartialHandlers c
    }

instance Default (Plugin c) where
    def :: Plugin c
def = Rules () -> PartialHandlers c -> Plugin c
forall c. Rules () -> PartialHandlers c -> Plugin c
Plugin Rules ()
forall a. Monoid a => a
mempty PartialHandlers c
forall a. Default a => a
def

instance Semigroup (Plugin c) where
    Plugin Rules ()
x1 PartialHandlers c
y1 <> :: Plugin c -> Plugin c -> Plugin c
<> Plugin Rules ()
x2 PartialHandlers c
y2 = Rules () -> PartialHandlers c -> Plugin c
forall c. Rules () -> PartialHandlers c -> Plugin c
Plugin (Rules ()
x1Rules () -> Rules () -> Rules ()
forall a. Semigroup a => a -> a -> a
<>Rules ()
x2) (PartialHandlers c
y1PartialHandlers c -> PartialHandlers c -> PartialHandlers c
forall a. Semigroup a => a -> a -> a
<>PartialHandlers c
y2)

instance Monoid (Plugin c) where
    mempty :: Plugin c
mempty = Plugin c
forall a. Default a => a
def