packages feed

haskell-lsp-types 0.9.0.0 → 0.10.0.0

raw patch · 11 files changed

+535/−202 lines, 11 filesnew-uploaderPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

- Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasActions Language.Haskell.LSP.Types.DataTypesJSON.ShowMessageRequestParams (GHC.Maybe.Maybe [Language.Haskell.LSP.Types.DataTypesJSON.MessageActionItem])
- Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasMessage Language.Haskell.LSP.Types.DataTypesJSON.LogMessageParams Data.Text.Internal.Text
- Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasMessage Language.Haskell.LSP.Types.DataTypesJSON.ShowMessageParams Data.Text.Internal.Text
- Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasMessage Language.Haskell.LSP.Types.DataTypesJSON.ShowMessageRequestParams Data.Text.Internal.Text
- Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasTitle Language.Haskell.LSP.Types.DataTypesJSON.MessageActionItem Data.Text.Internal.Text
- Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasXtype Language.Haskell.LSP.Types.DataTypesJSON.LogMessageParams Language.Haskell.LSP.Types.DataTypesJSON.MessageType
- Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasXtype Language.Haskell.LSP.Types.DataTypesJSON.ShowMessageParams Language.Haskell.LSP.Types.DataTypesJSON.MessageType
- Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasXtype Language.Haskell.LSP.Types.DataTypesJSON.ShowMessageRequestParams Language.Haskell.LSP.Types.DataTypesJSON.MessageType
+ Language.Haskell.LSP.Types: ProgressCancelParams :: Text -> ProgressCancelParams
+ Language.Haskell.LSP.Types: ProgressDoneParams :: Text -> ProgressDoneParams
+ Language.Haskell.LSP.Types: ProgressReportParams :: Text -> Maybe Text -> Maybe Double -> ProgressReportParams
+ Language.Haskell.LSP.Types: ProgressStartParams :: Text -> Text -> Maybe Bool -> Maybe Text -> Maybe Double -> ProgressStartParams
+ Language.Haskell.LSP.Types: WindowProgressCancel :: ServerMethod
+ Language.Haskell.LSP.Types: WindowProgressDone :: ServerMethod
+ Language.Haskell.LSP.Types: WindowProgressReport :: ServerMethod
+ Language.Haskell.LSP.Types: WindowProgressStart :: ServerMethod
+ Language.Haskell.LSP.Types: [$sel:_cancellable:ProgressStartParams] :: ProgressStartParams -> Maybe Bool
+ Language.Haskell.LSP.Types: [$sel:_id:ProgressCancelParams] :: ProgressCancelParams -> Text
+ Language.Haskell.LSP.Types: [$sel:_id:ProgressDoneParams] :: ProgressDoneParams -> Text
+ Language.Haskell.LSP.Types: [$sel:_id:ProgressReportParams] :: ProgressReportParams -> Text
+ Language.Haskell.LSP.Types: [$sel:_id:ProgressStartParams] :: ProgressStartParams -> Text
+ Language.Haskell.LSP.Types: [$sel:_message:ProgressReportParams] :: ProgressReportParams -> Maybe Text
+ Language.Haskell.LSP.Types: [$sel:_message:ProgressStartParams] :: ProgressStartParams -> Maybe Text
+ Language.Haskell.LSP.Types: [$sel:_percentage:ProgressReportParams] :: ProgressReportParams -> Maybe Double
+ Language.Haskell.LSP.Types: [$sel:_percentage:ProgressStartParams] :: ProgressStartParams -> Maybe Double
+ Language.Haskell.LSP.Types: [$sel:_title:ProgressStartParams] :: ProgressStartParams -> Text
+ Language.Haskell.LSP.Types: data ProgressCancelParams
+ Language.Haskell.LSP.Types: data ProgressDoneParams
+ Language.Haskell.LSP.Types: data ProgressReportParams
+ Language.Haskell.LSP.Types: data ProgressStartParams
+ Language.Haskell.LSP.Types: type ProgressCancelNotification = NotificationMessage ServerMethod ProgressCancelParams
+ Language.Haskell.LSP.Types: type ProgressDoneNotification = NotificationMessage ServerMethod ProgressDoneParams
+ Language.Haskell.LSP.Types: type ProgressReportNotification = NotificationMessage ServerMethod ProgressReportParams
+ Language.Haskell.LSP.Types: type ProgressStartNotification = NotificationMessage ServerMethod ProgressStartParams
+ Language.Haskell.LSP.Types.Capabilities: WindowClientCapabilities :: Maybe Bool -> WindowClientCapabilities
+ Language.Haskell.LSP.Types.Capabilities: [$sel:_progress:WindowClientCapabilities] :: WindowClientCapabilities -> Maybe Bool
+ Language.Haskell.LSP.Types.Capabilities: [$sel:_window:ClientCapabilities] :: ClientCapabilities -> Maybe WindowClientCapabilities
+ Language.Haskell.LSP.Types.Capabilities: data WindowClientCapabilities
+ Language.Haskell.LSP.Types.Lens: cancellable :: HasCancellable s a => Lens' s a
+ Language.Haskell.LSP.Types.Lens: class HasCancellable s a | s -> a
+ Language.Haskell.LSP.Types.Lens: class HasPercentage s a | s -> a
+ Language.Haskell.LSP.Types.Lens: class HasWindow s a | s -> a
+ Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasActions Language.Haskell.LSP.Types.Window.ShowMessageRequestParams (GHC.Maybe.Maybe [Language.Haskell.LSP.Types.Window.MessageActionItem])
+ Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasCancellable Language.Haskell.LSP.Types.Window.ProgressStartParams (GHC.Maybe.Maybe GHC.Types.Bool)
+ Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasId Language.Haskell.LSP.Types.Window.ProgressCancelParams Data.Text.Internal.Text
+ Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasId Language.Haskell.LSP.Types.Window.ProgressDoneParams Data.Text.Internal.Text
+ Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasId Language.Haskell.LSP.Types.Window.ProgressReportParams Data.Text.Internal.Text
+ Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasId Language.Haskell.LSP.Types.Window.ProgressStartParams Data.Text.Internal.Text
+ Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasMessage Language.Haskell.LSP.Types.Window.LogMessageParams Data.Text.Internal.Text
+ Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasMessage Language.Haskell.LSP.Types.Window.ProgressReportParams (GHC.Maybe.Maybe Data.Text.Internal.Text)
+ Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasMessage Language.Haskell.LSP.Types.Window.ProgressStartParams (GHC.Maybe.Maybe Data.Text.Internal.Text)
+ Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasMessage Language.Haskell.LSP.Types.Window.ShowMessageParams Data.Text.Internal.Text
+ Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasMessage Language.Haskell.LSP.Types.Window.ShowMessageRequestParams Data.Text.Internal.Text
+ Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasPercentage Language.Haskell.LSP.Types.Window.ProgressReportParams (GHC.Maybe.Maybe GHC.Types.Double)
+ Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasPercentage Language.Haskell.LSP.Types.Window.ProgressStartParams (GHC.Maybe.Maybe GHC.Types.Double)
+ Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasTitle Language.Haskell.LSP.Types.Window.MessageActionItem Data.Text.Internal.Text
+ Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasTitle Language.Haskell.LSP.Types.Window.ProgressStartParams Data.Text.Internal.Text
+ Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasWindow Language.Haskell.LSP.Types.ClientCapabilities.ClientCapabilities (GHC.Maybe.Maybe Language.Haskell.LSP.Types.ClientCapabilities.WindowClientCapabilities)
+ Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasXtype Language.Haskell.LSP.Types.Window.LogMessageParams Language.Haskell.LSP.Types.Window.MessageType
+ Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasXtype Language.Haskell.LSP.Types.Window.ShowMessageParams Language.Haskell.LSP.Types.Window.MessageType
+ Language.Haskell.LSP.Types.Lens: instance Language.Haskell.LSP.Types.Lens.HasXtype Language.Haskell.LSP.Types.Window.ShowMessageRequestParams Language.Haskell.LSP.Types.Window.MessageType
+ Language.Haskell.LSP.Types.Lens: percentage :: HasPercentage s a => Lens' s a
+ Language.Haskell.LSP.Types.Lens: window :: HasWindow s a => Lens' s a
+ Language.Haskell.LSP.Types.MessageFuncs: fmServerProgressCancelNotification :: ProgressCancelParams -> ProgressCancelNotification
+ Language.Haskell.LSP.Types.MessageFuncs: fmServerProgressDoneNotification :: ProgressDoneParams -> ProgressDoneNotification
+ Language.Haskell.LSP.Types.MessageFuncs: fmServerProgressReportNotification :: ProgressReportParams -> ProgressReportNotification
+ Language.Haskell.LSP.Types.MessageFuncs: fmServerProgressStartNotification :: ProgressStartParams -> ProgressStartNotification
- Language.Haskell.LSP.Types.Capabilities: ClientCapabilities :: Maybe WorkspaceClientCapabilities -> Maybe TextDocumentClientCapabilities -> Maybe Object -> ClientCapabilities
+ Language.Haskell.LSP.Types.Capabilities: ClientCapabilities :: Maybe WorkspaceClientCapabilities -> Maybe TextDocumentClientCapabilities -> Maybe WindowClientCapabilities -> Maybe Object -> ClientCapabilities

