1+ {-# LANGUAGE CPP #-}
2+ {-# LANGUAGE PolyKinds #-}
3+
4+ #if MIN_VERSION_lsp_types(2,0,0)
5+ {-# LANGUAGE DataKinds #-}
6+ {-# LANGUAGE TypeApplications #-}
7+ #endif
8+
19module Switchboard (Switchboard , new , setupLanguageContextEnv , destroy ) where
210
311import Monad
@@ -9,7 +17,14 @@ import qualified Agda
917import qualified Data.Aeson as JSON
1018import qualified Data.Text.IO as Text
1119import Language.LSP.Server
12- import Language.LSP.Types hiding (TextDocumentSyncClientCapabilities (.. ))
20+ #if MIN_VERSION_lsp(2,0,0)
21+ import Data.Proxy (Proxy (Proxy ))
22+ import Language.LSP.Protocol.Message
23+ import Language.LSP.Protocol.Types
24+ #else
25+ import Language.LSP.Types
26+ #endif
27+ hiding (TextDocumentSyncClientCapabilities (.. ))
1328import Data.IORef
1429import Options (Config )
1530
@@ -62,6 +77,13 @@ keepSendindResponse env ctxEnvIORef = forever $ do
6277 callback <- liftIO $ ResponseController. dispatch (envResponseController env)
6378
6479 let value = JSON. toJSON response
65- sendRequest ( SCustomMethod " agda " ) value $ \ _result -> liftIO $ do
80+ sendRequest agdaCustomMethod value $ \ _result -> liftIO $ do
6681 -- writeChan (envLogChan env) $ "[Response] >>>> " <> pack (show value)
6782 callback ()
83+
84+ agdaCustomMethod =
85+ #if MIN_VERSION_lsp_types(2,0,0)
86+ SMethod_CustomMethod (Proxy @ " agda" )
87+ #else
88+ SCustomMethod " agda"
89+ #endif
0 commit comments