{-# LANGUAGE OverloadedStrings #-}
module Language.LSP.Types.Capabilities
  (
    module Language.LSP.Types.ClientCapabilities
  , module Language.LSP.Types.ServerCapabilities
  , module Language.LSP.Types.WorkspaceEdit
  , fullCaps
  , LSPVersion(..)
  , capsForVersion
  ) where

import Prelude hiding (min)
import Language.LSP.Types.ClientCapabilities
import Language.LSP.Types.ServerCapabilities
import Language.LSP.Types.WorkspaceEdit
import Language.LSP.Types

-- | Capabilities for full conformance to the current (v3.15) LSP specification.
fullCaps :: ClientCapabilities
fullCaps :: ClientCapabilities
fullCaps = LSPVersion -> ClientCapabilities
capsForVersion (Int -> Int -> LSPVersion
LSPVersion forall a. Bounded a => a
maxBound forall a. Bounded a => a
maxBound)

-- | A specific version of the LSP specification.
data LSPVersion = LSPVersion Int Int -- ^ Construct a major.minor version

-- | Capabilities for full conformance to the LSP specification up until a version.
-- Some important milestones:
--
-- * 3.12 textDocument/prepareRename request
-- * 3.11 CodeActionOptions provided by the server
-- * 3.10 hierarchical document symbols, folding ranges
-- * 3.9 completion item preselect
-- * 3.8 codeAction literals
-- * 3.7 related information in diagnostics
-- * 3.6 workspace folders, colors, goto type/implementation
-- * 3.4 extended completion item and symbol item kinds
-- * 3.0 dynamic registration
capsForVersion :: LSPVersion -> ClientCapabilities
capsForVersion :: LSPVersion -> ClientCapabilities
capsForVersion (LSPVersion Int
maj Int
min) = Maybe WorkspaceClientCapabilities
-> Maybe TextDocumentClientCapabilities
-> Maybe WindowClientCapabilities
-> Maybe GeneralClientCapabilities
-> Maybe Object
-> ClientCapabilities
ClientCapabilities (forall a. a -> Maybe a
Just WorkspaceClientCapabilities
w) (forall a. a -> Maybe a
Just TextDocumentClientCapabilities
td) (forall a. a -> Maybe a
Just WindowClientCapabilities
window) (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
16 GeneralClientCapabilities
general) forall a. Maybe a
Nothing
  where
    w :: WorkspaceClientCapabilities
w = Maybe Bool
-> Maybe WorkspaceEditClientCapabilities
-> Maybe DidChangeConfigurationClientCapabilities
-> Maybe DidChangeWatchedFilesClientCapabilities
-> Maybe WorkspaceSymbolClientCapabilities
-> Maybe ExecuteCommandClientCapabilities
-> Maybe Bool
-> Maybe Bool
-> Maybe SemanticTokensWorkspaceClientCapabilities
-> WorkspaceClientCapabilities
WorkspaceClientCapabilities
          (forall a. a -> Maybe a
Just Bool
True)
          (forall a. a -> Maybe a
Just (Maybe Bool
-> Maybe (List ResourceOperationKind)
-> Maybe FailureHandlingKind
-> Maybe Bool
-> Maybe WorkspaceEditChangeAnnotationClientCapabilities
-> WorkspaceEditClientCapabilities
WorkspaceEditClientCapabilities
                  (forall a. a -> Maybe a
Just Bool
True)
                  (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
13 List ResourceOperationKind
resourceOperations)
                  forall a. Maybe a
Nothing
                  (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
16 Bool
True)
                  (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
16 (Maybe Bool -> WorkspaceEditChangeAnnotationClientCapabilities
WorkspaceEditChangeAnnotationClientCapabilities (forall a. a -> Maybe a
Just Bool
True)))))
          (forall a. a -> Maybe a
Just (Maybe Bool -> DidChangeConfigurationClientCapabilities
DidChangeConfigurationClientCapabilities Maybe Bool
dynamicReg))
          (forall a. a -> Maybe a
Just (Maybe Bool -> DidChangeWatchedFilesClientCapabilities
DidChangeWatchedFilesClientCapabilities Maybe Bool
dynamicReg))
          (forall a. a -> Maybe a
Just WorkspaceSymbolClientCapabilities
symbolCapabilities)
          (forall a. a -> Maybe a
Just (Maybe Bool -> ExecuteCommandClientCapabilities
ExecuteCommandClientCapabilities Maybe Bool
dynamicReg))
          (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
6 Bool
True)
          (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
6 Bool
True)
          (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
16 (Maybe Bool -> SemanticTokensWorkspaceClientCapabilities
SemanticTokensWorkspaceClientCapabilities forall a b. (a -> b) -> a -> b
$ forall a. a -> Maybe a
Just Bool
True))

    resourceOperations :: List ResourceOperationKind
resourceOperations = forall a. [a] -> List a
List
      [ ResourceOperationKind
ResourceOperationCreate
      , ResourceOperationKind
ResourceOperationDelete
      , ResourceOperationKind
ResourceOperationRename
      ]

    symbolCapabilities :: WorkspaceSymbolClientCapabilities
symbolCapabilities = Maybe Bool
-> Maybe WorkspaceSymbolKindClientCapabilities
-> Maybe WorkspaceSymbolTagClientCapabilities
-> WorkspaceSymbolClientCapabilities
WorkspaceSymbolClientCapabilities
      Maybe Bool
dynamicReg
      (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
4 WorkspaceSymbolKindClientCapabilities
symbolKindCapabilities)
      (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
16 WorkspaceSymbolTagClientCapabilities
symbolTagCapabilities)

    symbolKindCapabilities :: WorkspaceSymbolKindClientCapabilities
symbolKindCapabilities =
      Maybe (List SymbolKind) -> WorkspaceSymbolKindClientCapabilities
WorkspaceSymbolKindClientCapabilities (forall a. a -> Maybe a
Just List SymbolKind
sKs)

    symbolTagCapabilities :: WorkspaceSymbolTagClientCapabilities
symbolTagCapabilities =
      Maybe (List SymbolTag) -> WorkspaceSymbolTagClientCapabilities
WorkspaceSymbolTagClientCapabilities (forall a. a -> Maybe a
Just (forall a. [a] -> List a
List [SymbolTag
StDeprecated]))

    sKs :: List SymbolKind
sKs
      | Int
maj forall a. Ord a => a -> a -> Bool
>= Int
3 Bool -> Bool -> Bool
&& Int
min forall a. Ord a => a -> a -> Bool
>= Int
4 = forall a. [a] -> List a
List ([SymbolKind]
oldSKs forall a. [a] -> [a] -> [a]
++ [SymbolKind]
newSKs)
      | Bool
otherwise            = forall a. [a] -> List a
List [SymbolKind]
oldSKs

    oldSKs :: [SymbolKind]
oldSKs =   [ SymbolKind
SkFile
               , SymbolKind
SkModule
               , SymbolKind
SkNamespace
               , SymbolKind
SkPackage
               , SymbolKind
SkClass
               , SymbolKind
SkMethod
               , SymbolKind
SkProperty
               , SymbolKind
SkField
               , SymbolKind
SkConstructor
               , SymbolKind
SkEnum
               , SymbolKind
SkInterface
               , SymbolKind
SkFunction
               , SymbolKind
SkVariable
               , SymbolKind
SkConstant
               , SymbolKind
SkString
               , SymbolKind
SkNumber
               , SymbolKind
SkBoolean
               , SymbolKind
SkArray
               ]

    newSKs :: [SymbolKind]
newSKs = [ SymbolKind
SkObject
             , SymbolKind
SkKey
             , SymbolKind
SkNull
             , SymbolKind
SkEnumMember
             , SymbolKind
SkStruct
             , SymbolKind
SkEvent
             , SymbolKind
SkOperator
             , SymbolKind
SkTypeParameter
             ]

    -- Only one token format for now, just list it here
    tfs :: List TokenFormat
tfs = forall a. [a] -> List a
List [ TokenFormat
TokenFormatRelative ]

    semanticTokensCapabilities :: SemanticTokensClientCapabilities
semanticTokensCapabilities = Maybe Bool
-> SemanticTokensRequestsClientCapabilities
-> List SemanticTokenTypes
-> List SemanticTokenModifiers
-> List TokenFormat
-> Maybe Bool
-> Maybe Bool
-> SemanticTokensClientCapabilities
SemanticTokensClientCapabilities
      (forall a. a -> Maybe a
Just Bool
True)
      (Maybe SemanticTokensRangeClientCapabilities
-> Maybe SemanticTokensFullClientCapabilities
-> SemanticTokensRequestsClientCapabilities
SemanticTokensRequestsClientCapabilities
       (forall a. a -> Maybe a
Just forall a b. (a -> b) -> a -> b
$ Bool -> SemanticTokensRangeClientCapabilities
SemanticTokensRangeBool Bool
True)
       (forall a. a -> Maybe a
Just (SemanticTokensDeltaClientCapabilities
-> SemanticTokensFullClientCapabilities
SemanticTokensFullDelta (Maybe Bool -> SemanticTokensDeltaClientCapabilities
SemanticTokensDeltaClientCapabilities forall a b. (a -> b) -> a -> b
$ forall a. a -> Maybe a
Just Bool
True))))
      (forall a. [a] -> List a
List [SemanticTokenTypes]
knownSemanticTokenTypes)
      (forall a. [a] -> List a
List [SemanticTokenModifiers]
knownSemanticTokenModifiers)
      List TokenFormat
tfs
      (forall a. a -> Maybe a
Just Bool
True)
      (forall a. a -> Maybe a
Just Bool
True)

    td :: TextDocumentClientCapabilities
td = Maybe TextDocumentSyncClientCapabilities
-> Maybe CompletionClientCapabilities
-> Maybe HoverClientCapabilities
-> Maybe SignatureHelpClientCapabilities
-> Maybe ReferencesClientCapabilities
-> Maybe DocumentHighlightClientCapabilities
-> Maybe DocumentSymbolClientCapabilities
-> Maybe DocumentFormattingClientCapabilities
-> Maybe DocumentRangeFormattingClientCapabilities
-> Maybe DocumentOnTypeFormattingClientCapabilities
-> Maybe DeclarationClientCapabilities
-> Maybe DefinitionClientCapabilities
-> Maybe TypeDefinitionClientCapabilities
-> Maybe ImplementationClientCapabilities
-> Maybe CodeActionClientCapabilities
-> Maybe CodeLensClientCapabilities
-> Maybe DocumentLinkClientCapabilities
-> Maybe DocumentColorClientCapabilities
-> Maybe RenameClientCapabilities
-> Maybe PublishDiagnosticsClientCapabilities
-> Maybe FoldingRangeClientCapabilities
-> Maybe SelectionRangeClientCapabilities
-> Maybe CallHierarchyClientCapabilities
-> Maybe SemanticTokensClientCapabilities
-> TextDocumentClientCapabilities
TextDocumentClientCapabilities
          (forall a. a -> Maybe a
Just TextDocumentSyncClientCapabilities
sync)
          (forall a. a -> Maybe a
Just CompletionClientCapabilities
completionCapability)
          (forall a. a -> Maybe a
Just HoverClientCapabilities
hoverCapability)
          (forall a. a -> Maybe a
Just SignatureHelpClientCapabilities
signatureHelpCapability)
          (forall a. a -> Maybe a
Just (Maybe Bool -> ReferencesClientCapabilities
ReferencesClientCapabilities Maybe Bool
dynamicReg))
          (forall a. a -> Maybe a
Just (Maybe Bool -> DocumentHighlightClientCapabilities
DocumentHighlightClientCapabilities Maybe Bool
dynamicReg))
          (forall a. a -> Maybe a
Just DocumentSymbolClientCapabilities
documentSymbolCapability)
          (forall a. a -> Maybe a
Just (Maybe Bool -> DocumentFormattingClientCapabilities
DocumentFormattingClientCapabilities Maybe Bool
dynamicReg))
          (forall a. a -> Maybe a
Just (Maybe Bool -> DocumentRangeFormattingClientCapabilities
DocumentRangeFormattingClientCapabilities Maybe Bool
dynamicReg))
          (forall a. a -> Maybe a
Just (Maybe Bool -> DocumentOnTypeFormattingClientCapabilities
DocumentOnTypeFormattingClientCapabilities Maybe Bool
dynamicReg))
          (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
14 (Maybe Bool -> Maybe Bool -> DeclarationClientCapabilities
DeclarationClientCapabilities Maybe Bool
dynamicReg (forall a. a -> Maybe a
Just Bool
True)))
          (forall a. a -> Maybe a
Just (Maybe Bool -> Maybe Bool -> DefinitionClientCapabilities
DefinitionClientCapabilities Maybe Bool
dynamicReg (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
14 Bool
True)))
          (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
6 (Maybe Bool -> Maybe Bool -> TypeDefinitionClientCapabilities
TypeDefinitionClientCapabilities Maybe Bool
dynamicReg (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
14 Bool
True)))
          (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
6 (Maybe Bool -> Maybe Bool -> ImplementationClientCapabilities
ImplementationClientCapabilities Maybe Bool
dynamicReg (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
14 Bool
True)))
          (forall a. a -> Maybe a
Just CodeActionClientCapabilities
codeActionCapability)
          (forall a. a -> Maybe a
Just (Maybe Bool -> CodeLensClientCapabilities
CodeLensClientCapabilities Maybe Bool
dynamicReg))
          (forall a. a -> Maybe a
Just (Maybe Bool -> Maybe Bool -> DocumentLinkClientCapabilities
DocumentLinkClientCapabilities Maybe Bool
dynamicReg (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
15 Bool
True)))
          (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
6 (Maybe Bool -> DocumentColorClientCapabilities
DocumentColorClientCapabilities Maybe Bool
dynamicReg))
          (forall a. a -> Maybe a
Just (Maybe Bool
-> Maybe Bool
-> Maybe PrepareSupportDefaultBehavior
-> Maybe Bool
-> RenameClientCapabilities
RenameClientCapabilities Maybe Bool
dynamicReg (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
12 Bool
True) (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
16 PrepareSupportDefaultBehavior
PsIdentifier) (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
16 Bool
True)))
          (forall a. a -> Maybe a
Just PublishDiagnosticsClientCapabilities
publishDiagnosticsCapabilities)
          (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
10 FoldingRangeClientCapabilities
foldingRangeCapability)
          (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
5 (Maybe Bool -> SelectionRangeClientCapabilities
SelectionRangeClientCapabilities Maybe Bool
dynamicReg))
          (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
16 (Maybe Bool -> CallHierarchyClientCapabilities
CallHierarchyClientCapabilities Maybe Bool
dynamicReg))
          (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
16 SemanticTokensClientCapabilities
semanticTokensCapabilities)

    sync :: TextDocumentSyncClientCapabilities
sync =
      Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> TextDocumentSyncClientCapabilities
TextDocumentSyncClientCapabilities
        Maybe Bool
dynamicReg
        (forall a. a -> Maybe a
Just Bool
True)
        (forall a. a -> Maybe a
Just Bool
True)
        (forall a. a -> Maybe a
Just Bool
True)

    completionCapability :: CompletionClientCapabilities
completionCapability =
      Maybe Bool
-> Maybe CompletionItemClientCapabilities
-> Maybe CompletionItemKindClientCapabilities
-> Maybe Bool
-> CompletionClientCapabilities
CompletionClientCapabilities
        Maybe Bool
dynamicReg
        (forall a. a -> Maybe a
Just CompletionItemClientCapabilities
completionItemCapabilities)
        (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
4 CompletionItemKindClientCapabilities
completionItemKindCapabilities)
        (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
3 Bool
True)

    completionItemCapabilities :: CompletionItemClientCapabilities
completionItemCapabilities = Maybe Bool
-> Maybe Bool
-> Maybe (List MarkupKind)
-> Maybe Bool
-> Maybe Bool
-> Maybe CompletionItemTagsClientCapabilities
-> Maybe Bool
-> Maybe CompletionItemResolveClientCapabilities
-> Maybe CompletionItemInsertTextModeClientCapabilities
-> CompletionItemClientCapabilities
CompletionItemClientCapabilities
      (forall a. a -> Maybe a
Just Bool
True)
      (forall a. a -> Maybe a
Just Bool
True)
      (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
3 (forall a. [a] -> List a
List [MarkupKind
MkPlainText, MarkupKind
MkMarkdown]))
      (forall a. a -> Maybe a
Just Bool
True)
      (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
9 Bool
True)
      (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
15 CompletionItemTagsClientCapabilities
completionItemTagsCapabilities)
      (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
16 Bool
True)
      (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
16 (List Text -> CompletionItemResolveClientCapabilities
CompletionItemResolveClientCapabilities (forall a. [a] -> List a
List [Text
"documentation", Text
"details"])))
      (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
16 (List InsertTextMode
-> CompletionItemInsertTextModeClientCapabilities
CompletionItemInsertTextModeClientCapabilities (forall a. [a] -> List a
List [])))

    completionItemKindCapabilities :: CompletionItemKindClientCapabilities
completionItemKindCapabilities =
      Maybe (List CompletionItemKind)
-> CompletionItemKindClientCapabilities
CompletionItemKindClientCapabilities (forall a. a -> Maybe a
Just List CompletionItemKind
ciKs)

    completionItemTagsCapabilities :: CompletionItemTagsClientCapabilities
completionItemTagsCapabilities =
      List CompletionItemTag -> CompletionItemTagsClientCapabilities
CompletionItemTagsClientCapabilities (forall a. [a] -> List a
List [ CompletionItemTag
CitDeprecated ])

    ciKs :: List CompletionItemKind
ciKs
      | Int
maj forall a. Ord a => a -> a -> Bool
>= Int
3 Bool -> Bool -> Bool
&& Int
min forall a. Ord a => a -> a -> Bool
>= Int
4 = forall a. [a] -> List a
List ([CompletionItemKind]
oldCiKs forall a. [a] -> [a] -> [a]
++ [CompletionItemKind]
newCiKs)
      | Bool
otherwise            = forall a. [a] -> List a
List [CompletionItemKind]
oldCiKs

    oldCiKs :: [CompletionItemKind]
oldCiKs =   [ CompletionItemKind
CiText
                , CompletionItemKind
CiMethod
                , CompletionItemKind
CiFunction
                , CompletionItemKind
CiConstructor
                , CompletionItemKind
CiField
                , CompletionItemKind
CiVariable
                , CompletionItemKind
CiClass
                , CompletionItemKind
CiInterface
                , CompletionItemKind
CiModule
                , CompletionItemKind
CiProperty
                , CompletionItemKind
CiUnit
                , CompletionItemKind
CiValue
                , CompletionItemKind
CiEnum
                , CompletionItemKind
CiKeyword
                , CompletionItemKind
CiSnippet
                , CompletionItemKind
CiColor
                , CompletionItemKind
CiFile
                , CompletionItemKind
CiReference
                ]

    newCiKs :: [CompletionItemKind]
newCiKs =   [ CompletionItemKind
CiFolder
                , CompletionItemKind
CiEnumMember
                , CompletionItemKind
CiConstant
                , CompletionItemKind
CiStruct
                , CompletionItemKind
CiEvent
                , CompletionItemKind
CiOperator
                , CompletionItemKind
CiTypeParameter
                ]

    hoverCapability :: HoverClientCapabilities
hoverCapability =
      Maybe Bool -> Maybe (List MarkupKind) -> HoverClientCapabilities
HoverClientCapabilities
        Maybe Bool
dynamicReg
        (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
3 (forall a. [a] -> List a
List [MarkupKind
MkPlainText, MarkupKind
MkMarkdown]))

    codeActionCapability :: CodeActionClientCapabilities
codeActionCapability
      = Maybe Bool
-> Maybe CodeActionLiteralSupport
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe CodeActionResolveClientCapabilities
-> Maybe Bool
-> CodeActionClientCapabilities
CodeActionClientCapabilities
          Maybe Bool
dynamicReg
          (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
8 (CodeActionKindClientCapabilities -> CodeActionLiteralSupport
CodeActionLiteralSupport CodeActionKindClientCapabilities
caKs))
          (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
15 Bool
True)
          (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
16 Bool
True)
          (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
16 Bool
True)
          (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
16 (List Text -> CodeActionResolveClientCapabilities
CodeActionResolveClientCapabilities (forall a. [a] -> List a
List [])))
          (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
16 Bool
True)
    caKs :: CodeActionKindClientCapabilities
caKs = List CodeActionKind -> CodeActionKindClientCapabilities
CodeActionKindClientCapabilities
              (forall a. [a] -> List a
List [CodeActionKind]
specCodeActionKinds)

    signatureHelpCapability :: SignatureHelpClientCapabilities
signatureHelpCapability =
      Maybe Bool
-> Maybe SignatureHelpSignatureInformation
-> Maybe Bool
-> SignatureHelpClientCapabilities
SignatureHelpClientCapabilities
        Maybe Bool
dynamicReg
        (forall a. a -> Maybe a
Just SignatureHelpSignatureInformation
signatureInformationCapability)
        forall a. Maybe a
Nothing

    signatureInformationCapability :: SignatureHelpSignatureInformation
signatureInformationCapability =
      Maybe (List MarkupKind)
-> Maybe SignatureHelpParameterInformation
-> Maybe Bool
-> SignatureHelpSignatureInformation
SignatureHelpSignatureInformation
        (forall a. a -> Maybe a
Just (forall a. [a] -> List a
List [MarkupKind
MkPlainText, MarkupKind
MkMarkdown]))
        (forall a. a -> Maybe a
Just SignatureHelpParameterInformation
signatureParameterCapability)
        (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
16 Bool
True)

    signatureParameterCapability :: SignatureHelpParameterInformation
signatureParameterCapability =
      Maybe Bool -> SignatureHelpParameterInformation
SignatureHelpParameterInformation (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
14 Bool
True)

    documentSymbolCapability :: DocumentSymbolClientCapabilities
documentSymbolCapability =
      Maybe Bool
-> Maybe DocumentSymbolKindClientCapabilities
-> Maybe Bool
-> Maybe DocumentSymbolTagClientCapabilities
-> Maybe Bool
-> DocumentSymbolClientCapabilities
DocumentSymbolClientCapabilities
        Maybe Bool
dynamicReg
        (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
4 DocumentSymbolKindClientCapabilities
documentSymbolKind)
        (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
10 Bool
True)
        (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
16 DocumentSymbolTagClientCapabilities
documentSymbolTag)
        (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
16 Bool
True)

    documentSymbolKind :: DocumentSymbolKindClientCapabilities
documentSymbolKind =
      Maybe (List SymbolKind) -> DocumentSymbolKindClientCapabilities
DocumentSymbolKindClientCapabilities
        (forall a. a -> Maybe a
Just List SymbolKind
sKs) -- same as workspace symbol kinds

    documentSymbolTag :: DocumentSymbolTagClientCapabilities
documentSymbolTag =
      Maybe (List SymbolTag) -> DocumentSymbolTagClientCapabilities
DocumentSymbolTagClientCapabilities (forall a. a -> Maybe a
Just (forall a. [a] -> List a
List [SymbolTag
StDeprecated]))

    foldingRangeCapability :: FoldingRangeClientCapabilities
foldingRangeCapability =
      Maybe Bool
-> Maybe UInt -> Maybe Bool -> FoldingRangeClientCapabilities
FoldingRangeClientCapabilities
        Maybe Bool
dynamicReg
        forall a. Maybe a
Nothing
        (forall a. a -> Maybe a
Just Bool
False)

    publishDiagnosticsCapabilities :: PublishDiagnosticsClientCapabilities
publishDiagnosticsCapabilities =
      Maybe Bool
-> Maybe PublishDiagnosticsTagsClientCapabilities
-> Maybe Bool
-> PublishDiagnosticsClientCapabilities
PublishDiagnosticsClientCapabilities
        (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
7 Bool
True)
        (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
15 PublishDiagnosticsTagsClientCapabilities
publishDiagnosticsTagsCapabilities)
        (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
15 Bool
True)

    publishDiagnosticsTagsCapabilities :: PublishDiagnosticsTagsClientCapabilities
publishDiagnosticsTagsCapabilities =
      List DiagnosticTag -> PublishDiagnosticsTagsClientCapabilities
PublishDiagnosticsTagsClientCapabilities
        (forall a. [a] -> List a
List [ DiagnosticTag
DtUnnecessary, DiagnosticTag
DtDeprecated ])

    dynamicReg :: Maybe Bool
dynamicReg
      | Int
maj forall a. Ord a => a -> a -> Bool
>= Int
3  = forall a. a -> Maybe a
Just Bool
True
      | Bool
otherwise = forall a. Maybe a
Nothing
    since :: Int -> Int -> a -> Maybe a
since Int
x Int
y a
a
      | Int
maj forall a. Ord a => a -> a -> Bool
>= Int
x Bool -> Bool -> Bool
&& Int
min forall a. Ord a => a -> a -> Bool
>= Int
y = forall a. a -> Maybe a
Just a
a
      | Bool
otherwise            = forall a. Maybe a
Nothing

    window :: WindowClientCapabilities
window =
      Maybe Bool
-> Maybe ShowMessageRequestClientCapabilities
-> Maybe ShowDocumentClientCapabilities
-> WindowClientCapabilities
WindowClientCapabilities
        (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
15 Bool
True)
        (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
16 forall a b. (a -> b) -> a -> b
$ Maybe MessageActionItemClientCapabilities
-> ShowMessageRequestClientCapabilities
ShowMessageRequestClientCapabilities forall a. Maybe a
Nothing)
        (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
16 forall a b. (a -> b) -> a -> b
$ Bool -> ShowDocumentClientCapabilities
ShowDocumentClientCapabilities Bool
True)

    general :: GeneralClientCapabilities
general = Maybe StaleRequestClientCapabilities
-> Maybe RegularExpressionsClientCapabilities
-> Maybe MarkdownClientCapabilities
-> GeneralClientCapabilities
GeneralClientCapabilities
      (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
16 forall a b. (a -> b) -> a -> b
$ Bool -> List Text -> StaleRequestClientCapabilities
StaleRequestClientCapabilities Bool
True (forall a. [a] -> List a
List []))
      (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
16 forall a b. (a -> b) -> a -> b
$ Text -> Maybe Text -> RegularExpressionsClientCapabilities
RegularExpressionsClientCapabilities Text
"" forall a. Maybe a
Nothing)
      (forall {a}. Int -> Int -> a -> Maybe a
since Int
3 Int
16 forall a b. (a -> b) -> a -> b
$ Text -> Maybe Text -> MarkdownClientCapabilities
MarkdownClientCapabilities Text
"" forall a. Maybe a
Nothing)