Files

ChangeLog.md view
@@ -1,5 +1,9 @@ # Revision history for haskell-lsp-types +## 0.10.0.0 -- 2019-04-22++* Add types for `window/progress` notifications.+ ## 0.8.3.0  * Add `MarkupContent` to `HoverResponse`, and (some) json roundtrip tests.
haskell-lsp-types.cabal view
@@ -1,5 +1,5 @@ name:                haskell-lsp-types-version:             0.9.0.0+version:             0.10.0.0 synopsis:            Haskell library for the Microsoft Language Server Protocol, data types  description:         An implementation of the types to allow language implementors to@@ -39,6 +39,7 @@                      , Language.Haskell.LSP.Types.Symbol                      , Language.Haskell.LSP.Types.TextDocument                      , Language.Haskell.LSP.Types.Uri+                     , Language.Haskell.LSP.Types.Window                      , Language.Haskell.LSP.Types.WorkspaceEdit                      , Language.Haskell.LSP.Types.WorkspaceFolders  -- other-extensions:
src/Language/Haskell/LSP/Types.hs view
@@ -14,6 +14,7 @@   , module Language.Haskell.LSP.Types.Symbol   , module Language.Haskell.LSP.Types.TextDocument   , module Language.Haskell.LSP.Types.Uri+  , module Language.Haskell.LSP.Types.Window   , module Language.Haskell.LSP.Types.WorkspaceEdit   , module Language.Haskell.LSP.Types.WorkspaceFolders   )@@ -34,5 +35,6 @@ import           Language.Haskell.LSP.Types.Symbol import           Language.Haskell.LSP.Types.TextDocument import           Language.Haskell.LSP.Types.Uri+import           Language.Haskell.LSP.Types.Window import           Language.Haskell.LSP.Types.WorkspaceEdit import           Language.Haskell.LSP.Types.WorkspaceFolders
src/Language/Haskell/LSP/Types/Capabilities.hs view
@@ -28,7 +28,7 @@ -- * 3.4 extended completion item and symbol item kinds -- * 3.0 dynamic registration capsForVersion :: LSPVersion -> ClientCapabilities-capsForVersion (LSPVersion maj min) = ClientCapabilities (Just w) (Just td) Nothing+capsForVersion (LSPVersion maj min) = ClientCapabilities (Just w) (Just td) Nothing Nothing   where     w = WorkspaceClientCapabilities           (Just True)
src/Language/Haskell/LSP/Types/ClientCapabilities.hs view
@@ -991,7 +991,9 @@       -- | Capabilities specific to `textDocument/publishDiagnostics`     , _publishDiagnostics :: Maybe PublishDiagnosticsClientCapabilities -      -- | Capabilities specific to `textDocument/foldingRange` requests. Since LSP 3.10, @since 0.7.0.0+      -- | Capabilities specific to `textDocument/foldingRange` requests. Since LSP 3.10.+      --+      -- @since 0.7.0.0     , _foldingRange :: Maybe FoldingRangeClientCapabilities     } deriving (Show, Read, Eq) @@ -1003,6 +1005,20 @@                                        def def def def  -- ---------------------------------------------------------------------++-- | Window specific client capabilities.+data WindowClientCapabilities = +  WindowClientCapabilities+    { -- | Whether client supports handling progress notifications.+      _progress :: Maybe Bool+    } deriving (Show, Read, Eq)++$(deriveJSON lspOptions ''WindowClientCapabilities)++instance Default WindowClientCapabilities where+  def = WindowClientCapabilities def++-- --------------------------------------------------------------------- {- New in 3.0 @@ -1042,6 +1058,11 @@          * Experimental client capabilities.          */         experimental?: any;++        /**+         * Window specific client capabilities.+	       */+	      window?: WindowClientCapabilities; } -} @@ -1049,10 +1070,14 @@   ClientCapabilities     { _workspace    :: Maybe WorkspaceClientCapabilities     , _textDocument :: Maybe TextDocumentClientCapabilities+    -- | Capabilities specific to `window/progress` requests. Experimental.+    --+    -- @since 0.10.0.0+    , _window :: Maybe WindowClientCapabilities     , _experimental :: Maybe A.Object     } deriving (Show, Read, Eq)  $(deriveJSON lspOptions ''ClientCapabilities)  instance Default ClientCapabilities where-  def = ClientCapabilities def def def+  def = ClientCapabilities def def def def
src/Language/Haskell/LSP/Types/DataTypesJSON.hs view
@@ -119,7 +119,9 @@   -- This property is only available if the client supports workspace folders.   -- It can be `null` if the client supports workspace folders but none are   -- configured.-  -- Since LSP 3.6, @since 0.7.0.0+  -- Since LSP 3.6+  --+  -- @since 0.7.0.0   , _workspaceFolders      :: Maybe (List WorkspaceFolder)   } deriving (Show, Read, Eq) @@ -618,7 +620,9 @@  data WorkspaceOptions =   WorkspaceOptions-    { -- |The server supports workspace folder. Since LSP 3.6, @since 0.7.0.0+    { -- |The server supports workspace folder. Since LSP 3.6+      --+      -- @since 0.7.0.0       _workspaceFolders :: Maybe WorkspaceFolderOptions     }   deriving (Show, Read, Eq)@@ -640,10 +644,14 @@     , _signatureHelpProvider            :: Maybe SignatureHelpOptions       -- | The server provides goto definition support.     , _definitionProvider               :: Maybe Bool-      -- | The server provides Goto Type Definition support. Since LSP 3.6, @since 0.7.0.0+      -- | The server provides Goto Type Definition support. Since LSP 3.6+      --+      -- @since 0.7.0.0     , _typeDefinitionProvider           :: Maybe GotoOptions       -- | The server provides Goto Implementation support.-      -- Since LSP 3.6, @since 0.7.0.0+      -- Since LSP 3.6+      --+      -- @since 0.7.0.0     , _implementationProvider           :: Maybe GotoOptions       -- | The server provides find references support.     , _referencesProvider               :: Maybe Bool@@ -667,9 +675,13 @@     , _renameProvider                   :: Maybe Bool       -- | The server provides document link support.     , _documentLinkProvider             :: Maybe DocumentLinkOptions-      -- | The server provides color provider support. Since LSP 3.6, @since 0.7.0.0+      -- | The server provides color provider support. Since LSP 3.6+      --+      -- @since 0.7.0.0     , _colorProvider                    :: Maybe ColorOptions-      -- | The server provides folding provider support. Since LSP 3.10, @since 0.7.0.0+      -- | The server provides folding provider support. Since LSP 3.10+      --+      -- @since 0.7.0.0     , _foldingRangeProvider             :: Maybe FoldingRangeOptions       -- | The server provides execute command support.     , _executeCommandProvider           :: Maybe ExecuteCommandOptions@@ -810,193 +822,6 @@ deriveJSON defaultOptions ''ExitParams  type ExitNotification = NotificationMessage ClientMethod (Maybe ExitParams)---- ----------------------------------------------------------------------{--ShowMessage Notification--https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#showmessage-notification--The show message notification is sent from a server to a client to ask the-client to display a particular message in the user interface.--Notification:--    method: 'window/showMessage'-    params: ShowMessageParams defined as follows:--interface ShowMessageParams {-    /**-     * The message type. See {@link MessageType}.-     */-    type: number;--    /**-     * The actual message.-     */-    message: string;-}--Where the type is defined as follows:--enum MessageType {-    /**-     * An error message.-     */-    Error = 1,-    /**-     * A warning message.-     */-    Warning = 2,-    /**-     * An information message.-     */-    Info = 3,-    /**-     * A log message.-     */-    Log = 4-}--}-data MessageType = MtError   -- ^ Error = 1,-                 | MtWarning -- ^ Warning = 2,-                 | MtInfo    -- ^ Info = 3,-                 | MtLog     -- ^ Log = 4-        deriving (Eq,Ord,Show,Read,Enum)--instance A.ToJSON MessageType where-  toJSON MtError   = A.Number 1-  toJSON MtWarning = A.Number 2-  toJSON MtInfo    = A.Number 3-  toJSON MtLog     = A.Number 4--instance A.FromJSON MessageType where-  parseJSON (A.Number 1) = pure MtError-  parseJSON (A.Number 2) = pure MtWarning-  parseJSON (A.Number 3) = pure MtInfo-  parseJSON (A.Number 4) = pure MtLog-  parseJSON _            = mempty---- ------------------------------------------data ShowMessageParams =-  ShowMessageParams {-    _xtype   :: MessageType-  , _message :: Text-  } deriving (Show, Read, Eq)--deriveJSON lspOptions{ fieldLabelModifier = customModifier } ''ShowMessageParams--type ShowMessageNotification = NotificationMessage ServerMethod ShowMessageParams---- ----------------------------------------------------------------------{--ShowMessage Request--https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#showmessage-request--    New: The show message request is sent from a server to a client to ask the-    client to display a particular message in the user interface. In addition to-    the show message notification the request allows to pass actions and to wait-    for an answer from the client.--Request:--    method: 'window/showMessageRequest'-    params: ShowMessageRequestParams defined as follows:--Response:--    result: the selected MessageActionItem-    error: code and message set in case an exception happens during showing a message.--interface ShowMessageRequestParams {-    /**-     * The message type. See {@link MessageType}-     */-    type: number;--    /**-     * The actual message-     */-    message: string;--    /**-     * The message action items to present.-     */-    actions?: MessageActionItem[];-}--Where the MessageActionItem is defined as follows:--interface MessageActionItem {-    /**-     * A short title like 'Retry', 'Open Log' etc.-     */-    title: string;-}--}--data MessageActionItem =-  MessageActionItem-    { _title :: Text-    } deriving (Show,Read,Eq)--deriveJSON lspOptions ''MessageActionItem---data ShowMessageRequestParams =-  ShowMessageRequestParams-    { _xtype   :: MessageType-    , _message :: Text-    , _actions :: Maybe [MessageActionItem]-    } deriving (Show,Read,Eq)--deriveJSON lspOptions{ fieldLabelModifier = customModifier } ''ShowMessageRequestParams--type ShowMessageRequest = RequestMessage ServerMethod ShowMessageRequestParams Text-type ShowMessageResponse = ResponseMessage Text---- ----------------------------------------------------------------------{--LogMessage Notification--https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#logmessage-notification--The log message notification is sent from the server to the client to ask the-client to log a particular message.--Notification:--    method: 'window/logMessage'-    params: LogMessageParams defined as follows:--interface LogMessageParams {-    /**-     * The message type. See {@link MessageType}-     */-    type: number;--    /**-     * The actual message-     */-    message: string;-}--Where type is defined as above.--}--data LogMessageParams =-  LogMessageParams {-    _xtype   :: MessageType-  , _message :: Text-  } deriving (Show, Read, Eq)--deriveJSON lspOptions{ fieldLabelModifier = customModifier } ''LogMessageParams---type LogMessageNotification = NotificationMessage ServerMethod LogMessageParams  -- --------------------------------------------------------------------- {-
src/Language/Haskell/LSP/Types/Lens.hs view
@@ -18,6 +18,7 @@ import           Language.Haskell.LSP.Types.Location import           Language.Haskell.LSP.Types.Symbol import           Language.Haskell.LSP.Types.TextDocument+import           Language.Haskell.LSP.Types.Window import           Language.Haskell.LSP.Types.WorkspaceEdit import           Language.Haskell.LSP.Types.WorkspaceFolders import           Control.Lens.TH@@ -74,10 +75,6 @@ makeFieldsNoPrefix ''WorkspaceOptions makeFieldsNoPrefix ''InitializeResponseCapabilitiesInner makeFieldsNoPrefix ''InitializeResponseCapabilities-makeFieldsNoPrefix ''ShowMessageParams-makeFieldsNoPrefix ''MessageActionItem-makeFieldsNoPrefix ''ShowMessageRequestParams-makeFieldsNoPrefix ''LogMessageParams makeFieldsNoPrefix ''Registration makeFieldsNoPrefix ''RegistrationParams makeFieldsNoPrefix ''TextDocumentRegistrationOptions@@ -190,3 +187,13 @@ -- Folding Range makeFieldsNoPrefix ''FoldingRange makeFieldsNoPrefix ''FoldingRangeParams++-- Window+makeFieldsNoPrefix ''ShowMessageParams+makeFieldsNoPrefix ''MessageActionItem+makeFieldsNoPrefix ''ShowMessageRequestParams+makeFieldsNoPrefix ''LogMessageParams+makeFieldsNoPrefix ''ProgressStartParams+makeFieldsNoPrefix ''ProgressReportParams+makeFieldsNoPrefix ''ProgressDoneParams+makeFieldsNoPrefix ''ProgressCancelParams
src/Language/Haskell/LSP/Types/MarkupContent.hs view
@@ -12,7 +12,7 @@  import           Data.Aeson import           Data.Aeson.TH-import           Data.Semigroup+import           Data.Monoid                                    ((<>)) import           Data.Text                                      (Text) import           Language.Haskell.LSP.Types.Constants 
src/Language/Haskell/LSP/Types/Message.hs view
@@ -214,6 +214,10 @@     WindowShowMessage   | WindowShowMessageRequest   | WindowLogMessage+  | WindowProgressStart+  | WindowProgressReport+  | WindowProgressDone+  | WindowProgressCancel   | TelemetryEvent   -- Client   | ClientRegisterCapability@@ -233,6 +237,10 @@   parseJSON (A.String "window/showMessage")              = return WindowShowMessage   parseJSON (A.String "window/showMessageRequest")       = return WindowShowMessageRequest   parseJSON (A.String "window/logMessage")               = return WindowLogMessage+  parseJSON (A.String "window/progress/start")           = return WindowProgressStart+  parseJSON (A.String "window/progress/report")          = return WindowProgressReport+  parseJSON (A.String "window/progress/done")            = return WindowProgressDone+  parseJSON (A.String "window/progress/cancel")          = return WindowProgressCancel   parseJSON (A.String "telemetry/event")                 = return TelemetryEvent   -- Client   parseJSON (A.String "client/registerCapability")       = return ClientRegisterCapability@@ -252,6 +260,10 @@   toJSON WindowShowMessage        = A.String "window/showMessage"   toJSON WindowShowMessageRequest = A.String "window/showMessageRequest"   toJSON WindowLogMessage         = A.String "window/logMessage"+  toJSON WindowProgressStart      = A.String "window/progress/start"+  toJSON WindowProgressReport     = A.String "window/progress/report"+  toJSON WindowProgressDone       = A.String "window/progress/done"+  toJSON WindowProgressCancel     = A.String "window/progress/cancel"   toJSON TelemetryEvent           = A.String "telemetry/event"   -- Client   toJSON ClientRegisterCapability   = A.String "client/registerCapability"
src/Language/Haskell/LSP/Types/MessageFuncs.hs view
@@ -17,6 +17,10 @@   , fmServerShowMessageNotification   , fmServerShowMessageRequest   , fmServerLogMessageNotification+  , fmServerProgressStartNotification+  , fmServerProgressReportNotification+  , fmServerProgressDoneNotification+  , fmServerProgressCancelNotification   , fmServerTelemetryNotification    -- * Client@@ -127,6 +131,30 @@ fmServerLogMessageNotification :: J.MessageType -> Text -> J.LogMessageNotification fmServerLogMessageNotification mt msg   = J.NotificationMessage "2.0" J.WindowLogMessage (J.LogMessageParams mt msg)++-- ----------------------------------------------------------------------++fmServerProgressStartNotification :: J.ProgressStartParams -> J.ProgressStartNotification+fmServerProgressStartNotification params+  = J.NotificationMessage "2.0" J.WindowProgressStart params++-- ----------------------------------------------------------------------++fmServerProgressReportNotification :: J.ProgressReportParams -> J.ProgressReportNotification+fmServerProgressReportNotification params+  = J.NotificationMessage "2.0" J.WindowProgressReport params++-- ----------------------------------------------------------------------++fmServerProgressDoneNotification :: J.ProgressDoneParams -> J.ProgressDoneNotification+fmServerProgressDoneNotification params+  = J.NotificationMessage "2.0" J.WindowProgressDone params++-- ----------------------------------------------------------------------++fmServerProgressCancelNotification :: J.ProgressCancelParams -> J.ProgressCancelNotification+fmServerProgressCancelNotification params+  = J.NotificationMessage "2.0" J.WindowProgressCancel params  -- ---------------------------------------------------------------------- -- * :arrow_left: [telemetry/event](#telemetry_event)
+ src/Language/Haskell/LSP/Types/Window.hs view
@@ -0,0 +1,429 @@+{-# LANGUAGE DuplicateRecordFields      #-}+{-# LANGUAGE TemplateHaskell            #-}+module Language.Haskell.LSP.Types.Window where++import qualified Data.Aeson                                 as A+import           Data.Aeson.TH+import           Data.Text                                  (Text)+import           Language.Haskell.LSP.Types.Constants+import           Language.Haskell.LSP.Types.Message++-- ---------------------------------------------------------------------+{-+ShowMessage Notification++https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#showmessage-notification++The show message notification is sent from a server to a client to ask the+client to display a particular message in the user interface.++Notification:++    method: 'window/showMessage'+    params: ShowMessageParams defined as follows:++interface ShowMessageParams {+    /**+     * The message type. See {@link MessageType}.+     */+    type: number;++    /**+     * The actual message.+     */+    message: string;+}++Where the type is defined as follows:++enum MessageType {+    /**+     * An error message.+     */+    Error = 1,+    /**+     * A warning message.+     */+    Warning = 2,+    /**+     * An information message.+     */+    Info = 3,+    /**+     * A log message.+     */+    Log = 4+}+-}+data MessageType = MtError   -- ^ Error = 1,+                 | MtWarning -- ^ Warning = 2,+                 | MtInfo    -- ^ Info = 3,+                 | MtLog     -- ^ Log = 4+        deriving (Eq,Ord,Show,Read,Enum)++instance A.ToJSON MessageType where+  toJSON MtError   = A.Number 1+  toJSON MtWarning = A.Number 2+  toJSON MtInfo    = A.Number 3+  toJSON MtLog     = A.Number 4++instance A.FromJSON MessageType where+  parseJSON (A.Number 1) = pure MtError+  parseJSON (A.Number 2) = pure MtWarning+  parseJSON (A.Number 3) = pure MtInfo+  parseJSON (A.Number 4) = pure MtLog+  parseJSON _            = mempty++-- ---------------------------------------+++data ShowMessageParams =+  ShowMessageParams {+    _xtype   :: MessageType+  , _message :: Text+  } deriving (Show, Read, Eq)++deriveJSON lspOptions{ fieldLabelModifier = customModifier } ''ShowMessageParams++type ShowMessageNotification = NotificationMessage ServerMethod ShowMessageParams++-- ---------------------------------------------------------------------+{-+ShowMessage Request++https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#showmessage-request++    New: The show message request is sent from a server to a client to ask the+    client to display a particular message in the user interface. In addition to+    the show message notification the request allows to pass actions and to wait+    for an answer from the client.++Request:++    method: 'window/showMessageRequest'+    params: ShowMessageRequestParams defined as follows:++Response:++    result: the selected MessageActionItem+    error: code and message set in case an exception happens during showing a message.++interface ShowMessageRequestParams {+    /**+     * The message type. See {@link MessageType}+     */+    type: number;++    /**+     * The actual message+     */+    message: string;++    /**+     * The message action items to present.+     */+    actions?: MessageActionItem[];+}++Where the MessageActionItem is defined as follows:++interface MessageActionItem {+    /**+     * A short title like 'Retry', 'Open Log' etc.+     */+    title: string;+}+-}++data MessageActionItem =+  MessageActionItem+    { _title :: Text+    } deriving (Show,Read,Eq)++deriveJSON lspOptions ''MessageActionItem+++data ShowMessageRequestParams =+  ShowMessageRequestParams+    { _xtype   :: MessageType+    , _message :: Text+    , _actions :: Maybe [MessageActionItem]+    } deriving (Show,Read,Eq)++deriveJSON lspOptions{ fieldLabelModifier = customModifier } ''ShowMessageRequestParams++type ShowMessageRequest = RequestMessage ServerMethod ShowMessageRequestParams Text+type ShowMessageResponse = ResponseMessage Text++-- ---------------------------------------------------------------------+{-+LogMessage Notification++https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#logmessage-notification++The log message notification is sent from the server to the client to ask the+client to log a particular message.++Notification:++    method: 'window/logMessage'+    params: LogMessageParams defined as follows:++interface LogMessageParams {+    /**+     * The message type. See {@link MessageType}+     */+    type: number;++    /**+     * The actual message+     */+    message: string;+}++Where type is defined as above.+-}++data LogMessageParams =+  LogMessageParams {+    _xtype   :: MessageType+  , _message :: Text+  } deriving (Show, Read, Eq)++deriveJSON lspOptions{ fieldLabelModifier = customModifier } ''LogMessageParams+++type LogMessageNotification = NotificationMessage ServerMethod LogMessageParams++-- ---------------------------------------------------------------------+{-+Progress Start Notification++The window/progress/start notification is sent from the server to the client to ask the client to start progress.++Notification:++method: 'window/progress/start'+params: ProgressStartParams defined as follows:+export interface ProgressStartParams {++  /**+   * A unique identifier to associate multiple progress notifications with+   * the same progress.+   */+  id: string;++  /**+   * Mandatory title of the progress operation. Used to briefly inform about+   * the kind of operation being performed.+   *+   * Examples: "Indexing" or "Linking dependencies".+   */+  title: string;++  /**+   * Controls if a cancel button should show to allow the user to cancel the+   * long running operation. Clients that don't support cancellation are allowed+   * to ignore the setting.+   */+  cancellable?: boolean;++  /**+   * Optional, more detailed associated progress message. Contains+   * complementary information to the '_title'.+   *+   * Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".+   * If unset, the previous progress message (if any) is still valid.+   */+  message?: string;++  /**+   * Optional progress percentage to display (value 100 is considered 100%).+   * If not provided infinite progress is assumed and clients are allowed+   * to ignore the '_percentage' value in subsequent in report notifications.+   *+   * The value should be steadily rising. Clients are free to ignore values+   * that are not following this rule.+   */+  percentage?: number;+}+-}++-- | Parameters for 'ProgressStartNotification'.+--+-- @since 0.10.0.0+data ProgressStartParams =+  ProgressStartParams {+  -- | A unique identifier to associate multiple progress+  -- notifications with the same progress. +    _id   :: Text+  -- | Mandatory title of the progress operation.+  -- Used to briefly inform about the kind of operation being+  -- performed. Examples: "Indexing" or "Linking dependencies". +  , _title :: Text+  -- | Controls if a cancel button should show to allow the user to cancel the+  -- long running operation. Clients that don't support cancellation are allowed+  -- to ignore the setting.+  , _cancellable :: Maybe Bool +  -- | Optional, more detailed associated progress+  -- message. Contains complementary information to the+  -- '_title'. Examples: "3/25 files",+  -- "project/src/module2", "node_modules/some_dep". If+  -- unset, the previous progress message (if any) is+  -- still valid.+  , _message :: Maybe Text +  -- | Optional progress percentage to display (value 100 is considered 100%).+  -- If not provided infinite progress is assumed and clients are allowed+  -- to ignore the '_percentage' value in subsequent in report notifications.+  --+  -- The value should be steadily rising. Clients are free to ignore values+  -- that are not following this rule.+  , _percentage :: Maybe Double+  } deriving (Show, Read, Eq)++deriveJSON lspOptions{ fieldLabelModifier = customModifier } ''ProgressStartParams++-- | The window/progress/start notification is sent from the server to the+-- client to ask the client to start progress.+--+-- @since 0.10.0.0+type ProgressStartNotification = NotificationMessage ServerMethod ProgressStartParams+++{-+Progress Report Notification++The window/progress/report notification is sent from the server to the client to report progress for a previously started progress.++Notification:++method: 'window/progress/report'+params: ProgressReportParams defined as follows:+export interface ProgressReportParams {++  /**+   * A unique identifier to associate multiple progress notifications with the same progress.+   */+  id: string;++  /**+   * Optional, more detailed associated progress message. Contains+   * complementary information to the '_title'.+   *+   * Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".+   * If unset, the previous progress message (if any) is still valid.+   */+  message?: string;++  /**+   * Optional progress percentage to display (value 100 is considered 100%).+   * If infinite progress was indicated in the start notification client+   * are allowed to ignore the value. In addition the value should be steadily+   * rising. Clients are free to ignore values that are not following this rule.+   */+  percentage?: number;+}++-}++-- | Parameters for 'ProgressReportNotification'+--+-- @since 0.10.0.0+data ProgressReportParams =+  ProgressReportParams {+  -- | A unique identifier to associate multiple progress+  -- notifications with the same progress. +    _id   :: Text+  -- | Optional, more detailed associated progress+  -- message. Contains complementary information to the+  -- '_title'. Examples: "3/25 files",+  -- "project/src/module2", "node_modules/some_dep". If+  -- unset, the previous progress message (if any) is+  -- still valid.+  , _message :: Maybe Text +  -- | Optional progress percentage to display (value 100 is considered 100%).+  -- If infinite progress was indicated in the start notification client+  -- are allowed to ignore the value. In addition the value should be steadily+  -- rising. Clients are free to ignore values that are not following this rule.+  , _percentage :: Maybe Double+  } deriving (Show, Read, Eq)++deriveJSON lspOptions{ fieldLabelModifier = customModifier } ''ProgressReportParams++-- | The window/progress/report notification is sent from the server to the+-- client to report progress for a previously started progress.+--+-- @since 0.10.0.0+type ProgressReportNotification = NotificationMessage ServerMethod ProgressReportParams++{-+Progress Done Notification++The window/progress/done notification is sent from the server to the client to stop a previously started progress.++Notification:++method: 'window/progress/done'+params: ProgressDoneParams defined as follows:+export interface ProgressDoneParams {+  /**+   * A unique identifier to associate multiple progress notifications with the same progress.+   */+  id: string;+}+-}++-- | Parameters for 'ProgressDoneNotification'.+--+-- @since 0.10.0.0+data ProgressDoneParams =+  ProgressDoneParams {+  -- | A unique identifier to associate multiple progress+  -- notifications with the same progress. +    _id   :: Text+  } deriving (Show, Read, Eq)++deriveJSON lspOptions{ fieldLabelModifier = customModifier } ''ProgressDoneParams++-- | The window/progress/done notification is sent from the server to the+-- client to stop a previously started progress.+--+-- @since 0.10.0.0+type ProgressDoneNotification = NotificationMessage ServerMethod ProgressDoneParams++{-+Progress Cancel Notification++The window/progress/cancel notification is sent from the client to the server to inform the server that the user has pressed the cancel button on the progress UX. A server receiving a cancel request must still close a progress using the done notification.++Notification:++method: 'window/progress/cancel'+params: ProgressCancelParams defined as follows:+export interface ProgressCancelParams {+  /**+   * A unique identifier to associate multiple progress notifications with the same progress.+   */+  id: string;+}++-}++-- | Parameters for 'ProgressCancelNotification'.+-- +-- @since 0.10.0.0+data ProgressCancelParams =+  ProgressCancelParams {+  -- | A unique identifier to associate multiple progress+  -- notifications with the same progress. +    _id   :: Text+  } deriving (Show, Read, Eq)++deriveJSON lspOptions{ fieldLabelModifier = customModifier } ''ProgressCancelParams++-- | The window/progress/cancel notification is sent from the client to the server+-- to inform the server that the user has pressed the cancel button on the progress UX.+-- A server receiving a cancel request must still close a progress using the done notification.+-- +-- @since 0.10.0.0+type ProgressCancelNotification = NotificationMessage ServerMethod ProgressCancelParams