packages feed

lsp-types 2.0.2.0 → 2.1.0.0

raw patch · 417 files changed

+2864/−1859 lines, 417 filesdep ~aesondep ~row-typesPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: aeson, row-types

API changes (from Hackage documentation)

+ Language.LSP.Protocol.Capabilities: dynamicRegistrationSupported :: SMethod m -> ClientCapabilities -> Bool
- Language.LSP.Protocol.Message: regHelper :: forall m_aaHYP x_aaHYQ. SMethod m_aaHYP -> (Show (RegistrationOptions m_aaHYP) => ToJSON (RegistrationOptions m_aaHYP) => FromJSON (RegistrationOptions m_aaHYP) => x_aaHYQ) -> x_aaHYQ
+ Language.LSP.Protocol.Message: regHelper :: forall m_aaI02 x_aaI03. SMethod m_aaI02 -> (Show (RegistrationOptions m_aaI02) => ToJSON (RegistrationOptions m_aaI02) => FromJSON (RegistrationOptions m_aaI02) => x_aaI03) -> x_aaI03

This diff is very large; some files are shown as “too large to diff”. Download the raw patch for the complete diff.

Files

ChangeLog.md view
@@ -1,5 +1,11 @@ # Revision history for lsp-types +## 2.1.0.0++- Add `dynamicRegistrationSupported` to `Capabilities`.+- Fully update `fullCaps` for recent spec versions.+- Support GHC 9.8, drop checked support for GHC 8.10+ ## 2.0.2.0  - Add `Language.LSP.Protocol.Utils.Misc.prettyJSON :: Value -> Doc ann` for prettyprinting JSON, 
generated/Language/LSP/Protocol/Internal/Lens.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Method.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/AnnotatedTextEdit.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ApplyWorkspaceEditParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ApplyWorkspaceEditResult.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/BaseSymbolInformation.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CallHierarchyClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CallHierarchyIncomingCall.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CallHierarchyIncomingCallsParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CallHierarchyItem.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CallHierarchyOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CallHierarchyOutgoingCall.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CallHierarchyOutgoingCallsParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CallHierarchyPrepareParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CallHierarchyRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CancelParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ChangeAnnotation.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ChangeAnnotationIdentifier.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CodeAction.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CodeActionClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CodeActionContext.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CodeActionKind.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CodeActionOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CodeActionParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CodeActionRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CodeActionTriggerKind.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CodeDescription.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CodeLens.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CodeLensClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CodeLensOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CodeLensParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CodeLensRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CodeLensWorkspaceClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/Color.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ColorInformation.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ColorPresentation.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ColorPresentationParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/Command.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CompletionClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CompletionContext.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CompletionItem.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CompletionItemKind.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CompletionItemLabelDetails.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CompletionItemTag.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CompletionList.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CompletionOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CompletionParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CompletionRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CompletionTriggerKind.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ConfigurationItem.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ConfigurationParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CreateFile.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CreateFileOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/CreateFilesParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/Declaration.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DeclarationClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DeclarationLink.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DeclarationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DeclarationParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DeclarationRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/Definition.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DefinitionClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DefinitionLink.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DefinitionOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DefinitionParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DefinitionRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DeleteFile.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DeleteFileOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DeleteFilesParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/Diagnostic.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DiagnosticClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DiagnosticOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DiagnosticRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DiagnosticRelatedInformation.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DiagnosticServerCancellationData.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DiagnosticSeverity.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DiagnosticTag.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DiagnosticWorkspaceClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DidChangeConfigurationClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DidChangeConfigurationParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DidChangeConfigurationRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DidChangeNotebookDocumentParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DidChangeTextDocumentParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DidChangeWatchedFilesClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DidChangeWatchedFilesParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DidChangeWatchedFilesRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DidChangeWorkspaceFoldersParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DidCloseNotebookDocumentParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DidCloseTextDocumentParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DidOpenNotebookDocumentParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DidOpenTextDocumentParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DidSaveNotebookDocumentParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DidSaveTextDocumentParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentColorClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentColorOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentColorParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentColorRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentDiagnosticParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentDiagnosticReport.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentDiagnosticReportKind.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentDiagnosticReportPartialResult.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentFilter.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentFormattingClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentFormattingOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentFormattingParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentFormattingRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentHighlight.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentHighlightClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentHighlightKind.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentHighlightOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentHighlightParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentHighlightRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentLink.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentLinkClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentLinkOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentLinkParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentLinkRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentOnTypeFormattingClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentOnTypeFormattingOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentOnTypeFormattingParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentOnTypeFormattingRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentRangeFormattingClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentRangeFormattingOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentRangeFormattingParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentRangeFormattingRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentSelector.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentSymbol.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentSymbolClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentSymbolOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentSymbolParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/DocumentSymbolRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ErrorCodes.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ExecuteCommandClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ExecuteCommandOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ExecuteCommandParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ExecuteCommandRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ExecutionSummary.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/FailureHandlingKind.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/FileChangeType.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/FileCreate.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/FileDelete.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/FileEvent.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/FileOperationClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/FileOperationFilter.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/FileOperationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/FileOperationPattern.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/FileOperationPatternKind.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/FileOperationPatternOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/FileOperationRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/FileRename.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/FileSystemWatcher.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/FoldingRange.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/FoldingRangeClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/FoldingRangeKind.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/FoldingRangeOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/FoldingRangeParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/FoldingRangeRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/FormattingOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/FullDocumentDiagnosticReport.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/GeneralClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/GlobPattern.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/Hover.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/HoverClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/HoverOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/HoverParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/HoverRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ImplementationClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ImplementationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ImplementationParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ImplementationRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/InitializeError.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/InitializeParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/InitializeResult.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/InitializedParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/InlayHint.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/InlayHintClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/InlayHintKind.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/InlayHintLabelPart.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/InlayHintOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/InlayHintParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/InlayHintRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/InlayHintWorkspaceClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/InlineValue.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/InlineValueClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/InlineValueContext.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/InlineValueEvaluatableExpression.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/InlineValueOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/InlineValueParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/InlineValueRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/InlineValueText.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/InlineValueVariableLookup.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/InlineValueWorkspaceClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/InsertReplaceEdit.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/InsertTextFormat.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/InsertTextMode.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/LSPErrorCodes.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/LinkedEditingRangeClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/LinkedEditingRangeOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/LinkedEditingRangeParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/LinkedEditingRangeRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/LinkedEditingRanges.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/Location.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/LocationLink.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/LogMessageParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/LogTraceParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/MarkdownClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/MarkedString.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/MarkupContent.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/MarkupKind.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/MessageActionItem.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/MessageType.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/Moniker.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/MonikerClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/MonikerKind.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/MonikerOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/MonikerParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/MonikerRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/NotebookCell.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/NotebookCellArrayChange.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/NotebookCellKind.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/NotebookCellTextDocumentFilter.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/NotebookDocument.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/NotebookDocumentChangeEvent.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/NotebookDocumentClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/NotebookDocumentFilter.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/NotebookDocumentIdentifier.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/NotebookDocumentSyncClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/NotebookDocumentSyncOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/NotebookDocumentSyncRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/OptionalVersionedTextDocumentIdentifier.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ParameterInformation.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/PartialResultParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/Pattern.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/Position.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/PositionEncodingKind.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/PrepareRenameParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/PrepareRenameResult.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/PrepareSupportDefaultBehavior.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/PreviousResultId.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ProgressParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ProgressToken.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/PublishDiagnosticsClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/PublishDiagnosticsParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/Range.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ReferenceClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ReferenceContext.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ReferenceOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ReferenceParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ReferenceRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/Registration.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/RegistrationParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/RegularExpressionsClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/RelatedFullDocumentDiagnosticReport.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/RelatedUnchangedDocumentDiagnosticReport.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/RelativePattern.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/RenameClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/RenameFile.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/RenameFileOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/RenameFilesParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/RenameOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/RenameParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/RenameRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ResourceOperation.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ResourceOperationKind.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SaveOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SelectionRange.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SelectionRangeClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SelectionRangeOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SelectionRangeParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SelectionRangeRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SemanticTokenModifiers.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SemanticTokenTypes.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SemanticTokens.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SemanticTokensClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SemanticTokensDelta.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SemanticTokensDeltaParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SemanticTokensDeltaPartialResult.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SemanticTokensEdit.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SemanticTokensLegend.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SemanticTokensOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SemanticTokensParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SemanticTokensPartialResult.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SemanticTokensRangeParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SemanticTokensRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SemanticTokensWorkspaceClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ServerCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SetTraceParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ShowDocumentClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ShowDocumentParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ShowDocumentResult.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ShowMessageParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ShowMessageRequestClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/ShowMessageRequestParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SignatureHelp.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SignatureHelpClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SignatureHelpContext.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SignatureHelpOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SignatureHelpParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SignatureHelpRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SignatureHelpTriggerKind.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SignatureInformation.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/StaticRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SymbolInformation.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SymbolKind.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/SymbolTag.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TextDocumentChangeRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TextDocumentClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TextDocumentContentChangeEvent.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TextDocumentEdit.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TextDocumentFilter.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TextDocumentIdentifier.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TextDocumentItem.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TextDocumentPositionParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TextDocumentRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TextDocumentSaveReason.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TextDocumentSaveRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TextDocumentSyncClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TextDocumentSyncKind.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TextDocumentSyncOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TextEdit.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TokenFormat.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TraceValues.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TypeDefinitionClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TypeDefinitionOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TypeDefinitionParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TypeDefinitionRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TypeHierarchyClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TypeHierarchyItem.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TypeHierarchyOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TypeHierarchyPrepareParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TypeHierarchyRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TypeHierarchySubtypesParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/TypeHierarchySupertypesParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/UInitializeParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/UnchangedDocumentDiagnosticReport.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/UniquenessLevel.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/Unregistration.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/UnregistrationParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/VersionedNotebookDocumentIdentifier.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/VersionedTextDocumentIdentifier.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WatchKind.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WillSaveTextDocumentParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WindowClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WorkDoneProgressBegin.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WorkDoneProgressCancelParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WorkDoneProgressCreateParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WorkDoneProgressEnd.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WorkDoneProgressOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WorkDoneProgressParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WorkDoneProgressReport.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WorkspaceClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WorkspaceDiagnosticParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WorkspaceDiagnosticReport.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WorkspaceDiagnosticReportPartialResult.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WorkspaceDocumentDiagnosticReport.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WorkspaceEdit.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WorkspaceEditClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WorkspaceFolder.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WorkspaceFoldersChangeEvent.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WorkspaceFoldersInitializeParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WorkspaceFoldersServerCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WorkspaceFullDocumentDiagnosticReport.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WorkspaceSymbol.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WorkspaceSymbolClientCapabilities.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WorkspaceSymbolOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WorkspaceSymbolParams.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WorkspaceSymbolRegistrationOptions.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generated/Language/LSP/Protocol/Internal/Types/WorkspaceUnchangedDocumentDiagnosticReport.hs view
@@ -1,3 +1,5 @@+{- ORMOLU_DISABLE -}+{- HLINT ignore -} -- THIS IS A GENERATED FILE, DO NOT EDIT  {-# OPTIONS_GHC -Wno-unused-imports #-}
generator/CodeGen.hs view
@@ -1,44 +1,46 @@ {-# LANGUAGE DuplicateRecordFields #-}-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE LambdaCase #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE QuasiQuotes #-}+{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE ViewPatterns #-}-{-# LANGUAGE RecordWildCards #-}-{-# LANGUAGE QuasiQuotes #-}+ {- | The main module for generating code from the metamodel  See Note [Code generation approach] for why we do it this way. -} module CodeGen where -import qualified Data.Text as T-import qualified Data.Map as Map-import qualified Data.Set as Set-import qualified Text.RE.Replace as RE-import qualified Text.RE.TDFA.Text as RE-import Language.LSP.MetaModel as MM import Control.Monad.Reader import Control.Monad.Writer-import Prettyprinter-import Data.Traversable import Data.Foldable-import System.FilePath-import System.Directory-import qualified Data.Text.IO as T-import Data.List (sort, intersperse)-import Data.Maybe (maybeToList, fromMaybe, catMaybes, mapMaybe) import Data.Function+import Data.List (intersperse, sort)+import Data.Map qualified as Map+import Data.Maybe (catMaybes, fromMaybe, mapMaybe, maybeToList)+import Data.Set qualified as Set+import Data.Text qualified as T+import Data.Text.IO qualified as T+import Data.Traversable+import Language.LSP.MetaModel as MM+import Prettyprinter+import System.Directory+import System.FilePath+import Text.RE.Replace qualified as RE+import Text.RE.TDFA.Text qualified as RE  -- | A mapping from names in the metamodel to their names in the generated Haskell. type SymbolTable = Map.Map T.Text T.Text --- | A mapping from names in the metamodel to their structure definition, used for chasing--- supertypes.+{- | A mapping from names in the metamodel to their structure definition, used for chasing+ supertypes.+-} type StructTable = Map.Map T.Text Structure -data CodeGenEnv = CodeGenEnv {-  symbolTable :: SymbolTable+data CodeGenEnv = CodeGenEnv+  { symbolTable :: SymbolTable   , structTable :: StructTable   , modulePrefix :: T.Text   , outputDir :: FilePath@@ -46,6 +48,7 @@  -- | Monad for running overall code generation in, has access to the environment and settings. type CodeGenM = ReaderT CodeGenEnv IO+ -- | Monad for running module generation in, the same as 'CodeGenM' with the ability to record imports. type ModuleGenM = WriterT (Set.Set T.Text) CodeGenM @@ -86,37 +89,48 @@   pure t''  multilineHaddock :: Doc ann -> Doc ann-multilineHaddock doc = vsep [ "{-|", doc , "-}" ]+multilineHaddock doc = vsep ["{-|", doc, "-}"] -genModule :: forall ann . T.Text -> [T.Text] -> Maybe [T.Text] -> ModuleGenM (Doc ann) -> CodeGenM T.Text+genModule :: forall ann. T.Text -> [T.Text] -> Maybe [T.Text] -> ModuleGenM (Doc ann) -> CodeGenM T.Text genModule name pragmas mexports action = do   (doc, imports) <- runWriterT action   mp <- asks modulePrefix   dir <- asks outputDir   let-      -- these are both common in the generated code-      ghcOptions :: [T.Text] = ["-Wno-unused-imports", "-Wno-unused-matches", "-Wno-deprecations"]-      fullModName = mp <> "." <> name-      warning = "-- THIS IS A GENERATED FILE, DO NOT EDIT"-      pragmaSection = hardvcat (fmap (\p -> "{-#" <+> "LANGUAGE" <+> pretty p <+> "#-}") pragmas)-      optionsSection = hardvcat (fmap (\p -> "{-#" <+> "OPTIONS_GHC" <+> pretty p <+> "#-}") ghcOptions)-      header = case mexports of-        Just exports -> "module" <+> pretty fullModName <+> parens (cat $ punctuate "," (fmap pretty exports)) <+> "where"-        Nothing -> "module" <+> pretty fullModName <+> "where"-      -- TODO: replace with regex-      isSelfImport imp = (" " <> fullModName <> " ") `T.isInfixOf` imp || (" " <> fullModName) `T.isSuffixOf` imp-      importSection = hardvcat (fmap pretty $ filter (not . isSelfImport) $ toList imports)-      mod = warning <> hardline-          <> pragmaSection <> hardline-          <> optionsSection <> hardline-          <> header <> hardline <> hardline-          <> importSection -          <> hardline <> hardline -          <> doc <> hardline-      printed = T.pack $ show mod+    -- these are both common in the generated code+    ghcOptions :: [T.Text] = ["-Wno-unused-imports", "-Wno-unused-matches", "-Wno-deprecations"]+    fullModName = mp <> "." <> name+    ignoreComments = ["{- ORMOLU_DISABLE -}", "{- HLINT ignore -}"]+    warning = "-- THIS IS A GENERATED FILE, DO NOT EDIT"+    pragmaSection = hardvcat (fmap (\p -> "{-#" <+> "LANGUAGE" <+> pretty p <+> "#-}") pragmas)+    optionsSection = hardvcat (fmap (\p -> "{-#" <+> "OPTIONS_GHC" <+> pretty p <+> "#-}") ghcOptions)+    header = case mexports of+      Just exports -> "module" <+> pretty fullModName <+> parens (cat $ punctuate "," (fmap pretty exports)) <+> "where"+      Nothing -> "module" <+> pretty fullModName <+> "where"+    -- TODO: replace with regex+    isSelfImport imp = (" " <> fullModName <> " ") `T.isInfixOf` imp || (" " <> fullModName) `T.isSuffixOf` imp+    importSection = hardvcat (fmap pretty $ filter (not . isSelfImport) $ toList imports)+    mod =+      hardvcat ignoreComments+        <> hardline+        <> warning+        <> hardline+        <> pragmaSection+        <> hardline+        <> optionsSection+        <> hardline+        <> header+        <> hardline+        <> hardline+        <> importSection+        <> hardline+        <> hardline+        <> doc+        <> hardline+    printed = T.pack $ show mod -      modSegments = T.unpack <$> T.splitOn "." fullModName-      modulePath = foldl (</>) dir modSegments <.> "hs"+    modSegments = T.unpack <$> T.splitOn "." fullModName+    modulePath = foldl (</>) dir modSegments <.> "hs"    lift $ createDirectoryIfMissing True $ takeDirectory modulePath   lift $ T.writeFile modulePath printed@@ -162,9 +176,10 @@     genLensModule structNames     pure ()   pure ()+ -- | Names we can't put in Haskell code. reservedNames :: Set.Set T.Text-reservedNames = Set.fromList [ "data", "type" ]+reservedNames = Set.fromList ["data", "type"]  -- | Sanitize a name so we can use it in Haskell. sanitizeName :: T.Text -> T.Text@@ -172,13 +187,13 @@   -- Names can't start with underscores! Replace that with a 'U' for lack   -- of a better idea   let n' = if "_" `T.isPrefixOf` n then T.cons 'U' $ T.tail n else n-  -- Names can't have '$'s! Just throw them away.+      -- Names can't have '$'s! Just throw them away.       n'' = T.filter (\c -> c /= '$') n'-  -- If we end up with a reserved name, suffix with an underscore. This-  -- relibly gets us something recognizable, rather than trying to systematize-  -- the conversion of 'type' into 'tpe' or similar.+      -- If we end up with a reserved name, suffix with an underscore. This+      -- relibly gets us something recognizable, rather than trying to systematize+      -- the conversion of 'type' into 'tpe' or similar.       n''' = if n'' `Set.member` reservedNames then n'' <> "_" else n''-  in n'''+   in n'''  -- | Make a name to be used at the top-level (i.e. not as a member of anything). makeToplevelName :: T.Text -> T.Text@@ -189,8 +204,9 @@ makeConstrName context n =   let     cap = capitalize n-    disambiguated = case context of { Just t -> t <> "_" <> cap; Nothing -> cap }-  in sanitizeName disambiguated+    disambiguated = case context of Just t -> t <> "_" <> cap; Nothing -> cap+   in+    sanitizeName disambiguated  -- | Make a name for a field. makeFieldName :: T.Text -> T.Text@@ -208,23 +224,23 @@       symbolTable = Map.fromList $ entries <> entries' <> entries''        structTable = Map.fromList sentries-  in (symbolTable, structTable)+   in (symbolTable, structTable) --- | Translate a type in the metamodel into the corresponding Haskell type.--- See Note [Translating metamodel types]+{- | Translate a type in the metamodel into the corresponding Haskell type.+ See Note [Translating metamodel types]+-} convertType :: Type -> ModuleGenM (Doc ann) convertType = \case   BaseType n -> case n of-    URI         -> pretty <$> entityName "Language.LSP.Protocol.Types.Uri" "Uri"+    URI -> pretty <$> entityName "Language.LSP.Protocol.Types.Uri" "Uri"     DocumentUri -> pretty <$> entityName "Language.LSP.Protocol.Types.Uri" "Uri"-    Integer     -> pretty <$> entityName "Language.LSP.Protocol.Types.Common" "Int32"-    UInteger    -> pretty <$> entityName "Language.LSP.Protocol.Types.Common" "UInt"-    Decimal     -> pure "Float"-    RegExp      -> pretty <$> entityName "Data.Text" "Text"-    String      -> pretty <$> entityName "Data.Text" "Text"-    Boolean     -> pure "Bool"-    Null        -> pretty <$> entityName "Language.LSP.Protocol.Types.Common" "Null"-+    Integer -> pretty <$> entityName "Language.LSP.Protocol.Types.Common" "Int32"+    UInteger -> pretty <$> entityName "Language.LSP.Protocol.Types.Common" "UInt"+    Decimal -> pure "Float"+    RegExp -> pretty <$> entityName "Data.Text" "Text"+    String -> pretty <$> entityName "Data.Text" "Text"+    Boolean -> pure "Bool"+    Null -> pretty <$> entityName "Language.LSP.Protocol.Types.Common" "Null"   -- Special cases: these are in fact defined in the meta model, but   -- we have way better types for them @@ -235,12 +251,11 @@   ReferenceType "LSPObject" -> pretty <$> entityName "Data.Aeson" "Object"   -- 'LSPArray' is a list of 'LSPAny'... better to just say it's an aeson 'Array'!   ReferenceType "LSPArray" -> pretty <$> entityName "Data.Aeson" "Array"-   ReferenceType n -> do     st <- asks symbolTable     case Map.lookup n st of       Just thn -> pretty <$> lspEntityName (typesModSegment <> "." <> thn) thn-      Nothing  -> fail $ "Reference to unknown type: " <> show n+      Nothing -> fail $ "Reference to unknown type: " <> show n   ArrayType e -> do     innerType <- convertType e     pure $ brackets innerType@@ -259,7 +274,7 @@       ReferenceType t | Just e <- Map.lookup t st -> getStructProperties e       t -> fail $ "element of 'and' type was not a reference to a structure: " ++ show t     genAnonymousStruct $ concat props-  StructureLiteralType (StructureLiteral {properties}) -> genAnonymousStruct properties+  StructureLiteralType (StructureLiteral{properties}) -> genAnonymousStruct properties   TupleType es -> do     est <- traverse convertType es     pure $ tupled est@@ -278,7 +293,7 @@   st <- asks symbolTable   hsName <- case Map.lookup name st of     Just hsn -> pure hsn-    Nothing  -> fail $ "Unknown type: " <> show name+    Nothing -> fail $ "Unknown type: " <> show name   genModule (typesModSegment <> "." <> hsName) [] Nothing (printStruct hsName s)  printStruct :: T.Text -> Structure -> ModuleGenM (Doc ann)@@ -287,13 +302,13 @@    props <- getStructProperties s   args <- for props $ \Property{name, type_, optional, documentation, since, proposed, deprecated} -> do-      pty <- convertType type_-      let mty = case optional of-            Just True -> parens ("Maybe" <+> pty)-            _         -> pty-      let n = makeFieldName name-      propDoc <- multilineHaddock . pretty <$> mkDocumentation documentation since proposed-      pure $ hardvcat [propDoc, pretty n <+> "::" <+> mty]+    pty <- convertType type_+    let mty = case optional of+          Just True -> parens ("Maybe" <+> pty)+          _ -> pty+    let n = makeFieldName name+    propDoc <- multilineHaddock . pretty <$> mkDocumentation documentation since proposed+    pure $ hardvcat [propDoc, pretty n <+> "::" <+> mty]    -- We do *not* deprecate fields. We can't really represent this properly: typically a deprecated field   -- is optional, and the "correct" thing to do is to omit it. But in our representaiton that means passing@@ -311,7 +326,7 @@         let stockDeriv = "deriving stock" <+> tupled (fmap pretty toStockDerive)             anyclassDeriv = "deriving anyclass" <+> tupled (fmap pretty toAnyclassDerive)             viaDeriv = "deriving" <+> "Pretty" <+> "via" <+> parens ("ViaJSON" <+> pretty tn)-        in indent indentSize $ hardvcat [stockDeriv, anyclassDeriv, viaDeriv]+         in indent indentSize $ hardvcat [stockDeriv, anyclassDeriv, viaDeriv]   dataDoc <- multilineHaddock . pretty <$> mkDocumentation documentation since proposed   let dataDecl = "data" <+> pretty tn <+> "=" <+> pretty tn <+> nest indentSize (encloseSep (line <> "{ ") (line <> "}") ", " args)       datad = hardvcat (deprecations ++ [dataDoc, dataDecl, derivDoc])@@ -321,23 +336,23 @@   ensureImport "Data.Row.Hashable" (QualAs "Hashable")   matcherName <- entityName "Language.LSP.Protocol.Types.Common" ".=?"   let toJsonD =-        let (unzip -> (args, pairEs)) = flip fmap (zip props [0..]) $ \(Property{name, optional}, i) ->+        let (unzip -> (args, pairEs)) = flip fmap (zip props [0 ..]) $ \(Property{name, optional}, i) ->               let n :: T.Text = "arg" <> (T.pack $ show i)                   pairE = case optional of                     Just True -> dquotes (pretty name) <+> pretty matcherName <+> pretty n                     _ -> brackets (dquotes (pretty name) <+> "Aeson..=" <+> pretty n)-              in (pretty n, pairE)+               in (pretty n, pairE)             body = "Aeson.object $ concat $ " <+> encloseSep "[" "]" "," pairEs             toJsonDoc = "toJSON" <+> parens (pretty tn <+> hsep args) <+> "=" <+> nest indentSize body             instanceDoc = "instance Aeson.ToJSON" <+> pretty tn <+> "where" <> nest indentSize (hardline <> toJsonDoc)-        in instanceDoc+         in instanceDoc    fromJsonD <- do     let vn :: T.Text = "arg"     let exprs = flip fmap props $ \Property{name, optional} ->           case optional of             Just True -> pretty vn <+> "Aeson..:!" <+> dquotes (pretty name)-            _         -> pretty vn <+> "Aeson..:" <+> dquotes (pretty name)+            _ -> pretty vn <+> "Aeson..:" <+> dquotes (pretty name)     let lamBody = mkIterApplicativeApp (pretty tn) exprs     let body = "Aeson.withObject" <+> dquotes (pretty structName) <+> "$" <+> "\\" <> pretty vn <+> "->" <+> nest indentSize lamBody     let fromJsonDoc = "parseJSON" <+> "=" <+> nest indentSize body@@ -345,11 +360,13 @@     pure instanceDoc    pure $-    datad <>-    hardline <> hardline <>-    toJsonD <>-    hardline <> hardline <>-    fromJsonD+    datad+      <> hardline+      <> hardline+      <> toJsonD+      <> hardline+      <> hardline+      <> fromJsonD  -- | Get the list of properties of a struct, including inherited ones. getStructProperties :: Structure -> ModuleGenM [Property]@@ -375,7 +392,7 @@     pty <- convertType type_     let mty = case optional of           Just True -> parens ("Maybe" <+> pty)-          _         -> pty+          _ -> pty     ensureImport "Data.Row" (QualAs "Row")     pure $ dquotes (pretty name) <+> "Row..==" <+> mty   let tyList = foldr (\ty l -> parens $ ty <+> "Row..+" <+> l) "Row.Empty" row@@ -386,7 +403,7 @@   st <- asks symbolTable   hsName <- case Map.lookup name st of     Just hsn -> pure hsn-    Nothing  -> fail $ "Unknown type: " <> show name+    Nothing -> fail $ "Unknown type: " <> show name   genModule (typesModSegment <> "." <> hsName) [] Nothing (printEnum hsName e)  printEnum :: T.Text -> Enumeration -> ModuleGenM (Doc ann)@@ -402,10 +419,10 @@   -- The (Haskell) type of the elements of this enum. Useful, so we can generate various   -- code (e.g. for parsing JSON) generically but use this type to pin down what we want to do.   ty <- case type_ of-    BaseType Integer  -> pretty <$> entityName "Language.LSP.Protocol.Types.Common" "Int32"+    BaseType Integer -> pretty <$> entityName "Language.LSP.Protocol.Types.Common" "Int32"     BaseType UInteger -> pretty <$> entityName "Language.LSP.Protocol.Types.Common" "UInt"-    BaseType String   -> pretty <$> entityName "Data.Text" "Text"-    _                 -> fail $ "enumeration of unexpected type " ++ show type_+    BaseType String -> pretty <$> entityName "Data.Text" "Text"+    _ -> fail $ "enumeration of unexpected type " ++ show type_    let isString = case type_ of         BaseType String -> True@@ -416,19 +433,19 @@       values' = filter (\EnumerationEntry{name} -> name `notElem` badEnumValues) values   -- The associations between constructor names and their literals   assocs <- for values' $ \EnumerationEntry{name, value, documentation, since, proposed} -> do-        let cn = makeConstrName (Just enumName) name-          -- The literal for the actual enum value in this case-            lit = case value of-                T t -> pretty $ show $ T.unpack t-                I i -> pretty $ show i-        doc <- mkDocumentation documentation since proposed-        pure (cn, lit, doc)+    let cn = makeConstrName (Just enumName) name+        -- The literal for the actual enum value in this case+        lit = case value of+          T t -> pretty $ show $ T.unpack t+          I i -> pretty $ show i+    doc <- mkDocumentation documentation since proposed+    pure (cn, lit, doc)    let normalCons = flip fmap assocs $ \(cn, _, doc) ->-        hardvcat [ multilineHaddock $ pretty doc,  pretty cn ]+        hardvcat [multilineHaddock $ pretty doc, pretty cn]   let customCon =         let cn = makeConstrName (Just enumName) "Custom"-        in if custom then Just (cn, pretty cn <+> ty) else Nothing+         in if custom then Just (cn, pretty cn <+> ty) else Nothing   let cons = normalCons ++ (fmap snd $ maybeToList customCon)    ensureImport "Data.Aeson" (QualAs "Aeson")@@ -459,68 +476,72 @@           anyclassDeriv = "deriving anyclass" <+> tupled (fmap pretty toAnyclassDerive)           viaDeriv1 = "deriving" <+> tupled toDeriveViaLspEnum <+> "via" <+> parens (asLspEnumN <+> pretty tn <+> ty)           viaDeriv2 = "deriving" <+> "Pretty" <+> "via" <+> parens ("ViaJSON" <+> pretty tn)-        in indent indentSize $ hardvcat [stockDeriv, anyclassDeriv, viaDeriv1, viaDeriv2]+         in+          indent indentSize $ hardvcat [stockDeriv, anyclassDeriv, viaDeriv1, viaDeriv2]   let dataDecl = "data" <+> pretty tn <+> "=" <+> nest indentSize (encloseSep (line <> "  ") mempty "| " cons)       dataD = hardvcat (deprecations ++ [dataDoc, dataDecl, derivDoc])    setFromListN <- pretty <$> entityName "Data.Set" "fromList"   let knownValuesD =         let valuesList = nest indentSize $ encloseSep "[" "]" "," $ flip fmap assocs $ \(n, _, _) -> pretty n-        in knownValuesN <+> "=" <+> setFromListN <+> valuesList+         in knownValuesN <+> "=" <+> setFromListN <+> valuesList    let toBaseTypeD =         -- xToValue X1 = <X1 value>         let normalClauses = flip fmap assocs $ \(n, v, _) -> toBaseTypeN <+> pretty n <+> "=" <+> v-        -- xToValue (CustomX c) = c+            -- xToValue (CustomX c) = c             customClause = case customCon of               Just (cn, _) ->                 let vn :: T.Text = "arg"-                in Just $ toBaseTypeN <+> parens (pretty cn <+> pretty vn) <+> "=" <+> pretty vn+                 in Just $ toBaseTypeN <+> parens (pretty cn <+> pretty vn) <+> "=" <+> pretty vn               Nothing -> Nothing             clauses = normalClauses ++ maybeToList customClause-        in hardvcat clauses+         in hardvcat clauses    let fromBaseTypeD =         let fn = if custom then fromOpenBaseTypeN else fromBaseTypeN-        -- valueToX <X1 value> = X-        -- or-        -- valueToX <X1 value> = Just X+            -- valueToX <X1 value> = X+            -- or+            -- valueToX <X1 value> = Just X             normalClauses = flip fmap assocs $ \(n, v, _) -> fn <+> v <+> "=" <+> if custom then pretty n else "pure" <+> pretty n-        -- valueToX c = CustomX c-        -- or-        -- valueToX _ = Nothing+            -- valueToX c = CustomX c+            -- or+            -- valueToX _ = Nothing             fallThroughClause = case customCon of               Just (cn, _) ->                 let vn :: T.Text = "arg"-                in fn <+> pretty vn <+> "=" <+> pretty cn <+> pretty vn-              Nothing ->  fn <+> "_ = Nothing"+                 in fn <+> pretty vn <+> "=" <+> pretty cn <+> pretty vn+              Nothing -> fn <+> "_ = Nothing"             clauses = normalClauses ++ [fallThroughClause]-        in hardvcat clauses+         in hardvcat clauses    let lspEnumD =         let           baseTypeD = "type EnumBaseType" <+> pretty tn <+> "=" <+> ty           decls = [knownValuesD, baseTypeD, toBaseTypeD] ++ if custom then [] else [fromBaseTypeD]           instanceDoc = "instance" <+> lspEnumN <+> pretty tn <+> "where" <> nest indentSize (hardline <> vcat decls)-        in instanceDoc+         in+          instanceDoc   let lspOpenEnumD = "instance" <+> lspOpenEnumN <+> pretty tn <+> "where" <> nest indentSize (hardline <> fromBaseTypeD)    pure $-    dataD <>-    hardline <> hardline <>-    lspEnumD <>-    hardline <> hardline <>-    (if custom then lspOpenEnumD <> hardline <> hardline else "")+    dataD+      <> hardline+      <> hardline+      <> lspEnumD+      <> hardline+      <> hardline+      <> (if custom then lspOpenEnumD <> hardline <> hardline else "")  genAlias :: TypeAlias -> CodeGenM T.Text genAlias a@TypeAlias{name} = do   st <- asks symbolTable   hsName <- case Map.lookup name st of     Just hsn -> pure hsn-    Nothing  -> fail $ "Unknown type: " <> show name+    Nothing -> fail $ "Unknown type: " <> show name   genModule (typesModSegment <> "." <> hsName) [] Nothing (printAlias hsName a) -printAlias :: forall ann . T.Text -> TypeAlias -> ModuleGenM (Doc ann)+printAlias :: forall ann. T.Text -> TypeAlias -> ModuleGenM (Doc ann) printAlias hsName TypeAlias{name, type_, documentation, since, proposed, deprecated} = do   st <- asks symbolTable   rhs <- convertType type_@@ -536,12 +557,12 @@   -- In practice, it seems that only base types and aliases to base types get used as map keys, so deriving   -- To/FromJSONKey for them seems to be enough   let derivDoc =-        let aesonDeriving :: [Doc ann] = ["Aeson.ToJSON", "Aeson.FromJSON"] ++ case type_ of { BaseType _ -> ["Aeson.ToJSONKey", "Aeson.FromJSONKey"]; _ -> [] }+        let aesonDeriving :: [Doc ann] = ["Aeson.ToJSON", "Aeson.FromJSON"] ++ case type_ of BaseType _ -> ["Aeson.ToJSONKey", "Aeson.FromJSONKey"]; _ -> []             newtypeDeriv = "deriving newtype" <+> tupled aesonDeriving             stockDeriv = "deriving stock" <+> tupled (fmap pretty toStockDerive)             anyclassDeriv = "deriving anyclass" <+> tupled (fmap pretty toAnyclassDerive)             viaDeriv = "deriving" <+> "Pretty" <+> "via" <+> parens ("ViaJSON" <+> pretty hsName)-        in indent indentSize $ hardvcat [newtypeDeriv, stockDeriv, anyclassDeriv, viaDeriv]+         in indent indentSize $ hardvcat [newtypeDeriv, stockDeriv, anyclassDeriv, viaDeriv]   dataDoc <- multilineHaddock . pretty <$> mkDocumentation documentation since proposed   let dataDecl = "newtype" <+> pretty hsName <+> "=" <+> pretty hsName <+> rhs       datad = hardvcat (optDeprecated hsName deprecated ++ [dataDoc, dataDecl, derivDoc])@@ -550,40 +571,40 @@ ---------------  data RequestData ann = RequestData-  { methCon                :: Doc ann-  , singCon                :: Doc ann-  , paramsEq               :: Doc ann-  , resultEq               :: Doc ann-  , errorDataEq            :: Doc ann-  , registrationOptionsEq  :: Doc ann-  , toStringClause         :: Doc ann-  , fromStringClause       :: Doc ann+  { methCon :: Doc ann+  , singCon :: Doc ann+  , paramsEq :: Doc ann+  , resultEq :: Doc ann+  , errorDataEq :: Doc ann+  , registrationOptionsEq :: Doc ann+  , toStringClause :: Doc ann+  , fromStringClause :: Doc ann   , messageDirectionClause :: Doc ann-  , messageKindClause      :: Doc ann+  , messageKindClause :: Doc ann   }  data NotificationData ann = NotificationData-  { methCon                :: Doc ann-  , singCon                :: Doc ann-  , paramsEq               :: Doc ann-  , registrationOptionsEq  :: Doc ann-  , toStringClause         :: Doc ann-  , fromStringClause       :: Doc ann+  { methCon :: Doc ann+  , singCon :: Doc ann+  , paramsEq :: Doc ann+  , registrationOptionsEq :: Doc ann+  , toStringClause :: Doc ann+  , fromStringClause :: Doc ann   , messageDirectionClause :: Doc ann-  , messageKindClause      :: Doc ann+  , messageKindClause :: Doc ann   }  data CustomData ann = CustomData-  { methCon                :: Doc ann-  , singCon                :: Doc ann-  , paramsEq               :: Doc ann-  , resultEq               :: Doc ann-  , errorDataEq            :: Doc ann-  , registrationOptionsEq  :: Doc ann-  , toStringClause         :: Doc ann-  , fromStringClause       :: Doc ann+  { methCon :: Doc ann+  , singCon :: Doc ann+  , paramsEq :: Doc ann+  , resultEq :: Doc ann+  , errorDataEq :: Doc ann+  , registrationOptionsEq :: Doc ann+  , toStringClause :: Doc ann+  , fromStringClause :: Doc ann   , messageDirectionClause :: Doc ann-  , messageKindClause      :: Doc ann+  , messageKindClause :: Doc ann   }  -- See Note [Generating code for methods]@@ -605,7 +626,7 @@    let methodName context fullName =         let pieces = T.splitOn "/" fullName-        in pretty $ makeConstrName context $ foldMap capitalize pieces+         in pretty $ makeConstrName context $ foldMap capitalize pieces   let messagePartType t = case t of         Just ty -> convertType ty         -- See Note [Absent parameters/results/errors]@@ -620,9 +641,9 @@     -- <constructor name> :: Method <direction> <method type>     let mcn = methodName (Just mtyN) method         direction = case messageDirection of-            MM.ClientToServer -> "MM.ClientToServer"-            MM.ServerToClient -> "MM.ServerToClient"-            MM.Both           -> "f"+          MM.ClientToServer -> "MM.ClientToServer"+          MM.ServerToClient -> "MM.ServerToClient"+          MM.Both -> "f"         methCon = mcn <+> "::" <+> pretty mtyN <+> direction <+> "MM.Request"         scn = methodName (Just styN) method         singCon = scn <+> "::" <+> pretty styN <+> mcn@@ -644,17 +665,17 @@           let d = case messageDirection of                 MM.ClientToServer -> "MM.SClientToServer"                 MM.ServerToClient -> "MM.SServerToClient"-                MM.Both           -> "MM.SBothDirections"-          in mdN <+> scn <+> "=" <+> d+                MM.Both -> "MM.SBothDirections"+           in mdN <+> scn <+> "=" <+> d         messageKindClause = "messageKind" <+> scn <+> "=" <+> "MM.SRequest"-    pure $ RequestData {..}+    pure $ RequestData{..}    notData <- for nots $ \Notification{method, params, registrationOptions, messageDirection} -> do     let mcn = methodName (Just mtyN) method         direction = case messageDirection of-            MM.ClientToServer -> "MM.ClientToServer"-            MM.ServerToClient -> "MM.ServerToClient"-            MM.Both           -> "f"+          MM.ClientToServer -> "MM.ClientToServer"+          MM.ServerToClient -> "MM.ServerToClient"+          MM.Both -> "f"         methCon = mcn <+> "::" <+> pretty mtyN <+> direction <+> "MM.Notification"         scn = methodName (Just styN) method         singCon = scn <+> "::" <+> pretty styN <+> mcn@@ -671,11 +692,11 @@           let d = case messageDirection of                 MM.ClientToServer -> "MM.SClientToServer"                 MM.ServerToClient -> "MM.SServerToClient"-                MM.Both           -> "MM.SBothDirections"-          in "messageDirection" <+> scn <+> "=" <+> d+                MM.Both -> "MM.SBothDirections"+           in "messageDirection" <+> scn <+> "=" <+> d         messageKindClause = "messageKind" <+> scn <+> "=" <+> "MM.SNotification" -    pure $ NotificationData {..}+    pure $ NotificationData{..}    -- Add the custom method case, which isn't in the metamodel   customDat <- do@@ -690,10 +711,10 @@     -- MessageParams (Method_CustomMethod s) = Value     ensureImport "Data.Aeson" (QualAs "Aeson")     let paramsEq = mpN <+> parens (mcn <+> "s") <+> "=" <+> "Aeson.Value"-    -- MessageResult (Method_CustomMethod s) = Value+        -- MessageResult (Method_CustomMethod s) = Value         resultEq = mrN <+> parens (mcn <+> "s") <+> "=" <+> "Aeson.Value"-    -- Can shove whatever you want in the error data for custom methods?-    -- ErrorData (Method_CustomMethod s) = Value+        -- Can shove whatever you want in the error data for custom methods?+        -- ErrorData (Method_CustomMethod s) = Value         errorDataEq = edN <+> parens (mcn <+> "s") <+> "=" <+> "Aeson.Value"     -- Can't register custom methods     -- RegistrationOptions (Method_CustomMethod s) = Void@@ -705,7 +726,7 @@         messageDirectionClause = mdN <+> parens (scn <+> "_") <+> "=" <+> "MM.SBothDirections"         messageKindClause = mkN <+> parens (scn <+> "_") <+> "=" <+> "MM.SBothTypes" -    pure $ CustomData {..}+    pure $ CustomData{..}    ensureImport "Data.Kind" (QualAs "Kind")   let dataD =@@ -713,101 +734,111 @@             docD = "-- | A type representing a LSP method (or class of methods), intended to be used mostly at the type level."             ctors = fmap (\RequestData{..} -> methCon) reqData ++ fmap (\NotificationData{..} -> methCon) notData ++ [(\CustomData{..} -> methCon) customDat]             dataD = nest indentSize $ "data" <+> pretty mtyN <+> "f t" <+> "where" <+> (hardline <> hardvcat ctors)-        -- This only really exists on the type level so we don't really want instances anyway-        in hardvcat [docD, sigD, dataD]+         in -- This only really exists on the type level so we don't really want instances anyway+            hardvcat [docD, sigD, dataD]    let mpD =         let sigD = "type" <+> mpN <+> ":: forall f t ." <+> pretty mtyN <+> "f t" <+> "->" <+> "Kind.Type"             docD = "-- | Maps a LSP method to its parameter type."             eqns = fmap (\RequestData{..} -> paramsEq) reqData ++ fmap (\NotificationData{..} -> paramsEq) notData ++ [(\CustomData{..} -> paramsEq) customDat]             declD = nest indentSize $ "type family" <+> mpN <+> parens ("m :: " <+> pretty mtyN <+> "f t") <+> "where" <+> (hardline <> hardvcat eqns)-        in hardvcat [docD, sigD, declD]+         in hardvcat [docD, sigD, declD]    let mrD =         let sigD = "type" <+> mrN <+> ":: forall f t ." <+> pretty mtyN <+> "f t" <+> "->" <+> "Kind.Type"             docD = "-- | Maps a LSP method to its result type."-        -- TODO: should we give notifiations ()?+            -- TODO: should we give notifiations ()?             eqns = fmap (\RequestData{..} -> resultEq) reqData ++ [(\CustomData{..} -> resultEq) customDat]             declD = nest indentSize $ "type family" <+> mrN <+> parens ("m :: " <+> pretty mtyN <+> "f t") <+> "where" <+> (hardline <> hardvcat eqns)-        in hardvcat [docD, sigD, declD]+         in hardvcat [docD, sigD, declD]    let edD =         let sigD = "type" <+> edN <+> ":: forall f t ." <+> pretty mtyN <+> "f t" <+> "->" <+> "Kind.Type"             docD = "-- | Maps a LSP method to its error data type."-        -- TODO: should we give notifiations ()?+            -- TODO: should we give notifiations ()?             eqns = fmap (\RequestData{..} -> errorDataEq) reqData ++ [(\CustomData{..} -> errorDataEq) customDat]             declD = nest indentSize $ "type family" <+> edN <+> parens ("m :: " <+> pretty mtyN <+> "f t") <+> "where" <+> (hardline <> hardvcat eqns)-        in hardvcat [docD, sigD, declD]+         in hardvcat [docD, sigD, declD]    let roD =         let sigD = "type" <+> roN <+> ":: forall f t ." <+> pretty mtyN <+> "f t" <+> "->" <+> "Kind.Type"             docD = "-- | Maps a LSP method to its registration options type."             eqns = fmap (\RequestData{..} -> registrationOptionsEq) reqData ++ fmap (\NotificationData{..} -> registrationOptionsEq) notData ++ [(\CustomData{..} -> registrationOptionsEq) customDat]             declD = nest indentSize $ "type family" <+> roN <+> parens ("m :: " <+> pretty mtyN <+> "f t") <+> "where" <+> (hardline <> hardvcat eqns)-        in hardvcat [docD, sigD, declD]+         in hardvcat [docD, sigD, declD]    let singD =         let sigD = "type" <+> pretty styN <+> ":: forall f t ." <+> pretty mtyN <+> "f t" <+> "->" <+> "Kind.Type"             docD = "-- | A singleton type for 'Method'."             ctors = fmap (\RequestData{..} -> singCon) reqData ++ fmap (\NotificationData{..} -> singCon) notData ++ [(\CustomData{..} -> singCon) customDat]-        -- Can't derive instances, it's a GADT, will do them later+            -- Can't derive instances, it's a GADT, will do them later             dataD = nest indentSize $ "data" <+> pretty styN <+> "m" <+> "where" <+> (hardline <> hardvcat ctors)-        in hardvcat [docD, sigD, dataD]+         in hardvcat [docD, sigD, dataD]    let ssmD =         let ctor = smcn <+> "::" <+> "forall m ." <+> pretty styN <+> "m" <+> "->" <+> sstyN             docD = "-- | A method which isn't statically known."-        -- Can't derive instances because it's a GADT and we're not doing the instances for SMethod here either+            -- Can't derive instances because it's a GADT and we're not doing the instances for SMethod here either             dataD = nest indentSize $ "data" <+> sstyN <+> "where" <+> (hardline <> ctor)-        in hardvcat [docD, dataD]+         in hardvcat [docD, dataD]    -- methodToString :: SomeMethod -> String   let toStringD =         let docD = "-- | Turn a 'SomeMethod' into its LSP method string."             sigD = toStringN <+> "::" <+> sstyN <+> "->" <+> "String"             clauses = fmap (\RequestData{..} -> toStringClause) reqData ++ fmap (\NotificationData{..} -> toStringClause) notData ++ [(\CustomData{..} -> toStringClause) customDat]-        in hardvcat [docD, sigD, hardvcat clauses]+         in hardvcat [docD, sigD, hardvcat clauses]   -- stringToMethod :: String -> SomeMethod   let fromStringD =         let docD = "-- | Turn a LSP method string into a 'SomeMethod'."             sigD = fromStringN <+> "::" <+> "String" <+> "->" <+> sstyN             clauses = fmap (\RequestData{..} -> fromStringClause) reqData ++ fmap (\NotificationData{..} -> fromStringClause) notData ++ [(\CustomData{..} -> fromStringClause) customDat]-        in hardvcat [docD, sigD, hardvcat clauses]+         in hardvcat [docD, sigD, hardvcat clauses]    let messageDirectionD =         let docD = "-- | Get a singleton witness for the message direction of a 'SMethod'."             sigD = mdN <+> ":: forall f t (m :: Method f t) ." <+> pretty styN <+> "m" <+> "->" <+> "MM.SMessageDirection f"             clauses = fmap (\RequestData{..} -> messageDirectionClause) reqData ++ fmap (\NotificationData{..} -> messageDirectionClause) notData ++ [(\CustomData{..} -> messageDirectionClause) customDat]-        in hardvcat [docD, sigD, hardvcat clauses]+         in hardvcat [docD, sigD, hardvcat clauses]    let messageKindD =         let docD = "-- | Get a singleton witness for the message kind of a 'SMethod'."             sigD = mkN <+> ":: forall f t (m :: Method f t) ." <+> pretty styN <+> "m" <+> "->" <+> "MM.SMessageKind t"             clauses = fmap (\RequestData{..} -> messageKindClause) reqData ++ fmap (\NotificationData{..} -> messageKindClause) notData ++ [(\CustomData{..} -> messageKindClause) customDat]-        in hardvcat [docD, sigD, hardvcat clauses]+         in hardvcat [docD, sigD, hardvcat clauses]    pure $-    dataD <>-    hardline <> hardline <>-    mpD <>-    hardline <> hardline <>-    mrD <>-    hardline <> hardline <>-    edD <>-    hardline <> hardline <>-    roD <>-    hardline <> hardline <>-    singD <>-    hardline <> hardline <>-    ssmD <>-    hardline <> hardline <>-    toStringD <>-    hardline <> hardline <>-    fromStringD <>-    hardline <> hardline <>-    messageDirectionD <>-    hardline <> hardline <>-    messageKindD+    dataD+      <> hardline+      <> hardline+      <> mpD+      <> hardline+      <> hardline+      <> mrD+      <> hardline+      <> hardline+      <> edD+      <> hardline+      <> hardline+      <> roD+      <> hardline+      <> hardline+      <> singD+      <> hardline+      <> hardline+      <> ssmD+      <> hardline+      <> hardline+      <> toStringD+      <> hardline+      <> hardline+      <> fromStringD+      <> hardline+      <> hardline+      <> messageDirectionD+      <> hardline+      <> hardline+      <> messageKindD  genMethods :: [Request] -> [Notification] -> CodeGenM T.Text genMethods reqs nots = do@@ -849,9 +880,9 @@  mkIterApplicativeApp :: Doc a -> [Doc a] -> Doc a mkIterApplicativeApp hd [] = "pure" <+> hd-mkIterApplicativeApp hd (a:rest) =+mkIterApplicativeApp hd (a : rest) =   let acc = hd <+> "<$>" <+> a-  in foldl' (\acc a -> acc <+> "<*>" <+> a) acc rest+   in foldl' (\acc a -> acc <+> "<*>" <+> a) acc rest  {- Note [Code generation approach] The approach we take here is quite primitive: we just print out Haskell modules
generator/Main.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE OverloadedStrings #-}+ module Main (main) where  import CodeGen
lsp-types.cabal view
@@ -1,6 +1,6 @@ cabal-version:      3.0 name:               lsp-types-version:            2.0.2.0+version:            2.1.0.0 synopsis:   Haskell library for the Microsoft Language Server Protocol, data types @@ -53,6 +53,7 @@     FunctionalDependencies     GADTs     GeneralizedNewtypeDeriving+    ImportQualifiedPost     KindSignatures     MultiParamTypeClasses     NegativeLiterals@@ -68,7 +69,7 @@     UndecidableInstances    build-depends:-    , aeson             >=1.2.2.0 && <2.2+    , aeson             >=1.2.2.0 && <2.3     , base              >=4.11    && <5     , binary     , containers@@ -86,7 +87,7 @@     , mtl               <2.4     , prettyprinter          , network-uri       >=2.6-    , row-types+    , row-types         >=1.0     , safe     , some     , template-haskell@@ -521,7 +522,7 @@   visibility: public   hs-source-dirs:     metamodel   default-language:   Haskell2010-  default-extensions: StrictData+  default-extensions: StrictData ImportQualifiedPost   exposed-modules:     Language.LSP.MetaModel     Language.LSP.MetaModel.Types@@ -537,7 +538,7 @@ executable generator   hs-source-dirs:     generator   default-language:   Haskell2010-  default-extensions: StrictData+  default-extensions: StrictData ImportQualifiedPost   main-is:            Main.hs   other-modules:      CodeGen   build-depends:@@ -555,6 +556,7 @@   type:               exitcode-stdio-1.0   hs-source-dirs:     test   default-language:   Haskell2010+  default-extensions: ImportQualifiedPost   main-is:            Main.hs   other-modules:     CapabilitiesSpec
metamodel/Language/LSP/MetaModel.hs view
@@ -1,11 +1,11 @@-{-# LANGUAGE TemplateHaskell       #-}+{-# LANGUAGE TemplateHaskell #-}  module Language.LSP.MetaModel (module Export, metaModel) where  import Language.LSP.MetaModel.Types as Export  import Data.FileEmbed (makeRelativeToProject)-import qualified Language.Haskell.TH as TH+import Language.Haskell.TH qualified as TH  -- | The metamodel used to generate the LSP types in this package. metaModel :: MetaModel
metamodel/Language/LSP/MetaModel/Types.hs view
@@ -1,15 +1,16 @@-{-# LANGUAGE DataKinds             #-}-{-# LANGUAGE DerivingStrategies             #-}-{-# LANGUAGE DeriveLift             #-}+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveLift #-}+{-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE DuplicateRecordFields #-}-{-# LANGUAGE GADTs                 #-}-{-# LANGUAGE KindSignatures        #-}-{-# LANGUAGE LambdaCase            #-}-{-# LANGUAGE OverloadedStrings     #-}-{-# LANGUAGE ScopedTypeVariables   #-}-{-# LANGUAGE TemplateHaskell       #-}-{-# LANGUAGE TypeApplications      #-}-{-|+{-# LANGUAGE GADTs #-}+{-# LANGUAGE KindSignatures #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE TypeApplications #-}++{- | This defines the types of the LSP "metamodel", which is a machine-readable format specifying the types used in the LSP protocol. @@ -22,17 +23,17 @@ -} module Language.LSP.MetaModel.Types where -import           Data.Aeson         hiding (Null, String)-import qualified Data.Aeson         as JSON-import qualified Data.Aeson.TH      as JSON-import qualified Data.Char          as Char-import           Data.Text          (Text)+import Data.Aeson hiding (Null, String)+import Data.Aeson qualified as JSON+import Data.Aeson.TH qualified as JSON+import Data.Char qualified as Char+import Data.Text (Text) -import           Control.Lens-import           Control.Monad.IO.Class-import qualified Data.List.NonEmpty as NE+import Control.Lens+import Control.Monad.IO.Class+import Data.List.NonEmpty qualified as NE -import Language.Haskell.TH.Syntax (Lift(..), Q, Exp, addDependentFile)+import Language.Haskell.TH.Syntax (Exp, Lift (..), Q, addDependentFile)  -- | What direction is this message sent in: server to client, client to server, or both? data MessageDirection = ServerToClient | ClientToServer | Both@@ -41,14 +42,14 @@ instance ToJSON MessageDirection where   toJSON ServerToClient = toJSON @String "serverToClient"   toJSON ClientToServer = toJSON @String "clientToServer"-  toJSON Both           = toJSON @String "both"+  toJSON Both = toJSON @String "both"  instance FromJSON MessageDirection where   parseJSON = withText "MessageDirection" $ \case     "serverToClient" -> pure ServerToClient     "clientToServer" -> pure ClientToServer-    "both"           -> pure Both-    t                -> fail $ "unknown message direction " ++ show t+    "both" -> pure Both+    t -> fail $ "unknown message direction " ++ show t  -- | The "base types" in the metamodel. data BaseTypeName = URI | DocumentUri | Integer | UInteger | Decimal | RegExp | String | Boolean | Null@@ -56,120 +57,121 @@  -- | A property of a structure. data Property = Property-  { name          :: Text-  , type_         :: Type-  , optional      :: Maybe Bool+  { name :: Text+  , type_ :: Type+  , optional :: Maybe Bool   , documentation :: Maybe Text-  , since         :: Maybe Text-  , proposed      :: Maybe Bool-  , deprecated    :: Maybe Text+  , since :: Maybe Text+  , proposed :: Maybe Bool+  , deprecated :: Maybe Text   }   deriving stock (Show, Eq, Ord, Lift)  -- | An anonymous structure type. data StructureLiteral = StructureLiteral-  { properties    :: [Property]+  { properties :: [Property]   , documentation :: Maybe Text-  , since         :: Maybe Text-  , proposed      :: Maybe Bool-  , deprecated    :: Maybe Text+  , since :: Maybe Text+  , proposed :: Maybe Bool+  , deprecated :: Maybe Text   }   deriving stock (Show, Eq, Ord, Lift)  -- | The various kinds of type in the metamodel.-data Type =-  BaseType { btName :: BaseTypeName }-  | ReferenceType { rtName :: Text }-  | ArrayType { atElement :: Type }-  | MapType { mKey :: Type, mValue :: Type }-  | AndType { aItems :: NE.NonEmpty Type }-  | OrType { oItems :: NE.NonEmpty Type }-  | TupleType { tItems :: [Type] }-  | StructureLiteralType { stlValue :: StructureLiteral }-  | StringLiteralType { slValue :: Text }-  | IntegerLiteralType { ilValue :: Integer }-  | BooleanLiteralType { blValue :: Bool }+data Type+  = BaseType {btName :: BaseTypeName}+  | ReferenceType {rtName :: Text}+  | ArrayType {atElement :: Type}+  | MapType {mKey :: Type, mValue :: Type}+  | AndType {aItems :: NE.NonEmpty Type}+  | OrType {oItems :: NE.NonEmpty Type}+  | TupleType {tItems :: [Type]}+  | StructureLiteralType {stlValue :: StructureLiteral}+  | StringLiteralType {slValue :: Text}+  | IntegerLiteralType {ilValue :: Integer}+  | BooleanLiteralType {blValue :: Bool}   deriving stock (Show, Eq, Ord, Lift)  -- | A request message. data Request = Request-  { method              :: Text-  , params              :: Maybe Type -- typescript says it can be [Type], but it never is so whatever-  , result              :: Type-  , partialResult       :: Maybe Type-  , errorData           :: Maybe Type+  { method :: Text+  , params :: Maybe Type -- typescript says it can be [Type], but it never is so whatever+  , result :: Type+  , partialResult :: Maybe Type+  , errorData :: Maybe Type   , registrationOptions :: Maybe Type-  , messageDirection    :: MessageDirection-  , documentation       :: Maybe Text-  , since               :: Maybe Text-  , proposed            :: Maybe Bool-  , deprecated          :: Maybe Text+  , messageDirection :: MessageDirection+  , documentation :: Maybe Text+  , since :: Maybe Text+  , proposed :: Maybe Bool+  , deprecated :: Maybe Text   }   deriving stock (Show, Eq, Ord, Lift)  -- | A notification message. data Notification = Notification-  { method              :: Text-  , params              :: Maybe Type+  { method :: Text+  , params :: Maybe Type   , registrationOptions :: Maybe Type-  , messageDirection    :: MessageDirection-  , documentation       :: Maybe Text-  , since               :: Maybe Text-  , proposed            :: Maybe Bool-  , deprecated          :: Maybe Text+  , messageDirection :: MessageDirection+  , documentation :: Maybe Text+  , since :: Maybe Text+  , proposed :: Maybe Bool+  , deprecated :: Maybe Text   }   deriving stock (Show, Eq, Ord, Lift)  -- | A structure type. data Structure = Structure-  { name          :: Text-  , extends       :: Maybe [Type]-  , mixins        :: Maybe [Type]-  , properties    :: [Property]+  { name :: Text+  , extends :: Maybe [Type]+  , mixins :: Maybe [Type]+  , properties :: [Property]   , documentation :: Maybe Text-  , since         :: Maybe Text-  , proposed      :: Maybe Bool-  , deprecated    :: Maybe Text+  , since :: Maybe Text+  , proposed :: Maybe Bool+  , deprecated :: Maybe Text   }   deriving stock (Show, Eq, Ord, Lift)  -- | A type alias. data TypeAlias = TypeAlias-  { name          :: Text-  , type_         :: Type+  { name :: Text+  , type_ :: Type   , documentation :: Maybe Text-  , since         :: Maybe Text-  , proposed      :: Maybe Bool-  , deprecated    :: Maybe Text+  , since :: Maybe Text+  , proposed :: Maybe Bool+  , deprecated :: Maybe Text   }   deriving stock (Show, Eq, Ord, Lift) --- | This is just 'string | int' on the typescript side, but--- it's convenient to have a proper type here.+{- | This is just 'string | int' on the typescript side, but+ it's convenient to have a proper type here.+-} data TextOrInteger = T Text | I Integer   deriving stock (Show, Eq, Ord, Lift)  -- | An entry in an enumeration. data EnumerationEntry = EnumerationEntry-  { name          :: Text-  , value         :: TextOrInteger+  { name :: Text+  , value :: TextOrInteger   , documentation :: Maybe Text-  , since         :: Maybe Text-  , proposed      :: Maybe Bool-  , deprecated    :: Maybe Text+  , since :: Maybe Text+  , proposed :: Maybe Bool+  , deprecated :: Maybe Text   }   deriving stock (Show, Eq, Ord, Lift)  -- | An enumeration type. data Enumeration = Enumeration-  { name                 :: Text-  , type_                :: Type-  , values               :: [EnumerationEntry]+  { name :: Text+  , type_ :: Type+  , values :: [EnumerationEntry]   , supportsCustomValues :: Maybe Bool-  , documentation        :: Maybe Text-  , since                :: Maybe Text-  , proposed             :: Maybe Bool-  , deprecated           :: Maybe Text+  , documentation :: Maybe Text+  , since :: Maybe Text+  , proposed :: Maybe Bool+  , deprecated :: Maybe Text   }   deriving stock (Show, Eq, Ord, Lift) @@ -181,73 +183,74 @@  -- | The entire metamodel. data MetaModel = MetaModel-  { metaData      :: MetaData-  , requests      :: [Request]+  { metaData :: MetaData+  , requests :: [Request]   , notifications :: [Notification]-  , structures    :: [Structure]-  , enumerations  :: [Enumeration]-  , typeAliases   :: [TypeAlias]+  , structures :: [Structure]+  , enumerations :: [Enumeration]+  , typeAliases :: [TypeAlias]   }   deriving stock (Show, Eq, Ord, Lift)  -- We need to do some massaging to make sure that we get the right aeson instances for -- these types and can actually parse the incoming data!-$(-  let-      -- "type" is a very common field name, we use "type_" on the Haskell side-      defOpts = defaultOptions{fieldLabelModifier = \case { "type_" -> "type"; x -> x; }}+$( let+    -- "type" is a very common field name, we use "type_" on the Haskell side+    defOpts = defaultOptions{fieldLabelModifier = \case "type_" -> "type"; x -> x} -      propertyInst = JSON.deriveJSON defOpts ''Property-      slInst = JSON.deriveJSON defOpts ''StructureLiteral+    propertyInst = JSON.deriveJSON defOpts ''Property+    slInst = JSON.deriveJSON defOpts ''StructureLiteral -      -- 'BaseType' is a union of strings, so we encode it as an untagged sum with some-      -- mangling of the constructor names-      baseTyNameToTag :: String -> String-      baseTyNameToTag = \case-        "Integer"  -> "integer"-        "UInteger" -> "uinteger"-        "Decimal"  -> "decimal"-        "String"   -> "string"-        "Boolean"  -> "boolean"-        "Null"     -> "null"-        x          -> x-      baseTyNameInst = JSON.deriveJSON (defOpts{sumEncoding=JSON.UntaggedValue, constructorTagModifier=baseTyNameToTag}) ''BaseTypeName+    -- 'BaseType' is a union of strings, so we encode it as an untagged sum with some+    -- mangling of the constructor names+    baseTyNameToTag :: String -> String+    baseTyNameToTag = \case+      "Integer" -> "integer"+      "UInteger" -> "uinteger"+      "Decimal" -> "decimal"+      "String" -> "string"+      "Boolean" -> "boolean"+      "Null" -> "null"+      x -> x+    baseTyNameInst = JSON.deriveJSON (defOpts{sumEncoding = JSON.UntaggedValue, constructorTagModifier = baseTyNameToTag}) ''BaseTypeName -      -- 'Type' is a *tagged* union, but the tag is a string field (sigh), fortunately-      -- aeson can deal with this. Also needs some constructor mangling.-      typeToTag :: String -> String-      typeToTag = \case-        "BaseType"             -> "base"-        "ReferenceType"        -> "reference"-        "ArrayType"            -> "array"-        "MapType"              -> "map"-        "AndType"              -> "and"-        "OrType"               -> "or"-        "TupleType"            -> "tuple"-        "StructureLiteralType" -> "literal"-        "StringLiteralType"    -> "stringLiteral"-        "IntegerLiteralType"   -> "integerLiteral"-        "BooleanLiteralType"   -> "booleanLiteral"-        x                      -> x-      typeOpts = defOpts-        { sumEncoding=JSON.defaultTaggedObject{tagFieldName="kind"}-        , constructorTagModifier=typeToTag-        , fieldLabelModifier= \s -> over _head Char.toLower $ Prelude.dropWhile Char.isLower s+    -- 'Type' is a *tagged* union, but the tag is a string field (sigh), fortunately+    -- aeson can deal with this. Also needs some constructor mangling.+    typeToTag :: String -> String+    typeToTag = \case+      "BaseType" -> "base"+      "ReferenceType" -> "reference"+      "ArrayType" -> "array"+      "MapType" -> "map"+      "AndType" -> "and"+      "OrType" -> "or"+      "TupleType" -> "tuple"+      "StructureLiteralType" -> "literal"+      "StringLiteralType" -> "stringLiteral"+      "IntegerLiteralType" -> "integerLiteral"+      "BooleanLiteralType" -> "booleanLiteral"+      x -> x+    typeOpts =+      defOpts+        { sumEncoding = JSON.defaultTaggedObject{tagFieldName = "kind"}+        , constructorTagModifier = typeToTag+        , fieldLabelModifier = \s -> over _head Char.toLower $ Prelude.dropWhile Char.isLower s         }-      typeInst = JSON.deriveJSON typeOpts ''Type+    typeInst = JSON.deriveJSON typeOpts ''Type -      -- The rest are mostly normal-      reqInst = JSON.deriveJSON defOpts ''Request-      notInst = JSON.deriveJSON defOpts ''Notification-      sInst = JSON.deriveJSON defOpts ''Structure-      taInst = JSON.deriveJSON defOpts ''TypeAlias-      -- TextOrInteger is also an untagged sum-      tiInst = JSON.deriveJSON (defOpts{sumEncoding=UntaggedValue}) ''TextOrInteger-      eeInst = JSON.deriveJSON defOpts ''EnumerationEntry-      eInst = JSON.deriveJSON defOpts ''Enumeration-      mdInst = JSON.deriveJSON defOpts ''MetaData-      mmInst = JSON.deriveJSON defOpts ''MetaModel-  in mconcat <$> sequence [ propertyInst, slInst, baseTyNameInst, typeInst, reqInst, notInst, sInst, taInst, tiInst, eeInst, eInst, mdInst, mmInst ]+    -- The rest are mostly normal+    reqInst = JSON.deriveJSON defOpts ''Request+    notInst = JSON.deriveJSON defOpts ''Notification+    sInst = JSON.deriveJSON defOpts ''Structure+    taInst = JSON.deriveJSON defOpts ''TypeAlias+    -- TextOrInteger is also an untagged sum+    tiInst = JSON.deriveJSON (defOpts{sumEncoding = UntaggedValue}) ''TextOrInteger+    eeInst = JSON.deriveJSON defOpts ''EnumerationEntry+    eInst = JSON.deriveJSON defOpts ''Enumeration+    mdInst = JSON.deriveJSON defOpts ''MetaData+    mmInst = JSON.deriveJSON defOpts ''MetaModel+    in+    mconcat <$> sequence [propertyInst, slInst, baseTyNameInst, typeInst, reqInst, notInst, sInst, taInst, tiInst, eeInst, eInst, mdInst, mmInst]  )  loadMetaModelFromFile :: FilePath -> Q Exp@@ -255,5 +258,5 @@   addDependentFile fp   res <- liftIO $ JSON.eitherDecodeFileStrict' fp   case res of-    Left e   -> fail e+    Left e -> fail e     Right (mm :: MetaModel) -> lift mm
src/Data/IxMap.hs view
@@ -1,16 +1,16 @@-{-# LANGUAGE BangPatterns     #-}+{-# LANGUAGE BangPatterns #-} {-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE RankNTypes       #-}-{-# LANGUAGE TypeFamilies     #-}-{-# LANGUAGE TypeInType       #-}-{-# LANGUAGE ViewPatterns     #-}+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeInType #-}+{-# LANGUAGE ViewPatterns #-}  module Data.IxMap where -import           Data.Kind-import qualified Data.Map.Strict as M-import           Data.Some-import           Unsafe.Coerce+import Data.Kind+import Data.Map.Strict qualified as M+import Data.Some+import Unsafe.Coerce  -- a `compare` b <=> toBase a `compare` toBase b -- toBase (i :: f a) == toBase (j :: f b) <=> a ~ b@@ -18,7 +18,7 @@   type Base f   toBase :: forall a. f a -> Base f -newtype IxMap (k :: a -> Type) (f :: a -> Type) = IxMap { getMap :: M.Map (Base k) (Some f) }+newtype IxMap (k :: a -> Type) (f :: a -> Type) = IxMap {getMap :: M.Map (Base k) (Some f)}  emptyIxMap :: IxMap k f emptyIxMap = IxMap M.empty@@ -32,10 +32,10 @@ lookupIxMap i (IxMap m) =   case M.lookup (toBase i) m of     Just (Some v) -> Just $ unsafeCoerce v-    Nothing       -> Nothing+    Nothing -> Nothing  pickFromIxMap :: IxOrd k => k m -> IxMap k f -> (Maybe (f m), IxMap k f) pickFromIxMap i (IxMap m) =   case M.updateLookupWithKey (\_ _ -> Nothing) (toBase i) m of-    (Nothing,!m')       -> (Nothing,IxMap m')-    (Just (Some k),!m') -> (Just (unsafeCoerce k),IxMap m')+    (Nothing, !m') -> (Nothing, IxMap m')+    (Just (Some k), !m') -> (Just (unsafeCoerce k), IxMap m')
src/Data/Row/Aeson.hs view
@@ -1,13 +1,12 @@-{-# LANGUAGE FlexibleContexts     #-}-{-# LANGUAGE FlexibleInstances    #-}-{-# LANGUAGE ScopedTypeVariables  #-}-{-# LANGUAGE TypeApplications     #-}-{-# LANGUAGE TypeOperators        #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE TypeApplications #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-}- {-# OPTIONS_GHC -Wno-orphans #-} -{-|+{- | This module defines orphan `aeson` instances for `Data.Row`. They differ from the instances in `row-types-aeson` in one crucial respect: they serialise `Nothing` fields by *omitting* them in the resulting object, and parse absent fields as `Nothing`.@@ -18,25 +17,26 @@ -} module Data.Row.Aeson where -import           Data.Aeson-import           Data.Aeson.Types      (Parser, typeMismatch)-import           Data.List             (intercalate)+import Data.Aeson+import Data.Aeson.Types (Parser, typeMismatch)+import Data.List (intercalate) -import           Data.Row-import           Data.Row.Internal-import qualified Data.Row.Records      as Rec+import Data.Row+import Data.Row.Internal+import Data.Row.Records qualified as Rec -import           Data.Bifunctor        (second)-import           Data.Functor.Const-import           Data.Functor.Identity-import           Data.Proxy-import           Data.String+import Data.Bifunctor (second)+import Data.Functor.Const+import Data.Functor.Identity+import Data.Proxy+import Data.String  -- `aeson` does not need such a typeclass because it generates code per-instance -- that handles this, whereas we want to work generically. --- | Serialise a value as an entry in a JSON object. This allows customizing the--- behaviour in the object context, in order to e.g. omit the field.+{- | Serialise a value as an entry in a JSON object. This allows customizing the+ behaviour in the object context, in order to e.g. omit the field.+-} class ToJSONEntry a where   -- We use String so we can use fromString on it to get a key that works   -- in both aeson-1 and aeson-2@@ -45,7 +45,7 @@ instance {-# OVERLAPPING #-} ToJSON a => ToJSONEntry (Maybe a) where   -- Omit Nothing fields   toJSONEntry _ Nothing = mempty-  toJSONEntry k v       = fromString k .= toJSON v+  toJSONEntry k v = fromString k .= toJSON v  instance {-# OVERLAPPABLE #-} ToJSON a => ToJSONEntry a where   toJSONEntry k v = fromString k .= toJSON v@@ -66,33 +66,33 @@   -- Sadly, there appears to be no helper we can use that gives us access to the keys, so I just used metamorph directly   -- adapted from 'eraseWithLabels'   toJSON rc = Object $ getConst $ metamorph @_ @r @ToJSONEntry @(,) @Rec @(Const Object) @Identity Proxy doNil doUncons doCons rc-      where-        doNil :: Rec Empty -> Const Object Empty-        doNil _ = Const mempty-        doUncons-          :: forall l r'-          . (KnownSymbol l)-          => Label l-          -> Rec r'-          -> (Rec (r' .- l), Identity (r' .! l))-        doUncons l = second Identity . lazyUncons l-        doCons-          :: forall l t r'-          . (KnownSymbol l, ToJSONEntry t)-          => Label l-          -> (Const Object r', Identity t)-          -> Const Object (Extend l t r')-        doCons l (Const c, Identity x) = Const $ toJSONEntry (show' l) x <> c+   where+    doNil :: Rec Empty -> Const Object Empty+    doNil _ = Const mempty+    doUncons ::+      forall l r'.+      (KnownSymbol l) =>+      Label l ->+      Rec r' ->+      (Rec (r' .- l), Identity (r' .! l))+    doUncons l = second Identity . lazyUncons l+    doCons ::+      forall l t r'.+      (KnownSymbol l, ToJSONEntry t) =>+      Label l ->+      (Const Object r', Identity t) ->+      Const Object (Extend l t r')+    doCons l (Const c, Identity x) = Const $ toJSONEntry (show' l) x <> c  instance (AllUniqueLabels r, Forall r FromJSONEntry) => FromJSON (Rec r) where   parseJSON (Object o) = do-    r <- Rec.fromLabelsA @FromJSONEntry $ \ l -> do+    r <- Rec.fromLabelsA @FromJSONEntry $ \l -> do       x <- parseJSONEntry o (fromString $ show l)       x `seq` pure x     r `seq` pure r-   parseJSON v = typeMismatch msg v-    where msg = "REC: {" ++ intercalate "," (labels @r @FromJSONEntry) ++ "}"+   where+    msg = "REC: {" ++ intercalate "," (labels @r @FromJSONEntry) ++ "}"  --- Copied from the library, as it's private 
src/Data/Row/Hashable.hs view
@@ -1,18 +1,17 @@-{-# LANGUAGE FlexibleContexts     #-}-{-# LANGUAGE FlexibleInstances    #-}-{-# LANGUAGE ScopedTypeVariables  #-}-{-# LANGUAGE TypeApplications     #-}-{-# LANGUAGE TypeOperators        #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE TypeApplications #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-}- {-# OPTIONS_GHC -Wno-orphans #-}  module Data.Row.Hashable where -import           Data.Hashable+import Data.Hashable -import           Data.Row-import qualified Data.Row.Records      as Rec+import Data.Row+import Data.Row.Records qualified as Rec  instance (Forall r Hashable, Forall r Eq) => Hashable (Rec r) where   hashWithSalt s record = hashWithSalt s (Rec.erase @Hashable (hashWithSalt s) record)
src/Language/LSP/Protocol/Capabilities.hs view
@@ -1,192 +1,211 @@ {-# LANGUAGE DuplicateRecordFields #-}-{-# LANGUAGE OverloadedLabels      #-}-{-# LANGUAGE OverloadedStrings     #-}-module Language.LSP.Protocol.Capabilities-  (-    fullCaps-  , LSPVersion(..)-  , capsForVersion-  ) where+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE OverloadedLabels #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RankNTypes #-} -import           Data.Row-import qualified Data.Set                          as Set-import           Language.LSP.Protocol.Types-import           Prelude                           hiding (min)+module Language.LSP.Protocol.Capabilities (+  fullCaps,+  LSPVersion (..),+  capsForVersion,+  dynamicRegistrationSupported,+) where +import Control.Lens+import Data.Maybe+import Data.Row+import Data.Set qualified as Set+import Language.LSP.Protocol.Lens qualified as L+import Language.LSP.Protocol.Message+import Language.LSP.Protocol.Types+import Prelude hiding (min)+ {- TODO: this is out-of-date/needs an audit TODO: can we generate this? process the 'since' annotations in the metamodel? -} --- | Capabilities for full conformance to the current (v3.15) LSP specification.+-- | Capabilities for full conformance to the current LSP specification. fullCaps :: ClientCapabilities fullCaps = capsForVersion (LSPVersion maxBound maxBound)  -- | A specific version of the LSP specification.-data LSPVersion = LSPVersion Int Int -- ^ Construct a major.minor version+data LSPVersion = LSPVersion Int Int  -- | 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 maj min) = caps-  where-    caps = ClientCapabilities {-      _workspace=Just w-      , _textDocument=Just td-      , _window=Just window-      , _general=since 3 16 general-      , _experimental=Nothing-      -- TODO-      , _notebookDocument=Nothing+ where+  caps =+    ClientCapabilities+      { _workspace = Just w+      , _textDocument = Just td+      , _window = Just window+      , _general = since 3 16 general+      , _notebookDocument = since 3 17 $ NotebookDocumentClientCapabilities $ NotebookDocumentSyncClientCapabilities dynamicReg (Just True)+      , _experimental = Nothing       }-    w = WorkspaceClientCapabilities {-      _applyEdit = Just True-      , _workspaceEdit = Just (WorkspaceEditClientCapabilities-                  (Just True)-                  (since 3 13 resourceOperations)-                  Nothing-                  (since 3 16 True)-                  (since 3 16 (#groupsOnLabel .== Just True)))+  w =+    WorkspaceClientCapabilities+      { _applyEdit = Just True+      , _workspaceEdit =+          Just+            ( WorkspaceEditClientCapabilities+                (Just True)+                (since 3 13 resourceOperations)+                Nothing+                (since 3 16 True)+                (since 3 16 (#groupsOnLabel .== Just True))+            )       , _didChangeConfiguration = Just (DidChangeConfigurationClientCapabilities dynamicReg)       , _didChangeWatchedFiles = Just (DidChangeWatchedFilesClientCapabilities dynamicReg (Just True))       , _symbol = Just symbolCapabilities       , _executeCommand = Just (ExecuteCommandClientCapabilities dynamicReg)+      , _codeLens = Just (CodeLensWorkspaceClientCapabilities $ Just True)       , _workspaceFolders = since 3 6 True       , _configuration = since 3 6 True       , _semanticTokens = since 3 16 (SemanticTokensWorkspaceClientCapabilities $ Just True)-      -- TODO-      , _codeLens = Nothing-      , _fileOperations = Nothing-      , _inlineValue = Nothing-      , _inlayHint = Nothing-      , _diagnostics = Nothing+      , _inlayHint = since 3 17 (InlayHintWorkspaceClientCapabilities $ Just True)+      , _fileOperations = since 3 16 fileOperations+      , _inlineValue = since 3 17 (InlineValueWorkspaceClientCapabilities $ Just True)+      , _diagnostics = since 3 17 (DiagnosticWorkspaceClientCapabilities $ Just True)       } -    resourceOperations =-      [ ResourceOperationKind_Create-      , ResourceOperationKind_Delete-      , ResourceOperationKind_Rename-      ]+  resourceOperations =+    [ ResourceOperationKind_Create+    , ResourceOperationKind_Delete+    , ResourceOperationKind_Rename+    ] -    symbolCapabilities = WorkspaceSymbolClientCapabilities+  fileOperations =+    FileOperationClientCapabilities       dynamicReg+      (Just True)+      (Just True)+      (Just True)+      (Just True)+      (Just True)+      (Just True)++  symbolCapabilities =+    WorkspaceSymbolClientCapabilities+      dynamicReg       (since 3 4 (#valueSet .== Just sKs))       (since 3 16 (#valueSet .== [SymbolTag_Deprecated]))       (since 3 17 (#properties .== [])) -    sKs-      | maj >= 3 && min >= 4 = oldSKs ++ newSKs-      | otherwise            = oldSKs+  sKs+    | maj >= 3 && min >= 4 = oldSKs ++ newSKs+    | otherwise = oldSKs -    oldSKs =   [ SymbolKind_File-               , SymbolKind_Module-               , SymbolKind_Namespace-               , SymbolKind_Package-               , SymbolKind_Class-               , SymbolKind_Method-               , SymbolKind_Property-               , SymbolKind_Field-               , SymbolKind_Constructor-               , SymbolKind_Enum-               , SymbolKind_Interface-               , SymbolKind_Function-               , SymbolKind_Variable-               , SymbolKind_Constant-               , SymbolKind_String-               , SymbolKind_Number-               , SymbolKind_Boolean-               , SymbolKind_Array-               ]+  oldSKs =+    [ SymbolKind_File+    , SymbolKind_Module+    , SymbolKind_Namespace+    , SymbolKind_Package+    , SymbolKind_Class+    , SymbolKind_Method+    , SymbolKind_Property+    , SymbolKind_Field+    , SymbolKind_Constructor+    , SymbolKind_Enum+    , SymbolKind_Interface+    , SymbolKind_Function+    , SymbolKind_Variable+    , SymbolKind_Constant+    , SymbolKind_String+    , SymbolKind_Number+    , SymbolKind_Boolean+    , SymbolKind_Array+    ] -    newSKs = [ SymbolKind_Object-             , SymbolKind_Key-             , SymbolKind_Null-             , SymbolKind_EnumMember-             , SymbolKind_Struct-             , SymbolKind_Event-             , SymbolKind_Operator-             , SymbolKind_TypeParameter-             ]+  newSKs =+    [ SymbolKind_Object+    , SymbolKind_Key+    , SymbolKind_Null+    , SymbolKind_EnumMember+    , SymbolKind_Struct+    , SymbolKind_Event+    , SymbolKind_Operator+    , SymbolKind_TypeParameter+    ] -    -- Only one token format for now, just list it here-    tfs = [ TokenFormat_Relative ]+  -- Only one token format for now, just list it here+  tfs = [TokenFormat_Relative] -    semanticTokensCapabilities = SemanticTokensClientCapabilities {-        _dynamicRegistration=Just True-        , _requests= #range .== Just (InL True) .+ #full .== Just (InR (#delta .== Just True))-        , _tokenTypes=toEnumBaseType <$> Set.toList (knownValues @SemanticTokenTypes)-        , _tokenModifiers=toEnumBaseType <$> Set.toList (knownValues @SemanticTokenModifiers)-        , _formats=tfs-        , _overlappingTokenSupport=Just True-        , _multilineTokenSupport=Just True-        , _serverCancelSupport=Just True-        , _augmentsSyntaxTokens=Just True+  semanticTokensCapabilities =+    SemanticTokensClientCapabilities+      { _dynamicRegistration = Just True+      , _requests = #range .== Just (InL True) .+ #full .== Just (InR (#delta .== Just True))+      , _tokenTypes = toEnumBaseType <$> Set.toList (knownValues @SemanticTokenTypes)+      , _tokenModifiers = toEnumBaseType <$> Set.toList (knownValues @SemanticTokenModifiers)+      , _formats = tfs+      , _overlappingTokenSupport = Just True+      , _multilineTokenSupport = Just True+      , _serverCancelSupport = Just True+      , _augmentsSyntaxTokens = Just True       } -    td = TextDocumentClientCapabilities {-          _synchronization=Just sync-          , _completion=Just completionCapability-          , _hover=Just hoverCapability-          , _signatureHelp=Just signatureHelpCapability-          , _references=Just (ReferenceClientCapabilities dynamicReg)-          , _documentHighlight=Just (DocumentHighlightClientCapabilities dynamicReg)-          , _documentSymbol=Just documentSymbolCapability-          , _formatting=Just (DocumentFormattingClientCapabilities dynamicReg)-          , _rangeFormatting=Just (DocumentRangeFormattingClientCapabilities dynamicReg)-          , _onTypeFormatting=Just (DocumentOnTypeFormattingClientCapabilities dynamicReg)-          , _declaration=since 3 14 (DeclarationClientCapabilities dynamicReg (Just True))-          , _definition=Just (DefinitionClientCapabilities dynamicReg (since 3 14 True))-          , _typeDefinition=since 3 6 (TypeDefinitionClientCapabilities dynamicReg (since 3 14 True))-          , _implementation=since 3 6 (ImplementationClientCapabilities dynamicReg (since 3 14 True))-          , _codeAction=Just codeActionCapability-          , _codeLens=Just (CodeLensClientCapabilities dynamicReg)-          , _documentLink=Just (DocumentLinkClientCapabilities dynamicReg (since 3 15 True))-          , _colorProvider=since 3 6 (DocumentColorClientCapabilities dynamicReg)-          , _rename=Just (RenameClientCapabilities dynamicReg (since 3 12 True) (since 3 16 PrepareSupportDefaultBehavior_Identifier) (since 3 16 True))-          , _publishDiagnostics=Just publishDiagnosticsCapabilities-          , _foldingRange=since 3 10 foldingRangeCapability-          , _selectionRange=since 3 5 (SelectionRangeClientCapabilities dynamicReg)-          , _callHierarchy=since 3 16 (CallHierarchyClientCapabilities dynamicReg)-          , _semanticTokens=since 3 16 semanticTokensCapabilities-          -- TODO-          , _linkedEditingRange=Nothing-          , _moniker=Nothing-          , _typeHierarchy=Nothing-          , _inlineValue=Nothing-          , _inlayHint=Nothing-          , _diagnostic=Nothing-        }+  td =+    TextDocumentClientCapabilities+      { _synchronization = Just sync+      , _completion = Just completionCapability+      , _hover = Just hoverCapability+      , _signatureHelp = Just signatureHelpCapability+      , _references = Just (ReferenceClientCapabilities dynamicReg)+      , _documentHighlight = Just (DocumentHighlightClientCapabilities dynamicReg)+      , _documentSymbol = Just documentSymbolCapability+      , _formatting = Just (DocumentFormattingClientCapabilities dynamicReg)+      , _rangeFormatting = Just (DocumentRangeFormattingClientCapabilities dynamicReg)+      , _onTypeFormatting = Just (DocumentOnTypeFormattingClientCapabilities dynamicReg)+      , _declaration = since 3 14 (DeclarationClientCapabilities dynamicReg (Just True))+      , _definition = Just (DefinitionClientCapabilities dynamicReg (since 3 14 True))+      , _typeDefinition = since 3 6 (TypeDefinitionClientCapabilities dynamicReg (since 3 14 True))+      , _implementation = since 3 6 (ImplementationClientCapabilities dynamicReg (since 3 14 True))+      , _codeAction = Just codeActionCapability+      , _codeLens = Just (CodeLensClientCapabilities dynamicReg)+      , _documentLink = Just (DocumentLinkClientCapabilities dynamicReg (since 3 15 True))+      , _colorProvider = since 3 6 (DocumentColorClientCapabilities dynamicReg)+      , _rename = Just (RenameClientCapabilities dynamicReg (since 3 12 True) (since 3 16 PrepareSupportDefaultBehavior_Identifier) (since 3 16 True))+      , _publishDiagnostics = Just publishDiagnosticsCapabilities+      , _foldingRange = since 3 10 foldingRangeCapability+      , _selectionRange = since 3 5 (SelectionRangeClientCapabilities dynamicReg)+      , _callHierarchy = since 3 16 (CallHierarchyClientCapabilities dynamicReg)+      , _semanticTokens = since 3 16 semanticTokensCapabilities+      , _linkedEditingRange = since 3 16 (LinkedEditingRangeClientCapabilities dynamicReg)+      , _moniker = since 3 16 (MonikerClientCapabilities dynamicReg)+      , _inlayHint = since 3 17 inlayHintCapabilities+      , _typeHierarchy = since 3 17 (TypeHierarchyClientCapabilities dynamicReg)+      , _inlineValue = since 3 17 (InlineValueClientCapabilities dynamicReg)+      , _diagnostic = since 3 17 (DiagnosticClientCapabilities dynamicReg (Just True))+      } -    sync =-      TextDocumentSyncClientCapabilities {-        _dynamicRegistration=dynamicReg-        , _willSave=Just True-        , _willSaveWaitUntil=Just True-        , _didSave=Just True-        }+  sync =+    TextDocumentSyncClientCapabilities+      { _dynamicRegistration = dynamicReg+      , _willSave = Just True+      , _willSaveWaitUntil = Just True+      , _didSave = Just True+      } -    completionCapability =-      CompletionClientCapabilities{-        _dynamicRegistration=dynamicReg-        , _completionItem=Just completionItemCapabilities-        , _completionItemKind=since 3 4 (#valueSet .== Just ciKs)-        , _insertTextMode=since 3 17 InsertTextMode_AsIs-        , _contextSupport=since 3 3 True-        , _completionList=since 3 17 (#itemDefaults .== Just [])-        }+  completionCapability =+    CompletionClientCapabilities+      { _dynamicRegistration = dynamicReg+      , _completionItem = Just completionItemCapabilities+      , _completionItemKind = since 3 4 (#valueSet .== Just ciKs)+      , _insertTextMode = since 3 17 InsertTextMode_AsIs+      , _contextSupport = since 3 3 True+      , _completionList = since 3 17 (#itemDefaults .== Just [])+      } -    completionItemCapabilities =-      #snippetSupport .== Just True+  inlayHintCapabilities =+    InlayHintClientCapabilities+      { _dynamicRegistration = dynamicReg+      , _resolveSupport = Just (#properties .== [])+      }++  completionItemCapabilities =+    #snippetSupport .== Just True       .+ #commitCharactersSupport .== Just True       .+ #documentationFormat .== since 3 3 allMarkups       .+ #deprecatedSupport .== Just True@@ -197,112 +216,170 @@       .+ #insertTextModeSupport .== since 3 16 (#valueSet .== [])       .+ #labelDetailsSupport .== since 3 17 True -    ciKs-      | maj >= 3 && min >= 4 = oldCiKs ++ newCiKs-      | otherwise            = oldCiKs+  ciKs+    | maj >= 3 && min >= 4 = oldCiKs ++ newCiKs+    | otherwise = oldCiKs -    oldCiKs =   [ CompletionItemKind_Text-                , CompletionItemKind_Method-                , CompletionItemKind_Function-                , CompletionItemKind_Constructor-                , CompletionItemKind_Field-                , CompletionItemKind_Variable-                , CompletionItemKind_Class-                , CompletionItemKind_Interface-                , CompletionItemKind_Module-                , CompletionItemKind_Property-                , CompletionItemKind_Unit-                , CompletionItemKind_Value-                , CompletionItemKind_Enum-                , CompletionItemKind_Keyword-                , CompletionItemKind_Snippet-                , CompletionItemKind_Color-                , CompletionItemKind_File-                , CompletionItemKind_Reference-                ]+  oldCiKs =+    [ CompletionItemKind_Text+    , CompletionItemKind_Method+    , CompletionItemKind_Function+    , CompletionItemKind_Constructor+    , CompletionItemKind_Field+    , CompletionItemKind_Variable+    , CompletionItemKind_Class+    , CompletionItemKind_Interface+    , CompletionItemKind_Module+    , CompletionItemKind_Property+    , CompletionItemKind_Unit+    , CompletionItemKind_Value+    , CompletionItemKind_Enum+    , CompletionItemKind_Keyword+    , CompletionItemKind_Snippet+    , CompletionItemKind_Color+    , CompletionItemKind_File+    , CompletionItemKind_Reference+    ] -    newCiKs =   [ CompletionItemKind_Folder-                , CompletionItemKind_EnumMember-                , CompletionItemKind_Constant-                , CompletionItemKind_Struct-                , CompletionItemKind_Event-                , CompletionItemKind_Operator-                , CompletionItemKind_TypeParameter-                ]+  newCiKs =+    [ CompletionItemKind_Folder+    , CompletionItemKind_EnumMember+    , CompletionItemKind_Constant+    , CompletionItemKind_Struct+    , CompletionItemKind_Event+    , CompletionItemKind_Operator+    , CompletionItemKind_TypeParameter+    ] -    hoverCapability =-      HoverClientCapabilities {-        _dynamicRegistration=dynamicReg-        , _contentFormat=since 3 3 allMarkups+  hoverCapability =+    HoverClientCapabilities+      { _dynamicRegistration = dynamicReg+      , _contentFormat = since 3 3 allMarkups       } -    codeActionCapability-      = CodeActionClientCapabilities {-          _dynamicRegistration=dynamicReg-          , _codeActionLiteralSupport=since 3 8 (#codeActionKind .== (#valueSet .== Set.toList knownValues))-          , _isPreferredSupport=since 3 15 True-          , _disabledSupport=since 3 16 True-          , _dataSupport=since 3 16 True-          , _resolveSupport=since 3 16 (#properties .== [])-          , _honorsChangeAnnotations=since 3 16 True-        }+  codeActionCapability =+    CodeActionClientCapabilities+      { _dynamicRegistration = dynamicReg+      , _codeActionLiteralSupport = since 3 8 (#codeActionKind .== (#valueSet .== Set.toList knownValues))+      , _isPreferredSupport = since 3 15 True+      , _disabledSupport = since 3 16 True+      , _dataSupport = since 3 16 True+      , _resolveSupport = since 3 16 (#properties .== [])+      , _honorsChangeAnnotations = since 3 16 True+      } -    signatureHelpCapability =-      SignatureHelpClientCapabilities {-        _dynamicRegistration=dynamicReg-        , _signatureInformation=Just (#documentationFormat .== Just allMarkups .+ #parameterInformation .== Just (#labelOffsetSupport .== Just True) .+ #activeParameterSupport .== Just True)-        , _contextSupport=since 3 16 True+  signatureHelpCapability =+    SignatureHelpClientCapabilities+      { _dynamicRegistration = dynamicReg+      , _signatureInformation = Just (#documentationFormat .== Just allMarkups .+ #parameterInformation .== Just (#labelOffsetSupport .== Just True) .+ #activeParameterSupport .== Just True)+      , _contextSupport = since 3 16 True       } -    documentSymbolCapability =-      DocumentSymbolClientCapabilities {-        _dynamicRegistration=dynamicReg-        -- same as workspace symbol kinds-        , _symbolKind=Just (#valueSet .== Just sKs)-        , _hierarchicalDocumentSymbolSupport=since 3 10 True-        , _tagSupport=since 3 16 (#valueSet .== [SymbolTag_Deprecated])-        , _labelSupport=since 3 16 True+  documentSymbolCapability =+    DocumentSymbolClientCapabilities+      { _dynamicRegistration = dynamicReg+      , -- same as workspace symbol kinds+        _symbolKind = Just (#valueSet .== Just sKs)+      , _hierarchicalDocumentSymbolSupport = since 3 10 True+      , _tagSupport = since 3 16 (#valueSet .== [SymbolTag_Deprecated])+      , _labelSupport = since 3 16 True       } -    foldingRangeCapability =-      FoldingRangeClientCapabilities {-        _dynamicRegistration=dynamicReg-        , _rangeLimit=Nothing-        , _lineFoldingOnly=Nothing-        , _foldingRangeKind=since 3 17 (#valueSet .== Just [])-        , _foldingRange=since 3 16 (#collapsedText .== Just True)+  foldingRangeCapability =+    FoldingRangeClientCapabilities+      { _dynamicRegistration = dynamicReg+      , _rangeLimit = Nothing+      , _lineFoldingOnly = Nothing+      , _foldingRangeKind = since 3 17 (#valueSet .== Just [])+      , _foldingRange = since 3 16 (#collapsedText .== Just True)       } -    publishDiagnosticsCapabilities =-      PublishDiagnosticsClientCapabilities {-        _relatedInformation=since 3 7 True-        , _tagSupport=since 3 15 (#valueSet .== [ DiagnosticTag_Unnecessary, DiagnosticTag_Deprecated ])-        , _versionSupport=since 3 15 True-        , _codeDescriptionSupport=since 3 16 True-        , _dataSupport=since 3 16 True+  publishDiagnosticsCapabilities =+    PublishDiagnosticsClientCapabilities+      { _relatedInformation = since 3 7 True+      , _tagSupport = since 3 15 (#valueSet .== [DiagnosticTag_Unnecessary, DiagnosticTag_Deprecated])+      , _versionSupport = since 3 15 True+      , _codeDescriptionSupport = since 3 16 True+      , _dataSupport = since 3 16 True       } -    dynamicReg-      | maj >= 3  = Just True-      | otherwise = Nothing-    since :: Int -> Int -> a -> Maybe a-    since x y a-      | maj >= x && min >= y = Just a-      | otherwise            = Nothing+  dynamicReg+    | maj >= 3 = Just True+    | otherwise = Nothing+  since :: Int -> Int -> a -> Maybe a+  since x y a+    | maj >= x && min >= y = Just a+    | otherwise = Nothing -    window =-      WindowClientCapabilities {-        _workDoneProgress=since 3 15 True-        , _showMessage=since 3 16 $ ShowMessageRequestClientCapabilities Nothing-        , _showDocument=since 3 16 $ ShowDocumentClientCapabilities True+  window =+    WindowClientCapabilities+      { _workDoneProgress = since 3 15 True+      , _showMessage = since 3 16 $ ShowMessageRequestClientCapabilities Nothing+      , _showDocument = since 3 16 $ ShowDocumentClientCapabilities True       } -    general = GeneralClientCapabilities {-      _staleRequestSupport=since 3 16 (#cancel .== True .+ #retryOnContentModified .== [])-      , _regularExpressions=since 3 16 $ RegularExpressionsClientCapabilities "" Nothing-      , _markdown=since 3 16 $ MarkdownClientCapabilities "" Nothing (Just [])-      -- TODO-      , _positionEncodings=Nothing+  general =+    GeneralClientCapabilities+      { _staleRequestSupport = since 3 16 (#cancel .== True .+ #retryOnContentModified .== [])+      , _regularExpressions = since 3 16 $ RegularExpressionsClientCapabilities "" Nothing+      , _markdown = since 3 16 $ MarkdownClientCapabilities "" Nothing (Just [])+      , _positionEncodings = since 3 17 [PositionEncodingKind_UTF16]       } -    allMarkups = [MarkupKind_PlainText, MarkupKind_Markdown]+  allMarkups = [MarkupKind_PlainText, MarkupKind_Markdown]++-- | Whether the client supports dynamic registration for the given method.+dynamicRegistrationSupported :: SMethod m -> ClientCapabilities -> Bool+dynamicRegistrationSupported method caps = fromMaybe False $ case method of+  SMethod_WorkspaceDidChangeConfiguration -> caps ^? ws . L.didChangeConfiguration . _Just . dyn+  SMethod_WorkspaceDidChangeWatchedFiles -> caps ^? ws . L.didChangeWatchedFiles . _Just . dyn+  SMethod_WorkspaceSymbol -> caps ^? ws . L.symbol . _Just . dyn+  SMethod_WorkspaceExecuteCommand -> caps ^? ws . L.executeCommand . _Just . dyn+  SMethod_WorkspaceWillCreateFiles -> caps ^? ws . L.fileOperations . _Just . dyn+  SMethod_WorkspaceDidCreateFiles -> caps ^? ws . L.fileOperations . _Just . dyn+  SMethod_WorkspaceWillDeleteFiles -> caps ^? ws . L.fileOperations . _Just . dyn+  SMethod_WorkspaceDidDeleteFiles -> caps ^? ws . L.fileOperations . _Just . dyn+  SMethod_TextDocumentDidOpen -> caps ^? td . L.synchronization . _Just . dyn+  SMethod_TextDocumentDidChange -> caps ^? td . L.synchronization . _Just . dyn+  SMethod_TextDocumentDidClose -> caps ^? td . L.synchronization . _Just . dyn+  SMethod_TextDocumentCompletion -> caps ^? td . L.completion . _Just . dyn+  SMethod_TextDocumentHover -> caps ^? td . L.hover . _Just . dyn+  SMethod_TextDocumentSignatureHelp -> caps ^? td . L.signatureHelp . _Just . dyn+  SMethod_TextDocumentDeclaration -> caps ^? td . L.declaration . _Just . dyn+  SMethod_TextDocumentDefinition -> caps ^? td . L.definition . _Just . dyn+  SMethod_TextDocumentTypeDefinition -> caps ^? td . L.typeDefinition . _Just . dyn+  SMethod_TextDocumentImplementation -> caps ^? td . L.implementation . _Just . dyn+  SMethod_TextDocumentReferences -> caps ^? td . L.references . _Just . dyn+  SMethod_TextDocumentDocumentHighlight -> caps ^? td . L.documentHighlight . _Just . dyn+  SMethod_TextDocumentDocumentSymbol -> caps ^? td . L.documentSymbol . _Just . dyn+  SMethod_TextDocumentCodeAction -> caps ^? td . L.codeAction . _Just . dyn+  SMethod_TextDocumentCodeLens -> caps ^? td . L.codeLens . _Just . dyn+  SMethod_TextDocumentDocumentLink -> caps ^? td . L.documentLink . _Just . dyn+  SMethod_TextDocumentDocumentColor -> caps ^? td . L.colorProvider . _Just . dyn+  SMethod_TextDocumentColorPresentation -> caps ^? td . L.colorProvider . _Just . dyn+  SMethod_TextDocumentFormatting -> caps ^? td . L.formatting . _Just . dyn+  SMethod_TextDocumentRangeFormatting -> caps ^? td . L.rangeFormatting . _Just . dyn+  SMethod_TextDocumentOnTypeFormatting -> caps ^? td . L.onTypeFormatting . _Just . dyn+  SMethod_TextDocumentRename -> caps ^? td . L.rename . _Just . dyn+  SMethod_TextDocumentFoldingRange -> caps ^? td . L.foldingRange . _Just . dyn+  SMethod_TextDocumentSelectionRange -> caps ^? td . L.selectionRange . _Just . dyn+  SMethod_TextDocumentLinkedEditingRange -> caps ^? td . L.linkedEditingRange . _Just . dyn+  SMethod_TextDocumentPrepareCallHierarchy -> caps ^? td . L.callHierarchy . _Just . dyn+  SMethod_TextDocumentInlayHint -> caps ^? td . L.inlayHint . _Just . dyn+  SMethod_TextDocumentInlineValue -> caps ^? td . L.inlineValue . _Just . dyn+  SMethod_TextDocumentMoniker -> caps ^? td . L.moniker . _Just . dyn+  SMethod_TextDocumentPrepareTypeHierarchy -> caps ^? td . L.typeHierarchy . _Just . dyn+  SMethod_TextDocumentDiagnostic -> caps ^? td . L.diagnostic . _Just . dyn+  -- semantic tokens is messed up due to it having you register with an otherwise non-existent method+  -- SMethod_TextDocumentSemanticTokens       -> capDyn $ clientCaps ^? L.textDocument . _Just . L.semanticTokens . _Just+  -- Notebook document methods alway support dynamic registration, it seems?+  _ -> Just False+ where+  td :: Traversal' ClientCapabilities TextDocumentClientCapabilities+  td = L.textDocument . _Just++  ws :: Traversal' ClientCapabilities WorkspaceClientCapabilities+  ws = L.workspace . _Just++  dyn :: L.HasDynamicRegistration a (Maybe Bool) => Traversal' a Bool+  dyn = L.dynamicRegistration . _Just
src/Language/LSP/Protocol/Lens.hs view
@@ -1,11 +1,11 @@- module Language.LSP.Protocol.Lens (   -- * Generated lens classes-    module Lens+  module Lens,   -- Custom lets classes for Type-  , module TypesLens+  module TypesLens,   -- Custom lens classes for Message-  , module MessageLens) where+  module MessageLens,+) where  import Language.LSP.Protocol.Internal.Lens as Lens import Language.LSP.Protocol.Message.Lens as MessageLens
src/Language/LSP/Protocol/Message.hs view
@@ -1,19 +1,25 @@ module Language.LSP.Protocol.Message (   -- * Messages+   -- ** LSP protocol message types and metadata-  module Message-  , module LspId-  , module Meta+  module Message,+  module LspId,+  module Meta,+   -- ** Parsing LSP messages-  , module Parsing+  module Parsing,+   -- * Methods+   -- ** Main LSP method types and functions-  , module Generated+  module Generated,+   -- ** Helpers for working with methods-  , module Method+  module Method,+   -- * LSP registrations-  , module Registration-  ) where+  module Registration,+) where  import Language.LSP.Protocol.Internal.Method as Generated import Language.LSP.Protocol.Message.LspId as LspId
src/Language/LSP/Protocol/Message/Lens.hs view
@@ -1,12 +1,12 @@-{-#LANGUAGE TemplateHaskell #-}+{-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -Wno-orphans #-}  module Language.LSP.Protocol.Message.Lens where +import Control.Lens.TH import Language.LSP.Protocol.Internal.Lens import Language.LSP.Protocol.Message.Registration import Language.LSP.Protocol.Message.Types-import           Control.Lens.TH  makeFieldsNoPrefix ''TRegistration makeFieldsNoPrefix ''TUnregistration
src/Language/LSP/Protocol/Message/LspId.hs view
@@ -1,30 +1,31 @@ {-# LANGUAGE TypeInType #-}+ module Language.LSP.Protocol.Message.LspId where -import qualified Data.Aeson                         as A-import           Data.Hashable-import           Data.IxMap-import           Data.Text                          (Text)-import           GHC.Generics-import           Prettyprinter+import Data.Aeson qualified as A+import Data.Hashable+import Data.IxMap+import Data.Text (Text)+import GHC.Generics+import Prettyprinter -import           Language.LSP.Protocol.Types.Common-import           Language.LSP.Protocol.Internal.Method-import           Language.LSP.Protocol.Message.Meta-import           Language.LSP.Protocol.Utils.Misc+import Language.LSP.Protocol.Internal.Method+import Language.LSP.Protocol.Message.Meta+import Language.LSP.Protocol.Types.Common+import Language.LSP.Protocol.Utils.Misc  -- | Id used for a request, Can be either a String or an Int data LspId (m :: Method f Request) = IdInt !Int32 | IdString !Text-  deriving stock (Show,Read,Eq,Ord,Generic)+  deriving stock (Show, Read, Eq, Ord, Generic)  instance A.ToJSON (LspId m) where-  toJSON (IdInt i)    = A.toJSON i+  toJSON (IdInt i) = A.toJSON i   toJSON (IdString s) = A.toJSON s  instance A.FromJSON (LspId m) where   parseJSON v@(A.Number _) = IdInt <$> A.parseJSON v-  parseJSON  (A.String  s) = return (IdString s)-  parseJSON _              = fail "LspId"+  parseJSON (A.String s) = return (IdString s)+  parseJSON _ = fail "LspId"  deriving via ViaJSON (LspId m) instance Pretty (LspId m) @@ -33,7 +34,7 @@   toBase = SomeLspId  instance Hashable (LspId m) where-  hashWithSalt n (IdInt i)    = hashWithSalt n i+  hashWithSalt n (IdInt i) = hashWithSalt n i   hashWithSalt n (IdString t) = hashWithSalt n t  data SomeLspId where@@ -41,16 +42,16 @@  deriving stock instance Show SomeLspId instance Eq SomeLspId where-  SomeLspId (IdInt a) == SomeLspId (IdInt b)       = a == b+  SomeLspId (IdInt a) == SomeLspId (IdInt b) = a == b   SomeLspId (IdString a) == SomeLspId (IdString b) = a == b-  _ == _                                           = False+  _ == _ = False instance Ord SomeLspId where   compare (SomeLspId x) (SomeLspId y) = go x y-    where-      go (IdInt    a) (IdInt    b) = a `compare` b-      go (IdString a) (IdString b) = a `compare` b-      go (IdInt    _) (IdString _) = LT-      go (IdString _) (IdInt    _) = GT+   where+    go (IdInt a) (IdInt b) = a `compare` b+    go (IdString a) (IdString b) = a `compare` b+    go (IdInt _) (IdString _) = LT+    go (IdString _) (IdInt _) = GT  instance Hashable SomeLspId where   hashWithSalt n (SomeLspId lspId) = hashWithSalt n lspId
src/Language/LSP/Protocol/Message/Meta.hs view
@@ -2,6 +2,7 @@  -- | Which direction messages are sent in. data MessageDirection = ServerToClient | ClientToServer+ -- | What kind of message is sent. data MessageKind = Notification | Request 
src/Language/LSP/Protocol/Message/Method.hs view
@@ -1,31 +1,34 @@-{-# LANGUAGE ConstraintKinds         #-}-{-# LANGUAGE FlexibleContexts        #-}-{-# LANGUAGE LambdaCase              #-}-{-# LANGUAGE MagicHash               #-}-{-# LANGUAGE QuantifiedConstraints   #-}-{-# LANGUAGE RankNTypes              #-}-{-# LANGUAGE TemplateHaskell         #-}-{-# LANGUAGE TypeInType              #-}-{-# LANGUAGE TypeOperators           #-}+{-# LANGUAGE ConstraintKinds #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE MagicHash #-}+{-# LANGUAGE QuantifiedConstraints #-}+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE TypeInType #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableSuperClasses #-}- {-# OPTIONS_GHC -Wno-orphans #-}+ module Language.LSP.Protocol.Message.Method where -import           Data.Aeson.Types-import           Data.Function                      (on)-import           Data.List                          (isPrefixOf)-import           Data.GADT.Compare-import           Data.Proxy-import           Data.Type.Equality-import           GHC.Exts                           (Int (..), dataToTag#)-import           GHC.TypeLits                       (KnownSymbol, sameSymbol,-                                                     symbolVal)-import           Language.LSP.Protocol.Internal.Method-import           Language.LSP.Protocol.Message.Meta-import           Language.LSP.Protocol.Utils.Misc-import           Prettyprinter-import           Unsafe.Coerce+import Data.Aeson.Types+import Data.Function (on)+import Data.GADT.Compare+import Data.List (isPrefixOf)+import Data.Proxy+import Data.Type.Equality+import GHC.Exts (Int (..), dataToTag#)+import GHC.TypeLits (+  KnownSymbol,+  sameSymbol,+  symbolVal,+ )+import Language.LSP.Protocol.Internal.Method+import Language.LSP.Protocol.Message.Meta+import Language.LSP.Protocol.Utils.Misc+import Prettyprinter+import Unsafe.Coerce  --------------- -- SomeMethod@@ -99,7 +102,7 @@     case sm of       SomeMethod (SMethod_CustomMethod x) -> case sameSymbol x (Proxy :: Proxy s) of         Just Refl -> pure $ SMethod_CustomMethod x-        Nothing   -> mempty+        Nothing -> mempty       _ -> mempty  -- TODO: generate these with everything else?@@ -125,24 +128,24 @@  someClientMethod :: SMethod m -> Maybe SomeClientMethod someClientMethod s = case messageDirection s of-    SClientToServer -> Just $ SomeClientMethod s-    SServerToClient -> Nothing-    -- See Note [Parsing methods that go both ways]-    SBothDirections -> Just $ SomeClientMethod $ unsafeCoerce s+  SClientToServer -> Just $ SomeClientMethod s+  SServerToClient -> Nothing+  -- See Note [Parsing methods that go both ways]+  SBothDirections -> Just $ SomeClientMethod $ unsafeCoerce s  someServerMethod :: SMethod m -> Maybe SomeServerMethod someServerMethod s = case messageDirection s of-    SServerToClient-> Just $ SomeServerMethod s-    SClientToServer -> Nothing-    -- See Note [Parsing methods that go both ways]-    SBothDirections -> Just $ SomeServerMethod $ unsafeCoerce s+  SServerToClient -> Just $ SomeServerMethod s+  SClientToServer -> Nothing+  -- See Note [Parsing methods that go both ways]+  SBothDirections -> Just $ SomeServerMethod $ unsafeCoerce s  instance FromJSON SomeClientMethod where   parseJSON v = do     (SomeMethod sm) <- parseJSON v     case someClientMethod sm of       Just scm -> pure scm-      Nothing  -> mempty+      Nothing -> mempty  instance ToJSON SomeClientMethod where   toJSON (SomeClientMethod sm) = toJSON $ someMethodToMethodString $ SomeMethod sm@@ -154,7 +157,7 @@     (SomeMethod sm) <- parseJSON v     case someServerMethod sm of       Just scm -> pure scm-      Nothing  -> mempty+      Nothing -> mempty  instance ToJSON SomeServerMethod where   toJSON (SomeServerMethod sm) = toJSON $ someMethodToMethodString $ SomeMethod sm
src/Language/LSP/Protocol/Message/Parsing.hs view
@@ -1,25 +1,25 @@-{-# LANGUAGE ConstraintKinds  #-}+{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE LambdaCase       #-}-{-# LANGUAGE RankNTypes       #-}-{-# LANGUAGE TypeInType       #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE TypeInType #-}  module Language.LSP.Protocol.Message.Parsing where -import           Language.LSP.Protocol.Message.LspId-import           Language.LSP.Protocol.Message.Types-import           Language.LSP.Protocol.Message.Meta-import           Language.LSP.Protocol.Message.Method-import           Language.LSP.Protocol.Internal.Method+import Language.LSP.Protocol.Internal.Method+import Language.LSP.Protocol.Message.LspId+import Language.LSP.Protocol.Message.Meta+import Language.LSP.Protocol.Message.Method+import Language.LSP.Protocol.Message.Types -import           Data.Aeson-import           Data.Aeson.Types-import           Data.Function                     (on)-import           Data.GADT.Compare-import           Data.Kind-import           Data.Proxy-import           Data.Type.Equality-import           GHC.TypeLits                      (sameSymbol)+import Data.Aeson+import Data.Aeson.Types+import Data.Function (on)+import Data.GADT.Compare+import Data.Kind+import Data.Proxy+import Data.Type.Equality+import GHC.TypeLits (sameSymbol)  -- --------------------------------------------------------------------- -- Working with arbitrary messages@@ -27,7 +27,7 @@  data FromServerMessage' a where   FromServerMess :: forall t (m :: Method ServerToClient t) a. SMethod m -> TMessage m -> FromServerMessage' a-  FromServerRsp  :: forall (m :: Method ClientToServer Request) a. a m -> TResponseMessage m -> FromServerMessage' a+  FromServerRsp :: forall (m :: Method ClientToServer Request) a. a m -> TResponseMessage m -> FromServerMessage' a  type FromServerMessage = FromServerMessage' SMethod @@ -38,33 +38,45 @@  instance ToJSON FromServerMessage where   toJSON (FromServerMess m p) = serverMethodJSON m (toJSON p)-  toJSON (FromServerRsp m p)  = clientResponseJSON m (toJSON p)+  toJSON (FromServerRsp m p) = clientResponseJSON m (toJSON p) -fromServerNot :: forall (m :: Method ServerToClient Notification).-  TMessage m ~ TNotificationMessage m => TNotificationMessage m -> FromServerMessage-fromServerNot m@TNotificationMessage{_method=meth} = FromServerMess meth m+fromServerNot ::+  forall (m :: Method ServerToClient Notification).+  TMessage m ~ TNotificationMessage m =>+  TNotificationMessage m ->+  FromServerMessage+fromServerNot m@TNotificationMessage{_method = meth} = FromServerMess meth m -fromServerReq :: forall (m :: Method ServerToClient Request).-  TMessage m ~ TRequestMessage m => TRequestMessage m -> FromServerMessage-fromServerReq m@TRequestMessage{_method=meth} = FromServerMess meth m+fromServerReq ::+  forall (m :: Method ServerToClient Request).+  TMessage m ~ TRequestMessage m =>+  TRequestMessage m ->+  FromServerMessage+fromServerReq m@TRequestMessage{_method = meth} = FromServerMess meth m  data FromClientMessage' a where-  FromClientMess :: forall t (m :: Method ClientToServer t) a . SMethod m -> TMessage m -> FromClientMessage' a-  FromClientRsp  :: forall (m :: Method ServerToClient Request) a . a m -> TResponseMessage m -> FromClientMessage' a+  FromClientMess :: forall t (m :: Method ClientToServer t) a. SMethod m -> TMessage m -> FromClientMessage' a+  FromClientRsp :: forall (m :: Method ServerToClient Request) a. a m -> TResponseMessage m -> FromClientMessage' a  type FromClientMessage = FromClientMessage' SMethod  instance ToJSON FromClientMessage where   toJSON (FromClientMess m p) = clientMethodJSON m (toJSON p)-  toJSON (FromClientRsp m p)  = serverResponseJSON m (toJSON p)+  toJSON (FromClientRsp m p) = serverResponseJSON m (toJSON p) -fromClientNot :: forall (m :: Method ClientToServer Notification).-  TMessage m ~ TNotificationMessage m => TNotificationMessage m -> FromClientMessage-fromClientNot m@TNotificationMessage{_method=meth} = FromClientMess meth m+fromClientNot ::+  forall (m :: Method ClientToServer Notification).+  TMessage m ~ TNotificationMessage m =>+  TNotificationMessage m ->+  FromClientMessage+fromClientNot m@TNotificationMessage{_method = meth} = FromClientMess meth m -fromClientReq :: forall (m :: Method ClientToServer Request).-  TMessage m ~ TRequestMessage m => TRequestMessage m -> FromClientMessage-fromClientReq m@TRequestMessage{_method=meth} = FromClientMess meth m+fromClientReq ::+  forall (m :: Method ClientToServer Request).+  TMessage m ~ TRequestMessage m =>+  TRequestMessage m ->+  FromClientMessage+fromClientReq m@TRequestMessage{_method = meth} = FromClientMess meth m  -- --------------------------------------------------------------------- -- Parsing@@ -96,18 +108,18 @@             -- Request             Just _ ->               let m' = (SMethod_CustomMethod p :: SMethod (Method_CustomMethod s' :: Method ServerToClient Request))-              in FromServerMess m' <$> parseJSON v+               in FromServerMess m' <$> parseJSON v             Nothing ->               let m' = (SMethod_CustomMethod p :: SMethod (Method_CustomMethod s' :: Method ServerToClient Notification))-              in FromServerMess m' <$> parseJSON v+               in FromServerMess m' <$> parseJSON v     Nothing -> do       case idMaybe of         Just i -> do           case lookupId i of-            Just (m,res) -> clientResponseJSON m $ FromServerRsp res <$> parseJSON v+            Just (m, res) -> clientResponseJSON m $ FromServerRsp res <$> parseJSON v             Nothing -> fail $ unwords ["Failed in looking up response type of", show v]         Nothing -> fail $ unwords ["Got unexpected message without method or id"]-parseServerMessage _ v = fail $ unwords ["parseServerMessage expected object, got:",show v]+parseServerMessage _ v = fail $ unwords ["parseServerMessage expected object, got:", show v]  {-# INLINE parseClientMessage #-} parseClientMessage :: LookupFunc ServerToClient a -> Value -> Parser (FromClientMessage' a)@@ -125,18 +137,18 @@             -- Request             Just _ ->               let m' = (SMethod_CustomMethod p :: SMethod (Method_CustomMethod s' :: Method ClientToServer Request))-              in FromClientMess m' <$> parseJSON v+               in FromClientMess m' <$> parseJSON v             Nothing ->               let m' = (SMethod_CustomMethod p :: SMethod (Method_CustomMethod s' :: Method ClientToServer Notification))-              in FromClientMess m' <$> parseJSON v+               in FromClientMess m' <$> parseJSON v     Nothing -> do       case idMaybe of         Just i -> do           case lookupId i of-            Just (m,res) -> serverResponseJSON m $ FromClientRsp res <$> parseJSON v+            Just (m, res) -> serverResponseJSON m $ FromClientRsp res <$> parseJSON v             Nothing -> fail $ unwords ["Failed in looking up response type of", show v]         Nothing -> fail $ unwords ["Got unexpected message without method or id"]-parseClientMessage _ v = fail $ unwords ["parseClientMessage expected object, got:",show v]+parseClientMessage _ v = fail $ unwords ["parseClientMessage expected object, got:", show v]  -- --------------------------------------------------------------------- -- Helper Utilities@@ -145,179 +157,184 @@ {-# INLINE clientResponseJSON #-} clientResponseJSON :: SClientMethod m -> (HasJSON (TResponseMessage m) => x) -> x clientResponseJSON m x = case splitClientMethod m of-  IsClientReq    -> x+  IsClientReq -> x   IsClientEither -> x  {-# INLINE serverResponseJSON #-} serverResponseJSON :: SServerMethod m -> (HasJSON (TResponseMessage m) => x) -> x serverResponseJSON m x = case splitServerMethod m of-  IsServerReq    -> x+  IsServerReq -> x   IsServerEither -> x -{-# INLINE clientMethodJSON#-}+{-# INLINE clientMethodJSON #-} clientMethodJSON :: SClientMethod m -> (ToJSON (TClientMessage m) => x) -> x clientMethodJSON m x =   case splitClientMethod m of-    IsClientNot    -> x-    IsClientReq    -> x+    IsClientNot -> x+    IsClientReq -> x     IsClientEither -> x  {-# INLINE serverMethodJSON #-} serverMethodJSON :: SServerMethod m -> (ToJSON (TServerMessage m) => x) -> x serverMethodJSON m x =   case splitServerMethod m of-    IsServerNot    -> x-    IsServerReq    -> x+    IsServerNot -> x+    IsServerReq -> x     IsServerEither -> x -type HasJSON a = (ToJSON a,FromJSON a,Eq a)+type HasJSON a = (ToJSON a, FromJSON a, Eq a)  -- Reify universal properties about Client/Server Messages -type ClientNotOrReq :: forall t . Method ClientToServer t -> Type+type ClientNotOrReq :: forall t. Method ClientToServer t -> Type data ClientNotOrReq m where-  IsClientNot-    :: ( HasJSON (TClientMessage m)-       , TMessage m ~ TNotificationMessage m)-    => ClientNotOrReq (m :: Method ClientToServer Notification)-  IsClientReq-    :: forall (m :: Method ClientToServer Request).+  IsClientNot ::     ( HasJSON (TClientMessage m)+    , TMessage m ~ TNotificationMessage m+    ) =>+    ClientNotOrReq (m :: Method ClientToServer Notification)+  IsClientReq ::+    forall (m :: Method ClientToServer Request).+    ( HasJSON (TClientMessage m)     , HasJSON (TResponseMessage m)-    , TMessage m ~ TRequestMessage m)-    => ClientNotOrReq m-  IsClientEither-    :: ClientNotOrReq (Method_CustomMethod s)+    , TMessage m ~ TRequestMessage m+    ) =>+    ClientNotOrReq m+  IsClientEither ::+    ClientNotOrReq (Method_CustomMethod s) -type ServerNotOrReq :: forall t . Method ServerToClient t -> Type+type ServerNotOrReq :: forall t. Method ServerToClient t -> Type data ServerNotOrReq m where-  IsServerNot-    :: ( HasJSON (TServerMessage m)-       , TMessage m ~ TNotificationMessage m)-    => ServerNotOrReq (m :: Method ServerToClient Notification)-  IsServerReq-    :: forall (m :: Method ServerToClient Request).+  IsServerNot ::     ( HasJSON (TServerMessage m)+    , TMessage m ~ TNotificationMessage m+    ) =>+    ServerNotOrReq (m :: Method ServerToClient Notification)+  IsServerReq ::+    forall (m :: Method ServerToClient Request).+    ( HasJSON (TServerMessage m)     , HasJSON (TResponseMessage m)-    , TMessage m ~ TRequestMessage m)-    => ServerNotOrReq m-  IsServerEither-    :: ServerNotOrReq (Method_CustomMethod s)+    , TMessage m ~ TRequestMessage m+    ) =>+    ServerNotOrReq m+  IsServerEither ::+    ServerNotOrReq (Method_CustomMethod s)  {-# INLINE splitClientMethod #-} splitClientMethod :: SClientMethod m -> ClientNotOrReq m splitClientMethod = \case-  SMethod_Initialize                          -> IsClientReq-  SMethod_Initialized                         -> IsClientNot-  SMethod_Shutdown                            -> IsClientReq-  SMethod_Exit                                -> IsClientNot-  SMethod_WorkspaceDidChangeWorkspaceFolders  -> IsClientNot-  SMethod_WorkspaceDidChangeConfiguration     -> IsClientNot-  SMethod_WorkspaceDidChangeWatchedFiles      -> IsClientNot-  SMethod_WorkspaceSymbol                     -> IsClientReq-  SMethod_WorkspaceExecuteCommand             -> IsClientReq-  SMethod_WindowWorkDoneProgressCancel        -> IsClientNot-  SMethod_TextDocumentDidOpen                 -> IsClientNot-  SMethod_TextDocumentDidChange               -> IsClientNot-  SMethod_TextDocumentWillSave                -> IsClientNot-  SMethod_TextDocumentWillSaveWaitUntil       -> IsClientReq-  SMethod_TextDocumentDidSave                 -> IsClientNot-  SMethod_TextDocumentDidClose                -> IsClientNot-  SMethod_TextDocumentCompletion              -> IsClientReq-  SMethod_TextDocumentHover                   -> IsClientReq-  SMethod_TextDocumentSignatureHelp           -> IsClientReq-  SMethod_TextDocumentDeclaration             -> IsClientReq-  SMethod_TextDocumentDefinition              -> IsClientReq-  SMethod_TextDocumentTypeDefinition          -> IsClientReq-  SMethod_TextDocumentImplementation          -> IsClientReq-  SMethod_TextDocumentReferences              -> IsClientReq-  SMethod_TextDocumentDocumentHighlight       -> IsClientReq-  SMethod_TextDocumentDocumentSymbol          -> IsClientReq-  SMethod_TextDocumentCodeAction              -> IsClientReq-  SMethod_TextDocumentCodeLens                -> IsClientReq-  SMethod_TextDocumentDocumentLink            -> IsClientReq-  SMethod_TextDocumentDocumentColor           -> IsClientReq-  SMethod_TextDocumentColorPresentation       -> IsClientReq-  SMethod_TextDocumentFormatting              -> IsClientReq-  SMethod_TextDocumentRangeFormatting         -> IsClientReq-  SMethod_TextDocumentOnTypeFormatting        -> IsClientReq-  SMethod_TextDocumentRename                  -> IsClientReq-  SMethod_TextDocumentPrepareRename           -> IsClientReq-  SMethod_TextDocumentFoldingRange            -> IsClientReq-  SMethod_TextDocumentSelectionRange          -> IsClientReq-  SMethod_TextDocumentPrepareCallHierarchy    -> IsClientReq-  SMethod_TextDocumentLinkedEditingRange      -> IsClientReq-  SMethod_CallHierarchyIncomingCalls          -> IsClientReq-  SMethod_CallHierarchyOutgoingCalls          -> IsClientReq-  SMethod_TextDocumentSemanticTokensFull      -> IsClientReq+  SMethod_Initialize -> IsClientReq+  SMethod_Initialized -> IsClientNot+  SMethod_Shutdown -> IsClientReq+  SMethod_Exit -> IsClientNot+  SMethod_WorkspaceDidChangeWorkspaceFolders -> IsClientNot+  SMethod_WorkspaceDidChangeConfiguration -> IsClientNot+  SMethod_WorkspaceDidChangeWatchedFiles -> IsClientNot+  SMethod_WorkspaceSymbol -> IsClientReq+  SMethod_WorkspaceExecuteCommand -> IsClientReq+  SMethod_WindowWorkDoneProgressCancel -> IsClientNot+  SMethod_TextDocumentDidOpen -> IsClientNot+  SMethod_TextDocumentDidChange -> IsClientNot+  SMethod_TextDocumentWillSave -> IsClientNot+  SMethod_TextDocumentWillSaveWaitUntil -> IsClientReq+  SMethod_TextDocumentDidSave -> IsClientNot+  SMethod_TextDocumentDidClose -> IsClientNot+  SMethod_TextDocumentCompletion -> IsClientReq+  SMethod_TextDocumentHover -> IsClientReq+  SMethod_TextDocumentSignatureHelp -> IsClientReq+  SMethod_TextDocumentDeclaration -> IsClientReq+  SMethod_TextDocumentDefinition -> IsClientReq+  SMethod_TextDocumentTypeDefinition -> IsClientReq+  SMethod_TextDocumentImplementation -> IsClientReq+  SMethod_TextDocumentReferences -> IsClientReq+  SMethod_TextDocumentDocumentHighlight -> IsClientReq+  SMethod_TextDocumentDocumentSymbol -> IsClientReq+  SMethod_TextDocumentCodeAction -> IsClientReq+  SMethod_TextDocumentCodeLens -> IsClientReq+  SMethod_TextDocumentDocumentLink -> IsClientReq+  SMethod_TextDocumentDocumentColor -> IsClientReq+  SMethod_TextDocumentColorPresentation -> IsClientReq+  SMethod_TextDocumentFormatting -> IsClientReq+  SMethod_TextDocumentRangeFormatting -> IsClientReq+  SMethod_TextDocumentOnTypeFormatting -> IsClientReq+  SMethod_TextDocumentRename -> IsClientReq+  SMethod_TextDocumentPrepareRename -> IsClientReq+  SMethod_TextDocumentFoldingRange -> IsClientReq+  SMethod_TextDocumentSelectionRange -> IsClientReq+  SMethod_TextDocumentPrepareCallHierarchy -> IsClientReq+  SMethod_TextDocumentLinkedEditingRange -> IsClientReq+  SMethod_CallHierarchyIncomingCalls -> IsClientReq+  SMethod_CallHierarchyOutgoingCalls -> IsClientReq+  SMethod_TextDocumentSemanticTokensFull -> IsClientReq   SMethod_TextDocumentSemanticTokensFullDelta -> IsClientReq-  SMethod_TextDocumentSemanticTokensRange     -> IsClientReq-  SMethod_WorkspaceWillCreateFiles            -> IsClientReq-  SMethod_WorkspaceWillDeleteFiles            -> IsClientReq-  SMethod_WorkspaceWillRenameFiles            -> IsClientReq-  SMethod_WorkspaceDidCreateFiles             -> IsClientNot-  SMethod_WorkspaceDidDeleteFiles             -> IsClientNot-  SMethod_WorkspaceDidRenameFiles             -> IsClientNot-  SMethod_TextDocumentMoniker                 -> IsClientReq-  SMethod_TextDocumentPrepareTypeHierarchy    -> IsClientReq-  SMethod_TypeHierarchySubtypes               -> IsClientReq-  SMethod_TypeHierarchySupertypes             -> IsClientReq-  SMethod_TextDocumentInlineValue             -> IsClientReq-  SMethod_TextDocumentInlayHint               -> IsClientReq-  SMethod_TextDocumentDiagnostic              -> IsClientReq-  SMethod_WorkspaceDiagnostic                 -> IsClientReq-  SMethod_CodeLensResolve                     -> IsClientReq-  SMethod_InlayHintResolve                    -> IsClientReq-  SMethod_CodeActionResolve                   -> IsClientReq-  SMethod_DocumentLinkResolve                 -> IsClientReq-  SMethod_CompletionItemResolve               -> IsClientReq-  SMethod_WorkspaceSymbolResolve              -> IsClientReq-  SMethod_NotebookDocumentDidChange           -> IsClientNot-  SMethod_NotebookDocumentDidClose            -> IsClientNot-  SMethod_NotebookDocumentDidOpen             -> IsClientNot-  SMethod_NotebookDocumentDidSave             -> IsClientNot-  SMethod_SetTrace                            -> IsClientNot-  SMethod_Progress                            -> IsClientNot-  SMethod_CancelRequest                       -> IsClientNot-  (SMethod_CustomMethod _)                    -> IsClientEither+  SMethod_TextDocumentSemanticTokensRange -> IsClientReq+  SMethod_WorkspaceWillCreateFiles -> IsClientReq+  SMethod_WorkspaceWillDeleteFiles -> IsClientReq+  SMethod_WorkspaceWillRenameFiles -> IsClientReq+  SMethod_WorkspaceDidCreateFiles -> IsClientNot+  SMethod_WorkspaceDidDeleteFiles -> IsClientNot+  SMethod_WorkspaceDidRenameFiles -> IsClientNot+  SMethod_TextDocumentMoniker -> IsClientReq+  SMethod_TextDocumentPrepareTypeHierarchy -> IsClientReq+  SMethod_TypeHierarchySubtypes -> IsClientReq+  SMethod_TypeHierarchySupertypes -> IsClientReq+  SMethod_TextDocumentInlineValue -> IsClientReq+  SMethod_TextDocumentInlayHint -> IsClientReq+  SMethod_TextDocumentDiagnostic -> IsClientReq+  SMethod_WorkspaceDiagnostic -> IsClientReq+  SMethod_CodeLensResolve -> IsClientReq+  SMethod_InlayHintResolve -> IsClientReq+  SMethod_CodeActionResolve -> IsClientReq+  SMethod_DocumentLinkResolve -> IsClientReq+  SMethod_CompletionItemResolve -> IsClientReq+  SMethod_WorkspaceSymbolResolve -> IsClientReq+  SMethod_NotebookDocumentDidChange -> IsClientNot+  SMethod_NotebookDocumentDidClose -> IsClientNot+  SMethod_NotebookDocumentDidOpen -> IsClientNot+  SMethod_NotebookDocumentDidSave -> IsClientNot+  SMethod_SetTrace -> IsClientNot+  SMethod_Progress -> IsClientNot+  SMethod_CancelRequest -> IsClientNot+  (SMethod_CustomMethod _) -> IsClientEither  {-# INLINE splitServerMethod #-} splitServerMethod :: SServerMethod m -> ServerNotOrReq m splitServerMethod = \case-  SMethod_WindowShowMessage              -> IsServerNot-  SMethod_WindowShowMessageRequest       -> IsServerReq-  SMethod_WindowShowDocument             -> IsServerReq-  SMethod_WindowLogMessage               -> IsServerNot-  SMethod_WindowWorkDoneProgressCreate   -> IsServerReq-  SMethod_Progress                       -> IsServerNot-  SMethod_TelemetryEvent                 -> IsServerNot-  SMethod_ClientRegisterCapability       -> IsServerReq-  SMethod_ClientUnregisterCapability     -> IsServerReq-  SMethod_WorkspaceWorkspaceFolders      -> IsServerReq-  SMethod_WorkspaceConfiguration         -> IsServerReq-  SMethod_WorkspaceApplyEdit             -> IsServerReq+  SMethod_WindowShowMessage -> IsServerNot+  SMethod_WindowShowMessageRequest -> IsServerReq+  SMethod_WindowShowDocument -> IsServerReq+  SMethod_WindowLogMessage -> IsServerNot+  SMethod_WindowWorkDoneProgressCreate -> IsServerReq+  SMethod_Progress -> IsServerNot+  SMethod_TelemetryEvent -> IsServerNot+  SMethod_ClientRegisterCapability -> IsServerReq+  SMethod_ClientUnregisterCapability -> IsServerReq+  SMethod_WorkspaceWorkspaceFolders -> IsServerReq+  SMethod_WorkspaceConfiguration -> IsServerReq+  SMethod_WorkspaceApplyEdit -> IsServerReq   SMethod_TextDocumentPublishDiagnostics -> IsServerNot-  SMethod_LogTrace                       -> IsServerNot-  SMethod_CancelRequest                  -> IsServerNot-  SMethod_WorkspaceCodeLensRefresh       -> IsServerReq+  SMethod_LogTrace -> IsServerNot+  SMethod_CancelRequest -> IsServerNot+  SMethod_WorkspaceCodeLensRefresh -> IsServerReq   SMethod_WorkspaceSemanticTokensRefresh -> IsServerReq-  SMethod_WorkspaceInlineValueRefresh         -> IsServerReq-  SMethod_WorkspaceInlayHintRefresh           -> IsServerReq-  SMethod_WorkspaceDiagnosticRefresh          -> IsServerReq-  (SMethod_CustomMethod _)               -> IsServerEither+  SMethod_WorkspaceInlineValueRefresh -> IsServerReq+  SMethod_WorkspaceInlayHintRefresh -> IsServerReq+  SMethod_WorkspaceDiagnosticRefresh -> IsServerReq+  (SMethod_CustomMethod _) -> IsServerEither  -- | Given a witness that two custom methods are of the same type, produce a witness that the methods are the same data CustomEq m1 m2 where-  CustomEq-    :: (m1 ~ (Method_CustomMethod s :: Method f t1), m2 ~ (Method_CustomMethod s :: Method f t2))-    => { runCustomEq :: (t1 ~ t2 => m1 :~~: m2) }-    -> CustomEq m1 m2+  CustomEq ::+    (m1 ~ (Method_CustomMethod s :: Method f t1), m2 ~ (Method_CustomMethod s :: Method f t2)) =>+    {runCustomEq :: (t1 ~ t2 => m1 :~~: m2)} ->+    CustomEq m1 m2 -runEq :: (t1 ~ t2)-      => (SMethod m1 -> SMethod m2 -> Maybe (Either (CustomEq m1 m2) (m1 :~~: m2)))-      -> SMethod (m1 :: Method f t1)-      -> SMethod (m2 :: Method f t2)-      -> Maybe (m1 :~~: m2)+runEq ::+  (t1 ~ t2) =>+  (SMethod m1 -> SMethod m2 -> Maybe (Either (CustomEq m1 m2) (m1 :~~: m2))) ->+  SMethod (m1 :: Method f t1) ->+  SMethod (m2 :: Method f t2) ->+  Maybe (m1 :~~: m2) runEq f m1 m2 = do   res <- f m1 m2   pure $ case res of@@ -327,35 +344,35 @@ -- | Heterogeneous equality on singleton server methods mEqServer :: SServerMethod m1 -> SServerMethod m2 -> Maybe (Either (CustomEq m1 m2) (m1 :~~: m2)) mEqServer m1 m2 = go (splitServerMethod m1) (splitServerMethod m2)-  where-    go IsServerNot IsServerNot = do-      Refl <- geq m1 m2-      pure $ Right HRefl-    go IsServerReq IsServerReq = do-      Refl <- geq m1 m2-      pure $ Right HRefl-    go IsServerEither IsServerEither-      | SMethod_CustomMethod p1 <- m1-      , SMethod_CustomMethod p2 <- m2-      = case sameSymbol p1 p2 of+ where+  go IsServerNot IsServerNot = do+    Refl <- geq m1 m2+    pure $ Right HRefl+  go IsServerReq IsServerReq = do+    Refl <- geq m1 m2+    pure $ Right HRefl+  go IsServerEither IsServerEither+    | SMethod_CustomMethod p1 <- m1+    , SMethod_CustomMethod p2 <- m2 =+        case sameSymbol p1 p2 of           Just Refl -> Just $ Left $ CustomEq HRefl-          _         -> Nothing-    go _ _ = Nothing+          _ -> Nothing+  go _ _ = Nothing  -- | Heterogeneous equality on singleton client methods mEqClient :: SClientMethod m1 -> SClientMethod m2 -> Maybe (Either (CustomEq m1 m2) (m1 :~~: m2)) mEqClient m1 m2 = go (splitClientMethod m1) (splitClientMethod m2)-  where-    go IsClientNot IsClientNot = do-      Refl <- geq m1 m2-      pure $ Right HRefl-    go IsClientReq IsClientReq = do-      Refl <- geq m1 m2-      pure $ Right HRefl-    go IsClientEither IsClientEither-      | SMethod_CustomMethod p1 <- m1-      , SMethod_CustomMethod p2 <- m2-      = case sameSymbol p1 p2 of+ where+  go IsClientNot IsClientNot = do+    Refl <- geq m1 m2+    pure $ Right HRefl+  go IsClientReq IsClientReq = do+    Refl <- geq m1 m2+    pure $ Right HRefl+  go IsClientEither IsClientEither+    | SMethod_CustomMethod p1 <- m1+    , SMethod_CustomMethod p2 <- m2 =+        case sameSymbol p1 p2 of           Just Refl -> Just $ Left $ CustomEq HRefl-          _         -> Nothing-    go _ _ = Nothing+          _ -> Nothing+  go _ _ = Nothing
src/Language/LSP/Protocol/Message/Registration.hs view
@@ -1,40 +1,39 @@-{-# LANGUAGE DeriveAnyClass            #-}-{-# LANGUAGE DeriveGeneric             #-}-{-# LANGUAGE DuplicateRecordFields     #-}+{-# LANGUAGE DeriveAnyClass #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE ExistentialQuantification #-}-{-# LANGUAGE FlexibleContexts          #-}-{-# LANGUAGE FlexibleInstances         #-}-{-# LANGUAGE RankNTypes                #-}-{-# LANGUAGE TemplateHaskell           #-}-{-# LANGUAGE TypeInType                #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE TypeInType #-}  module Language.LSP.Protocol.Message.Registration where -import           Language.LSP.Protocol.Types-import           Language.LSP.Protocol.Internal.Method-import           Language.LSP.Protocol.Message.Meta-import           Language.LSP.Protocol.Message.Method-import           Language.LSP.Protocol.Utils.Misc+import Language.LSP.Protocol.Internal.Method+import Language.LSP.Protocol.Message.Meta+import Language.LSP.Protocol.Message.Method+import Language.LSP.Protocol.Types+import Language.LSP.Protocol.Utils.Misc -import           Data.Aeson-import           Data.Text                         (Text)-import qualified Data.Text                         as T-import           GHC.Generics-import           Prettyprinter+import Data.Aeson+import Data.Text (Text)+import Data.Text qualified as T+import GHC.Generics+import Prettyprinter  -- | Typed registration type, with correct options.-data TRegistration (m :: Method ClientToServer t) =-  TRegistration-    { -- | The id used to register the request. The id can be used to deregister-      -- the request again.-      _id              :: Text-      -- | The method / capability to register for.-    , _method          :: SClientMethod m-      -- | Options necessary for the registration.-      -- Make this strict to aid the pattern matching exhaustiveness checker-    , _registerOptions :: !(Maybe (RegistrationOptions m))-    }-  deriving stock Generic+data TRegistration (m :: Method ClientToServer t) = TRegistration+  { _id :: Text+  -- ^ The id used to register the request. The id can be used to deregister+  -- the request again.+  , _method :: SClientMethod m+  -- ^ The method / capability to register for.+  , _registerOptions :: !(Maybe (RegistrationOptions m))+  -- ^ Options necessary for the registration.+  -- Make this strict to aid the pattern matching exhaustiveness checker+  }+  deriving stock (Generic)  deriving stock instance Eq (RegistrationOptions m) => Eq (TRegistration m) deriving stock instance Show (RegistrationOptions m) => Show (TRegistration m)@@ -76,21 +75,21 @@ toSomeRegistration :: Registration -> Maybe SomeRegistration toSomeRegistration r =   let v = toJSON r-  in case fromJSON v of-    Success r' -> Just r'-    _          -> Nothing+   in case fromJSON v of+        Success r' -> Just r'+        _ -> Nothing  -- ---------------------------------------------------------------------  -- | Typed unregistration type.-data TUnregistration (m :: Method ClientToServer t) =-  TUnregistration-    { -- | The id used to unregister the request or notification. Usually an id-      -- provided during the register request.-      _id     :: Text-      -- | The method / capability to unregister for.-    , _method :: SMethod m-    } deriving stock Generic+data TUnregistration (m :: Method ClientToServer t) = TUnregistration+  { _id :: Text+  -- ^ The id used to unregister the request or notification. Usually an id+  -- provided during the register request.+  , _method :: SMethod m+  -- ^ The method / capability to unregister for.+  }+  deriving stock (Generic)  deriving stock instance Eq (TUnregistration m) deriving stock instance Show (TUnregistration m)@@ -119,7 +118,6 @@ toSomeUnregistration :: Unregistration -> Maybe SomeUnregistration toSomeUnregistration r =   let v = toJSON r-  in case fromJSON v of-    Success r' -> Just r'-    _          -> Nothing-+   in case fromJSON v of+        Success r' -> Just r'+        _ -> Nothing
src/Language/LSP/Protocol/Message/Types.hs view
@@ -1,64 +1,66 @@-{-# LANGUAGE ConstraintKinds  #-}+{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE RankNTypes       #-}-{-# LANGUAGE TemplateHaskell  #-}-{-# LANGUAGE TupleSections    #-}-{-# LANGUAGE TypeInType       #-}+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE TupleSections #-}+{-# LANGUAGE TypeInType #-}  module Language.LSP.Protocol.Message.Types where -import           Language.LSP.Protocol.Types.Common-import           Language.LSP.Protocol.Internal.Method-import           Language.LSP.Protocol.Types-import           Language.LSP.Protocol.Message.LspId-import           Language.LSP.Protocol.Message.Meta-import           Language.LSP.Protocol.Message.Method ()-import           Language.LSP.Protocol.Utils.Misc+import Language.LSP.Protocol.Internal.Method+import Language.LSP.Protocol.Message.LspId+import Language.LSP.Protocol.Message.Meta+import Language.LSP.Protocol.Message.Method ()+import Language.LSP.Protocol.Types+import Language.LSP.Protocol.Types.Common+import Language.LSP.Protocol.Utils.Misc -import           Data.Aeson                         hiding (Null)-import qualified Data.Aeson                         as J-import           Data.Aeson.TH-import           Data.Kind-import           Data.String                        (IsString (..))-import           Data.Text                          (Text)-import           GHC.Generics-import           GHC.TypeLits                       (KnownSymbol)-import           Prettyprinter+import Data.Aeson hiding (Null)+import Data.Aeson qualified as J+import Data.Aeson.TH+import Data.Kind+import Data.String (IsString (..))+import Data.Text (Text)+import GHC.Generics+import GHC.TypeLits (KnownSymbol)+import Prettyprinter  -- 'RequestMessage', 'ResponseMessage', 'ResponseError', and 'NotificationMessage' -- aren't present in the metamodel, although they should be. -- https://github.com/microsoft/vscode-languageserver-node/issues/1079  -- | Notification message type as defined in the spec.-data NotificationMessage =-  NotificationMessage-    { _jsonrpc :: Text-    , _method  :: Text-    , _params  :: Maybe Value-    } deriving stock (Show, Eq, Generic)+data NotificationMessage = NotificationMessage+  { _jsonrpc :: Text+  , _method :: Text+  , _params :: Maybe Value+  }+  deriving stock (Show, Eq, Generic)  deriveJSON lspOptions ''NotificationMessage deriving via ViaJSON NotificationMessage instance Pretty NotificationMessage  -- This isn't present in the metamodel.+ -- | Request message type as defined in the spec. data RequestMessage = RequestMessage-    { _jsonrpc :: Text-    , _id      :: Int32 |? Text-    , _method  :: Text-    , _params  :: Maybe Value-    } deriving stock (Show, Eq, Generic)+  { _jsonrpc :: Text+  , _id :: Int32 |? Text+  , _method :: Text+  , _params :: Maybe Value+  }+  deriving stock (Show, Eq, Generic)  deriveJSON lspOptions ''RequestMessage deriving via ViaJSON RequestMessage instance Pretty RequestMessage  -- | Response error type as defined in the spec.-data ResponseError =-  ResponseError-    { _code    :: LSPErrorCodes |? ErrorCodes-    , _message :: Text-    , _xdata   :: Maybe Value-    } deriving stock (Show, Eq, Generic)+data ResponseError = ResponseError+  { _code :: LSPErrorCodes |? ErrorCodes+  , _message :: Text+  , _xdata :: Maybe Value+  }+  deriving stock (Show, Eq, Generic)  {- Note [ErrorCodes and LSPErrorCodes] @@ -77,42 +79,45 @@ -} deriveToJSON lspOptions ''ResponseError instance FromJSON ResponseError where-    parseJSON = -      let errorCode = withObject "ResponseError" $ \v -> ResponseError-                        <$> v .: "code"-                        <*> v .: "message"-                        <*> v .:? "data"-      in fmap go . errorCode-      where go :: ResponseError -> ResponseError-            go x@(ResponseError (InL (LSPErrorCodes_Custom n)) _ _) = -              x{_code = InR (fromOpenEnumBaseType n)}-            go x = x+  parseJSON =+    let errorCode = withObject "ResponseError" $ \v ->+          ResponseError+            <$> v .: "code"+            <*> v .: "message"+            <*> v .:? "data"+     in fmap go . errorCode+   where+    go :: ResponseError -> ResponseError+    go x@(ResponseError (InL (LSPErrorCodes_Custom n)) _ _) =+      x{_code = InR (fromOpenEnumBaseType n)}+    go x = x  deriving via ViaJSON ResponseError instance Pretty ResponseError  -- | Response message type as defined in the spec.-data ResponseMessage =-  ResponseMessage-    { _jsonrpc :: Text-    , _id      :: Int32 |? Text |? Null-    , _result  :: Maybe Value-    , _error   :: Maybe ResponseError-    } deriving stock (Show, Eq, Generic)+data ResponseMessage = ResponseMessage+  { _jsonrpc :: Text+  , _id :: Int32 |? Text |? Null+  , _result :: Maybe Value+  , _error :: Maybe ResponseError+  }+  deriving stock (Show, Eq, Generic)  deriveJSON lspOptions ''ResponseMessage  deriving via ViaJSON ResponseMessage instance Pretty ResponseMessage  -----+ -- | Typed notification message, containing the correct parameter payload.-data TNotificationMessage (m :: Method f Notification) =-  TNotificationMessage-    { _jsonrpc :: Text-    , _method  :: SMethod m-    , _params  :: MessageParams m-    } deriving stock Generic+data TNotificationMessage (m :: Method f Notification) = TNotificationMessage+  { _jsonrpc :: Text+  , _method :: SMethod m+  , _params :: MessageParams m+  }+  deriving stock (Generic) -deriving stock instance Eq   (MessageParams m) => Eq (TNotificationMessage m)+deriving stock instance Eq (MessageParams m) => Eq (TNotificationMessage m) deriving stock instance Show (MessageParams m) => Show (TNotificationMessage m)  {- Note [Missing 'params']@@ -129,54 +134,57 @@   -- See Note [Missing 'params']   parseJSON = genericParseJSON lspOptions . addNullField "params" instance (ToJSON (MessageParams m)) => ToJSON (TNotificationMessage m) where-  toJSON     = genericToJSON lspOptions+  toJSON = genericToJSON lspOptions   toEncoding = genericToEncoding lspOptions  deriving via ViaJSON (TNotificationMessage m) instance (ToJSON (MessageParams m)) => Pretty (TNotificationMessage m)  -- | Typed request message, containing the correct parameter payload. data TRequestMessage (m :: Method f Request) = TRequestMessage-    { _jsonrpc :: Text-    , _id      :: LspId m-    , _method  :: SMethod m-    , _params  :: MessageParams m-    } deriving stock Generic+  { _jsonrpc :: Text+  , _id :: LspId m+  , _method :: SMethod m+  , _params :: MessageParams m+  }+  deriving stock (Generic) -deriving stock instance Eq   (MessageParams m) => Eq (TRequestMessage m)+deriving stock instance Eq (MessageParams m) => Eq (TRequestMessage m) deriving stock instance Show (MessageParams m) => Show (TRequestMessage m)  instance (FromJSON (MessageParams m), FromJSON (SMethod m)) => FromJSON (TRequestMessage m) where   -- See Note [Missing 'params']   parseJSON = genericParseJSON lspOptions . addNullField "params" instance (ToJSON (MessageParams m)) => ToJSON (TRequestMessage m) where-  toJSON     = genericToJSON lspOptions+  toJSON = genericToJSON lspOptions   toEncoding = genericToEncoding lspOptions  deriving via ViaJSON (TRequestMessage m) instance (ToJSON (MessageParams m)) => Pretty (TRequestMessage m) -data TResponseError (m :: Method f Request) =-  TResponseError-    { _code    :: LSPErrorCodes |? ErrorCodes-    , _message :: Text-    , _xdata   :: Maybe (ErrorData m)-    } deriving stock Generic+data TResponseError (m :: Method f Request) = TResponseError+  { _code :: LSPErrorCodes |? ErrorCodes+  , _message :: Text+  , _xdata :: Maybe (ErrorData m)+  }+  deriving stock (Generic) -deriving stock instance Eq   (ErrorData m) => Eq (TResponseError m)+deriving stock instance Eq (ErrorData m) => Eq (TResponseError m) deriving stock instance Show (ErrorData m) => Show (TResponseError m)  instance (FromJSON (ErrorData m)) => FromJSON (TResponseError m) where-  parseJSON = -    let errorCode = withObject "ResponseError" $ \v -> TResponseError-                      <$> v .: "code"-                      <*> v .: "message"-                      <*> v .:? "data"-    in fmap go . errorCode-    where go :: TResponseError m -> TResponseError m-          go x@(TResponseError (InL (LSPErrorCodes_Custom n)) _ _) = -            x{_code = InR (fromOpenEnumBaseType n)}-          go x = x+  parseJSON =+    let errorCode = withObject "ResponseError" $ \v ->+          TResponseError+            <$> v .: "code"+            <*> v .: "message"+            <*> v .:? "data"+     in fmap go . errorCode+   where+    go :: TResponseError m -> TResponseError m+    go x@(TResponseError (InL (LSPErrorCodes_Custom n)) _ _) =+      x{_code = InR (fromOpenEnumBaseType n)}+    go x = x instance (ToJSON (ErrorData m)) => ToJSON (TResponseError m) where-  toJSON     = genericToJSON lspOptions+  toJSON = genericToJSON lspOptions   toEncoding = genericToEncoding lspOptions  deriving via ViaJSON (TResponseError m) instance (ToJSON (ErrorData m)) => Pretty (TResponseError m)@@ -186,35 +194,35 @@ toUntypedResponseError (TResponseError c m d) = ResponseError c m (fmap toJSON d)  -- | A typed response message with a correct result payload.-data TResponseMessage (m :: Method f Request) =-  TResponseMessage-    { _jsonrpc :: Text-    , _id      :: Maybe (LspId m)-    -- TODO: use `TResponseError m` for the error type, this will require quite a lot of adaptation downstream-    , _result  :: Either ResponseError (MessageResult m)-    } deriving stock Generic+data TResponseMessage (m :: Method f Request) = TResponseMessage+  { _jsonrpc :: Text+  , _id :: Maybe (LspId m)+  , -- TODO: use `TResponseError m` for the error type, this will require quite a lot of adaptation downstream+    _result :: Either ResponseError (MessageResult m)+  }+  deriving stock (Generic) -deriving stock instance (Eq   (MessageResult m), Eq (ErrorData m)) => Eq (TResponseMessage m)+deriving stock instance (Eq (MessageResult m), Eq (ErrorData m)) => Eq (TResponseMessage m) deriving stock instance (Show (MessageResult m), Show (ErrorData m)) => Show (TResponseMessage m)  instance (ToJSON (MessageResult m), ToJSON (ErrorData m)) => ToJSON (TResponseMessage m) where-  toJSON TResponseMessage { _jsonrpc = jsonrpc, _id = lspid, _result = result }-    = object+  toJSON TResponseMessage{_jsonrpc = jsonrpc, _id = lspid, _result = result} =+    object       [ "jsonrpc" .= jsonrpc       , "id" .= lspid       , case result of-        Left  err -> "error" .= err-        Right a   -> "result" .= a+          Left err -> "error" .= err+          Right a -> "result" .= a       ]  instance (FromJSON (MessageResult a), FromJSON (ErrorData a)) => FromJSON (TResponseMessage a) where   parseJSON = withObject "Response" $ \o -> do     _jsonrpc <- o .: "jsonrpc"-    _id      <- o .: "id"+    _id <- o .: "id"     -- It is important to use .:! so that "result = null" (without error) gets decoded as Just Null-    _result  <- o .:! "result"-    _error   <- o .:? "error"-    result   <- case (_error, _result) of+    _result <- o .:! "result"+    _error <- o .:? "error"+    result <- case (_error, _result) of       (Just err, Nothing) -> pure $ Left err       (Nothing, Just res) -> pure $ Right res       (Just _err, Just _res) -> fail $ "both error and result cannot be present: " ++ show o@@ -223,8 +231,9 @@  deriving via ViaJSON (TResponseMessage m) instance (ToJSON (MessageResult m), ToJSON (ErrorData m)) => Pretty (TResponseMessage m) --- | A typed custom message. A special data type is needed to distinguish between--- notifications and requests, since a CustomMethod can be both!+{- | A typed custom message. A special data type is needed to distinguish between+ notifications and requests, since a CustomMethod can be both!+-} data TCustomMessage s f t where   ReqMess :: TRequestMessage (Method_CustomMethod s :: Method f Request) -> TCustomMessage s f Request   NotMess :: TNotificationMessage (Method_CustomMethod s :: Method f Notification) -> TCustomMessage s f Notification@@ -246,9 +255,10 @@ -- Helper Type Families -- --------------------------------------------------------------------- --- | Map a method to the Request/Notification type with the correct--- payload.-type TMessage :: forall f t . Method f t -> Type+{- | Map a method to the Request/Notification type with the correct+ payload.+-}+type TMessage :: forall f t. Method f t -> Type type family TMessage m where   TMessage (Method_CustomMethod s :: Method f t) = TCustomMessage s f t   TMessage (m :: Method f Request) = TRequestMessage m@@ -258,10 +268,10 @@ type TClientMessage (m :: Method ClientToServer t) = TMessage m type TServerMessage (m :: Method ServerToClient t) = TMessage m --- | Replace a missing field in an object with a null field, to simplify parsing--- This is a hack to allow other types than Maybe to work like Maybe in allowing the field to be missing.--- See also this issue: https://github.com/haskell/aeson/issues/646+{- | Replace a missing field in an object with a null field, to simplify parsing+ This is a hack to allow other types than Maybe to work like Maybe in allowing the field to be missing.+ See also this issue: https://github.com/haskell/aeson/issues/646+-} addNullField :: String -> Value -> Value addNullField s (Object o) = Object $ o <> fromString s .= J.Null-addNullField _ v          = v-+addNullField _ v = v
src/Language/LSP/Protocol/Types.hs view
@@ -1,44 +1,57 @@ -- The OSPath import sometimes looks unused {-# OPTIONS_GHC -Wno-unused-imports #-}+ module Language.LSP.Protocol.Types (   -- * Basic types and functions-  module Common+  module Common,+   -- ** URIs-  , module Uri+  module Uri,+   -- ** Locations-  , module Locations+  module Locations,+   -- ** LSP enumerations-  , module LspEnum+  module LspEnum,+   -- ** Singleton types-  , module Singletons+  module Singletons,+   -- * Helpers for working with LSP types+   -- ** Edits-  , module Edits+  module Edits,+   -- ** Markup-  , module Markup+  module Markup,+   -- ** Code actions-  , module CodeAction+  module CodeAction,+   -- ** Progress-  , module Progress+  module Progress,+   -- ** Semantic tokens-  , module SemanticTokens+  module SemanticTokens,+   -- ** WatchKinds-  , module WatchKinds+  module WatchKinds,+   -- * Main LSP types and functions-  , module Generated-  ) where+  module Generated,+) where  import Language.LSP.Protocol.Internal.Types as Generated import Language.LSP.Protocol.Types.CodeAction as CodeAction import Language.LSP.Protocol.Types.Common as Common+import Language.LSP.Protocol.Types.Edit as Edits import Language.LSP.Protocol.Types.Location as Locations import Language.LSP.Protocol.Types.LspEnum as LspEnum import Language.LSP.Protocol.Types.MarkupContent as Markup+import Language.LSP.Protocol.Types.Orphans () import Language.LSP.Protocol.Types.Progress as Progress import Language.LSP.Protocol.Types.SemanticTokens as SemanticTokens import Language.LSP.Protocol.Types.Singletons as Singletons import Language.LSP.Protocol.Types.Uri as Uri import Language.LSP.Protocol.Types.Uri.OsPath as Uri-import Language.LSP.Protocol.Types.Edit as Edits-import Language.LSP.Protocol.Types.Orphans () import Language.LSP.Protocol.Types.WatchKinds as WatchKinds
src/Language/LSP/Protocol/Types/CodeAction.hs view
@@ -1,8 +1,8 @@ module Language.LSP.Protocol.Types.CodeAction where -import           Language.LSP.Protocol.Types.LspEnum-import           Language.LSP.Protocol.Internal.Types-import qualified Data.Text as T+import Data.Text qualified as T+import Language.LSP.Protocol.Internal.Types+import Language.LSP.Protocol.Types.LspEnum  -- | Does the first 'CodeActionKind' subsume the other one, hierarchically. Reflexive. codeActionKindSubsumes :: CodeActionKind -> CodeActionKind -> Bool
src/Language/LSP/Protocol/Types/Common.hs view
@@ -1,52 +1,53 @@-{-# LANGUAGE CPP                  #-}-{-# LANGUAGE DataKinds                  #-}-{-# LANGUAGE DeriveAnyClass             #-}-{-# LANGUAGE DeriveGeneric              #-}-{-# LANGUAGE DeriveTraversable          #-}-{-# LANGUAGE DerivingStrategies         #-}+{-# LANGUAGE CPP #-}+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveAnyClass #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DeriveTraversable #-}+{-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE LambdaCase                 #-}-{-# LANGUAGE TypeOperators              #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE TypeOperators #-}  -- | Common types that aren't in the specification module Language.LSP.Protocol.Types.Common (-    type (|?) (..)-  , toEither-  , _L-  , _R-  , Int32-  , UInt-  , Null (..)-  , absorbNull-  , nullToMaybe-  , maybeToNull-  , (.=?)+  type (|?) (..),+  toEither,+  _L,+  _R,+  Int32,+  UInt,+  Null (..),+  absorbNull,+  nullToMaybe,+  maybeToNull,+  (.=?), ) where -import           Control.DeepSeq-import           Control.Lens-import           Data.Aeson          hiding (Null)-import qualified Data.Aeson          as J+import Control.DeepSeq+import Control.Lens+import Data.Aeson hiding (Null)+import Data.Aeson qualified as J #if MIN_VERSION_aeson(2,0,0) import qualified Data.Aeson.KeyMap   as KM #else import qualified Data.HashMap.Strict   as KM #endif-import           Data.Hashable-import           Data.Set            as Set-import           Data.String         (fromString)-import           Data.Int            (Int32)-import           Data.Mod.Word-import           Language.LSP.Protocol.Utils.Misc-import           GHC.Generics        hiding (UInt)-import           GHC.TypeNats        hiding (Mod)-import           Text.Read           (Read (readPrec))-import           Prettyprinter+import Data.Hashable+import Data.Int (Int32)+import Data.Mod.Word+import Data.Set as Set+import Data.String (fromString)+import GHC.Generics hiding (UInt)+import GHC.TypeNats hiding (Mod)+import Language.LSP.Protocol.Utils.Misc+import Prettyprinter+import Text.Read (Read (readPrec)) --- | The "uinteger" type in the LSP spec.------ Unusually, this is a **31**-bit unsigned integer, not a 32-bit one.-newtype UInt = UInt (Mod (2^31))+{- | The "uinteger" type in the LSP spec.++ Unusually, this is a **31**-bit unsigned integer, not a 32-bit one.+-}+newtype UInt = UInt (Mod (2 ^ 31))   deriving newtype (Num, Bounded, Enum, Eq, Ord)   deriving stock (Generic)   deriving anyclass (NFData)@@ -75,17 +76,20 @@ instance FromJSON UInt where   parseJSON v = fromInteger <$> parseJSON v --- | An alternative type (isomorphic to 'Either'), but which--- is encoded into JSON without a tag for the alternative.------ This corresponds to @a | b@ types in the LSP specification.-data a |? b = InL a-            | InR b+{- | An alternative type (isomorphic to 'Either'), but which+ is encoded into JSON without a tag for the alternative.++ This corresponds to @a | b@ types in the LSP specification.+-}+data a |? b+  = InL a+  | InR b   deriving stock (Read, Show, Eq, Ord, Generic)   deriving anyclass (NFData, Hashable)-  deriving Pretty via (ViaJSON (a |? b))-infixr |?+  deriving (Pretty) via (ViaJSON (a |? b)) +infixr 9 |?+ -- | Prism for the left-hand side of an '(|?)'. _L :: Prism' (a |? b) a _L = prism' InL $ \case@@ -126,32 +130,35 @@       (Success a, Success b) -> case (toJSON a, toJSON b) of         -- Both sides encode to the same thing, just pick one arbitrarily         (l, r) | l == r -> pure $ InL a-        (Object oa, Object ob) -> +        (Object oa, Object ob) ->           let ka = Set.fromList $ KM.keys oa               kb = Set.fromList $ KM.keys ob-          in if kb `Set.isSubsetOf` ka-          then pure $ InL a-          else if ka `Set.isSubsetOf` kb-          then pure $ InR b-          else fail $ "Could not decide which type of value to produce, left encodes to an object with keys: " ++ show ka ++ "; right has keys " ++ show kb+           in if kb `Set.isSubsetOf` ka+                then pure $ InL a+                else+                  if ka `Set.isSubsetOf` kb+                    then pure $ InR b+                    else fail $ "Could not decide which type of value to produce, left encodes to an object with keys: " ++ show ka ++ "; right has keys " ++ show kb         (l, r) -> fail $ "Could not decide which type of value to produce, left encodes to: " ++ show l ++ "; right encodes to: " ++ show r  -- We could use 'Proxy' for this, as aeson also serializes it to/from null, -- but this is more explicit.--- | A type for that is precisely null and nothing else.------ This is useful since the LSP specification often includes types like @a | null@--- as distinct from an optional value of type @a@.++{- | A type for that is precisely null and nothing else.++ This is useful since the LSP specification often includes types like @a | null@+ as distinct from an optional value of type @a@.+-} data Null = Null   deriving stock (Eq, Ord, Show, Generic)   deriving anyclass (NFData, Hashable)-  deriving Pretty via (ViaJSON Null)+  deriving (Pretty) via (ViaJSON Null)  instance ToJSON Null where   toJSON Null = J.Null instance FromJSON Null where   parseJSON J.Null = pure Null-  parseJSON _      = fail "expected 'null'"+  parseJSON _ = fail "expected 'null'"  absorbNull :: Monoid a => a |? Null -> a absorbNull (InL a) = a@@ -163,7 +170,7 @@  maybeToNull :: Maybe a -> a |? Null maybeToNull (Just x) = InL x-maybeToNull Nothing  = InR Null+maybeToNull Nothing = InR Null  -- This is equivalent to the instance for 'Maybe s' instance Semigroup s => Semigroup (s |? Null) where@@ -172,10 +179,15 @@   InR _ <> InL x = InL x   InR _ <> InR y = InR y -  -- We use String so we can use fromString on it to get a key that works-  -- in both aeson-1 and aeson-2+-- We use String so we can use fromString on it to get a key that works+-- in both aeson-1 and aeson-2+ -- | Include a value in an JSON object optionally, omitting it if it is 'Nothing'.+#if MIN_VERSION_aeson(2,2,0)+(.=?) :: (J.KeyValue e kv, J.ToJSON v) => String -> Maybe v -> [kv]+#else (.=?) :: (J.KeyValue kv, J.ToJSON v) => String -> Maybe v -> [kv]+#endif k .=? v = case v of   Just v' -> [fromString k J..= v']   Nothing -> mempty
src/Language/LSP/Protocol/Types/Edit.hs view
@@ -1,58 +1,60 @@ {-# LANGUAGE DuplicateRecordFields #-}-{-# LANGUAGE OverloadedStrings     #-}-{-# LANGUAGE TypeOperators         #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE TypeOperators #-}  module Language.LSP.Protocol.Types.Edit where -import           Data.Text                         (Text)-import qualified Data.Text                         as T+import Data.Text (Text)+import Data.Text qualified as T -import           Control.Lens                      hiding (index)-import           Language.LSP.Protocol.Types.Common-import           Language.LSP.Protocol.Internal.Types+import Control.Lens hiding (index)+import Language.LSP.Protocol.Internal.Types+import Language.LSP.Protocol.Types.Common  -- | Convenience alias for the type in the 'WorkspaceEdit._documentChanges' field. type DocumentChange = TextDocumentEdit |? CreateFile |? RenameFile |? DeleteFile  -- TODO: get rid of this in favour of the more correct things in VFS--- | Applies a 'TextEdit' to some 'Text'.------ >>> applyTextEdit (TextEdit (Range (Position 0 1) (Position 0 2)) "i") "foo"--- "fio"++{- | Applies a 'TextEdit' to some 'Text'.++ >>> applyTextEdit (TextEdit (Range (Position 0 1) (Position 0 2)) "i") "foo"+ "fio"+-} applyTextEdit :: TextEdit -> Text -> Text applyTextEdit (TextEdit (Range sp ep) newText) oldText =   let (_, afterEnd) = splitAtPos ep oldText       (beforeStart, _) = splitAtPos sp oldText-    in mconcat [beforeStart, newText, afterEnd]-  where-    splitAtPos :: Position -> Text -> (Text, Text)-    splitAtPos (Position sl sc) t =-      -- If we are looking for a line beyond the end of the text, this will give us an index-      -- past the end. Fortunately, T.splitAt is fine with this, and just gives us the whole-      -- string and an empty string, which is what we want.-      let index = sc + startLineIndex sl t-        in T.splitAt (fromIntegral index) t+   in mconcat [beforeStart, newText, afterEnd]+ where+  splitAtPos :: Position -> Text -> (Text, Text)+  splitAtPos (Position sl sc) t =+    -- If we are looking for a line beyond the end of the text, this will give us an index+    -- past the end. Fortunately, T.splitAt is fine with this, and just gives us the whole+    -- string and an empty string, which is what we want.+    let index = sc + startLineIndex sl t+     in T.splitAt (fromIntegral index) t -    -- The index of the first character of line 'line'-    startLineIndex :: UInt -> Text -> UInt-    startLineIndex 0 _ = 0-    startLineIndex line t' =-      case T.findIndex (== '\n') t' of-        Just i -> fromIntegral i + 1 + startLineIndex (line - 1) (T.drop (i + 1) t')-        -- i != 0, and there are no newlines, so this is a line beyond the end of the text.-        -- In this case give the "start index" as the end, so we will at least append the text.-        Nothing -> fromIntegral $ T.length t'+  -- The index of the first character of line 'line'+  startLineIndex :: UInt -> Text -> UInt+  startLineIndex 0 _ = 0+  startLineIndex line t' =+    case T.findIndex (== '\n') t' of+      Just i -> fromIntegral i + 1 + startLineIndex (line - 1) (T.drop (i + 1) t')+      -- i != 0, and there are no newlines, so this is a line beyond the end of the text.+      -- In this case give the "start index" as the end, so we will at least append the text.+      Nothing -> fromIntegral $ T.length t'  -- | 'editTextEdit' @outer@ @inner@ applies @inner@ to the text inside @outer@. editTextEdit :: TextEdit -> TextEdit -> TextEdit editTextEdit (TextEdit origRange origText) innerEdit =   let newText = applyTextEdit innerEdit origText-    in TextEdit origRange newText+   in TextEdit origRange newText  -- | Conversion between 'OptionalVersionedTextDocumentIdentifier' and 'VersionedTextDocumentIdentifier'. _versionedTextDocumentIdentifier :: Prism' OptionalVersionedTextDocumentIdentifier VersionedTextDocumentIdentifier _versionedTextDocumentIdentifier = prism down up-  where-    down (VersionedTextDocumentIdentifier uri v) = OptionalVersionedTextDocumentIdentifier uri (InL v)-    up (OptionalVersionedTextDocumentIdentifier uri (InL v)) = Right $ VersionedTextDocumentIdentifier uri v-    up i@(OptionalVersionedTextDocumentIdentifier _ (InR _)) = Left i+ where+  down (VersionedTextDocumentIdentifier uri v) = OptionalVersionedTextDocumentIdentifier uri (InL v)+  up (OptionalVersionedTextDocumentIdentifier uri (InL v)) = Right $ VersionedTextDocumentIdentifier uri v+  up i@(OptionalVersionedTextDocumentIdentifier _ (InR _)) = Left i
src/Language/LSP/Protocol/Types/Lens.hs view
@@ -1,11 +1,11 @@-{-#LANGUAGE TemplateHaskell #-}+{-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -Wno-orphans #-}  module Language.LSP.Protocol.Types.Lens where +import Control.Lens.TH import Language.LSP.Protocol.Internal.Lens import Language.LSP.Protocol.Types.SemanticTokens-import           Control.Lens.TH  makeFieldsNoPrefix ''SemanticTokenAbsolute makeFieldsNoPrefix ''SemanticTokenRelative
src/Language/LSP/Protocol/Types/Location.hs view
@@ -1,12 +1,13 @@ -- | Additional and utilities for 'Position' and 'Range'. module Language.LSP.Protocol.Types.Location where -import           Language.LSP.Protocol.Types.Common-import           Language.LSP.Protocol.Internal.Types.Position-import           Language.LSP.Protocol.Internal.Types.Range+import Language.LSP.Protocol.Internal.Types.Position+import Language.LSP.Protocol.Internal.Types.Range+import Language.LSP.Protocol.Types.Common --- | A helper function for creating ranges.--- prop> mkRange l c l' c' = Range (Position l c) (Position l' c')+{- | A helper function for creating ranges.+ prop> mkRange l c l' c' = Range (Position l c) (Position l' c')+-} mkRange :: UInt -> UInt -> UInt -> UInt -> Range mkRange l c l' c' = Range (Position l c) (Position l' c') 
src/Language/LSP/Protocol/Types/LspEnum.hs view
@@ -1,17 +1,19 @@ {-# LANGUAGE DefaultSignatures #-}-{-# LANGUAGE TypeFamilies      #-}+{-# LANGUAGE TypeFamilies #-}+ module Language.LSP.Protocol.Types.LspEnum where -import qualified Data.Aeson  as Aeson-import           Data.Kind-import qualified Data.Set    as Set-import           Data.String (IsString (..))-import qualified Data.Text   as Text+import Data.Aeson qualified as Aeson+import Data.Kind+import Data.Set qualified as Set+import Data.String (IsString (..))+import Data.Text qualified as Text --- | A class for types that represent a LSP enum type.------ This class carries conversion functions to and from the 'base type' of the enum.--- Not all base type values may have corresponding enum values.+{- | A class for types that represent a LSP enum type.++ This class carries conversion functions to and from the 'base type' of the enum.+ Not all base type values may have corresponding enum values.+-} class LspEnum a where   -- | The base type of the enum.   type EnumBaseType a :: Type@@ -29,15 +31,17 @@   default fromEnumBaseType :: (LspOpenEnum a) => EnumBaseType a -> Maybe a   fromEnumBaseType = Just . fromOpenEnumBaseType --- | A class for types that represent a LSP open enum type.------ Open enum types allow any base type value to be used as a 'custom' enum value.+{- | A class for types that represent a LSP open enum type.++ Open enum types allow any base type value to be used as a 'custom' enum value.+-} class LspEnum a => LspOpenEnum a where   -- | Convert a base type to an enum value. All base type values can be converted this way.   fromOpenEnumBaseType :: EnumBaseType a -> a --- | Newtype for @deriving via@ to get standard JSON and 'IsString' instances in terms of the 'LspEnum'--- class methods.+{- | Newtype for @deriving via@ to get standard JSON and 'IsString' instances in terms of the 'LspEnum'+ class methods.+-} newtype AsLspEnum a b = AsLspEnum a  instance (LspEnum a, EnumBaseType a ~ b, Aeson.ToJSON b) => Aeson.ToJSON (AsLspEnum a b) where@@ -47,7 +51,7 @@   parseJSON val = do     v <- Aeson.parseJSON val     case fromEnumBaseType v of-      Just x  -> pure $ AsLspEnum x+      Just x -> pure $ AsLspEnum x       Nothing -> fail $ "unrecognized enum value " ++ show v  instance (LspOpenEnum a, EnumBaseType a ~ b, b ~ Text.Text) => IsString (AsLspEnum a b) where
src/Language/LSP/Protocol/Types/MarkupContent.hs view
@@ -1,12 +1,13 @@ {-# OPTIONS_GHC -Wno-orphans #-}+ -- | Additional instances and utilities for 'MarkupContent'. module Language.LSP.Protocol.Types.MarkupContent where -import           Data.String-import           Data.Text                                       (Text)-import qualified Data.Text                                       as T-import           Language.LSP.Protocol.Internal.Types.MarkupContent-import           Language.LSP.Protocol.Internal.Types.MarkupKind+import Data.String+import Data.Text (Text)+import Data.Text qualified as T+import Language.LSP.Protocol.Internal.Types.MarkupContent+import Language.LSP.Protocol.Internal.Types.MarkupKind  -- | Create a 'MarkupContent' containing plain text. mkPlainText :: Text -> MarkupContent@@ -18,15 +19,16 @@  -- | Create a 'MarkupContent' containing a language-annotated code block only. mkMarkdownCodeBlock :: Text -> Text -> MarkupContent-mkMarkdownCodeBlock lang quote- = MarkupContent MarkupKind_Markdown ("\n```" <> lang <> "\n" <> quote <> "\n```\n")+mkMarkdownCodeBlock lang quote =+  MarkupContent MarkupKind_Markdown ("\n```" <> lang <> "\n" <> quote <> "\n```\n")  -- | Markdown for a section separator in Markdown, being a horizontal line. sectionSeparator :: Text sectionSeparator = "* * *\n" --- | Given some plaintext, convert it into some equivalent markdown text.--- This is not *quite* the identity function.+{- | Given some plaintext, convert it into some equivalent markdown text.+ This is not *quite* the identity function.+-} plainTextToMarkdown :: Text -> Text -- Line breaks in markdown paragraphs are ignored unless the line ends with two spaces. -- In order to respect the line breaks in the original plaintext, we stick two spaces on the end of every line.@@ -34,9 +36,9 @@  instance Semigroup MarkupContent where   MarkupContent MarkupKind_PlainText s1 <> MarkupContent MarkupKind_PlainText s2 = MarkupContent MarkupKind_PlainText (s1 `mappend` s2)-  MarkupContent MarkupKind_Markdown s1 <> MarkupContent MarkupKind_Markdown s2 = MarkupContent MarkupKind_Markdown  (s1 `mappend` s2)-  MarkupContent MarkupKind_PlainText s1 <> MarkupContent MarkupKind_Markdown s2 = MarkupContent MarkupKind_Markdown  (plainTextToMarkdown s1 `mappend` s2)-  MarkupContent MarkupKind_Markdown s1 <> MarkupContent MarkupKind_PlainText s2 = MarkupContent MarkupKind_Markdown  (s1 `mappend` plainTextToMarkdown s2)+  MarkupContent MarkupKind_Markdown s1 <> MarkupContent MarkupKind_Markdown s2 = MarkupContent MarkupKind_Markdown (s1 `mappend` s2)+  MarkupContent MarkupKind_PlainText s1 <> MarkupContent MarkupKind_Markdown s2 = MarkupContent MarkupKind_Markdown (plainTextToMarkdown s1 `mappend` s2)+  MarkupContent MarkupKind_Markdown s1 <> MarkupContent MarkupKind_PlainText s2 = MarkupContent MarkupKind_Markdown (s1 `mappend` plainTextToMarkdown s2)  instance Monoid MarkupContent where   mempty = MarkupContent MarkupKind_PlainText ""
src/Language/LSP/Protocol/Types/Orphans.hs view
@@ -1,9 +1,10 @@ {-# OPTIONS_GHC -Wno-orphans #-}+ module Language.LSP.Protocol.Types.Orphans where -import           Language.LSP.Protocol.Internal.Types-import           Data.Default-import           Data.Semigroup                ()+import Data.Default+import Data.Semigroup ()+import Language.LSP.Protocol.Internal.Types  instance Semigroup WorkspaceEdit where   (WorkspaceEdit a b c) <> (WorkspaceEdit a' b' c') = WorkspaceEdit (a <> a') (b <> b') (c <> c')@@ -11,10 +12,10 @@   mempty = WorkspaceEdit Nothing Nothing Nothing  instance Default ClientCapabilities where-    def = ClientCapabilities def def def def def Nothing+  def = ClientCapabilities def def def def def Nothing instance Default WorkspaceClientCapabilities instance Default TextDocumentClientCapabilities-instance Default NotebookDocumentClientCapabilities where+instance Default NotebookDocumentClientCapabilities instance Default NotebookDocumentSyncClientCapabilities instance Default WindowClientCapabilities instance Default GeneralClientCapabilities
src/Language/LSP/Protocol/Types/Progress.hs view
@@ -1,22 +1,22 @@-module Language.LSP.Protocol.Types.Progress-  ( _workDoneProgressBegin-  , _workDoneProgressEnd-  , _workDoneProgressReport-  )-  where+module Language.LSP.Protocol.Types.Progress (+  _workDoneProgressBegin,+  _workDoneProgressEnd,+  _workDoneProgressReport,+)+where -import           Control.Lens-import           Data.Aeson+import Control.Lens+import Data.Aeson -import           Language.LSP.Protocol.Internal.Types.WorkDoneProgressBegin-import           Language.LSP.Protocol.Internal.Types.WorkDoneProgressEnd-import           Language.LSP.Protocol.Internal.Types.WorkDoneProgressReport+import Language.LSP.Protocol.Internal.Types.WorkDoneProgressBegin+import Language.LSP.Protocol.Internal.Types.WorkDoneProgressEnd+import Language.LSP.Protocol.Internal.Types.WorkDoneProgressReport  -- From lens-aeson _JSON :: (ToJSON a, FromJSON a) => Prism' Value a _JSON = prism toJSON $ \x -> case fromJSON x of-    Success y -> Right y;-    _         -> Left x+  Success y -> Right y+  _ -> Left x  -- | Prism for extracting the 'WorkDoneProgressBegin' case from the unstructured 'value' field of 'ProgressParams'. _workDoneProgressBegin :: Prism' Value WorkDoneProgressBegin
src/Language/LSP/Protocol/Types/SemanticTokens.hs view
@@ -1,162 +1,176 @@ {-# LANGUAGE DuplicateRecordFields #-}-{-# LANGUAGE OverloadedLists       #-}-{-# LANGUAGE OverloadedStrings     #-}-{-# LANGUAGE ScopedTypeVariables   #-}+{-# LANGUAGE OverloadedLists #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE ScopedTypeVariables #-}+ module Language.LSP.Protocol.Types.SemanticTokens where -import           Data.Text                                                (Text)+import Data.Text (Text) -import           Control.Monad.Except+import Control.Monad.Except -import           Language.LSP.Protocol.Types.Common-import           Language.LSP.Protocol.Internal.Types.SemanticTokenModifiers-import           Language.LSP.Protocol.Internal.Types.SemanticTokens-import           Language.LSP.Protocol.Internal.Types.SemanticTokensDelta-import           Language.LSP.Protocol.Internal.Types.SemanticTokensEdit-import           Language.LSP.Protocol.Internal.Types.SemanticTokensLegend-import           Language.LSP.Protocol.Internal.Types.SemanticTokenTypes-import           Language.LSP.Protocol.Types.LspEnum+import Language.LSP.Protocol.Internal.Types.SemanticTokenModifiers+import Language.LSP.Protocol.Internal.Types.SemanticTokenTypes+import Language.LSP.Protocol.Internal.Types.SemanticTokens+import Language.LSP.Protocol.Internal.Types.SemanticTokensDelta+import Language.LSP.Protocol.Internal.Types.SemanticTokensEdit+import Language.LSP.Protocol.Internal.Types.SemanticTokensLegend+import Language.LSP.Protocol.Types.Common+import Language.LSP.Protocol.Types.LspEnum -import qualified Data.Algorithm.Diff                                      as Diff-import qualified Data.Bits                                                as Bits-import qualified Data.DList                                               as DList-import           Data.Foldable                                            hiding-                                                                          (length)-import qualified Data.Map                                                 as Map-import           Data.Maybe                                               (fromMaybe,-                                                                           maybeToList)-import           Data.String+import Data.Algorithm.Diff qualified as Diff+import Data.Bits qualified as Bits+import Data.DList qualified as DList+import Data.Foldable hiding (+  length,+ )+import Data.Map qualified as Map+import Data.Maybe (+  fromMaybe,+  maybeToList,+ )+import Data.String  defaultSemanticTokensLegend :: SemanticTokensLegend-defaultSemanticTokensLegend = SemanticTokensLegend-  (fmap toEnumBaseType . toList $ knownValues @SemanticTokenTypes)-  (fmap toEnumBaseType . toList $ knownValues @SemanticTokenModifiers)+defaultSemanticTokensLegend =+  SemanticTokensLegend+    (fmap toEnumBaseType . toList $ knownValues @SemanticTokenTypes)+    (fmap toEnumBaseType . toList $ knownValues @SemanticTokenModifiers)  ---------------------------------------------------------- -- Tools for working with semantic tokens. ---------------------------------------------------------- --- | A single 'semantic token' as described in the LSP specification, using absolute positions.--- This is the kind of token that is usually easiest for editors to produce.-data SemanticTokenAbsolute = SemanticTokenAbsolute {-  _line           :: UInt,-  _startChar      :: UInt,-  _length         :: UInt,-  _tokenType      :: SemanticTokenTypes,-  _tokenModifiers :: [SemanticTokenModifiers]-} deriving stock (Show, Eq, Ord)+{- | A single 'semantic token' as described in the LSP specification, using absolute positions.+ This is the kind of token that is usually easiest for editors to produce.+-}+data SemanticTokenAbsolute = SemanticTokenAbsolute+  { _line :: UInt+  , _startChar :: UInt+  , _length :: UInt+  , _tokenType :: SemanticTokenTypes+  , _tokenModifiers :: [SemanticTokenModifiers]+  }+  deriving stock (Show, Eq, Ord)+ -- Note: we want the Ord instance to sort the tokens textually: this is achieved due to the -- order of the constructors  -- | A single 'semantic token' as described in the LSP specification, using relative positions.-data SemanticTokenRelative = SemanticTokenRelative {-  _deltaLine      :: UInt,-  _deltaStartChar :: UInt,-  _length         :: UInt,-  _tokenType      :: SemanticTokenTypes,-  _tokenModifiers :: [SemanticTokenModifiers]-} deriving stock (Show, Eq, Ord)+data SemanticTokenRelative = SemanticTokenRelative+  { _deltaLine :: UInt+  , _deltaStartChar :: UInt+  , _length :: UInt+  , _tokenType :: SemanticTokenTypes+  , _tokenModifiers :: [SemanticTokenModifiers]+  }+  deriving stock (Show, Eq, Ord)+ -- Note: we want the Ord instance to sort the tokens textually: this is achieved due to the -- order of the constructors --- | Turn a list of absolutely-positioned tokens into a list of relatively-positioned tokens. The tokens are assumed to be in the--- order that they appear in the document!+{- | Turn a list of absolutely-positioned tokens into a list of relatively-positioned tokens. The tokens are assumed to be in the+ order that they appear in the document!+-} relativizeTokens :: [SemanticTokenAbsolute] -> [SemanticTokenRelative] relativizeTokens xs = DList.toList $ go 0 0 xs mempty-  where-    -- Pass an accumulator to make this tail-recursive-    go :: UInt -> UInt -> [SemanticTokenAbsolute] -> DList.DList SemanticTokenRelative -> DList.DList SemanticTokenRelative-    go _ _ [] acc = acc-    go lastLine lastChar (SemanticTokenAbsolute l c len ty mods:ts) acc =-      let-        lastCharInLine = if l == lastLine then lastChar else 0-        dl = l - lastLine-        dc = c - lastCharInLine-      in go l c ts (DList.snoc acc (SemanticTokenRelative dl dc len ty mods))+ where+  -- Pass an accumulator to make this tail-recursive+  go :: UInt -> UInt -> [SemanticTokenAbsolute] -> DList.DList SemanticTokenRelative -> DList.DList SemanticTokenRelative+  go _ _ [] acc = acc+  go lastLine lastChar (SemanticTokenAbsolute l c len ty mods : ts) acc =+    let+      lastCharInLine = if l == lastLine then lastChar else 0+      dl = l - lastLine+      dc = c - lastCharInLine+     in+      go l c ts (DList.snoc acc (SemanticTokenRelative dl dc len ty mods)) --- | Turn a list of relatively-positioned tokens into a list of absolutely-positioned tokens. The tokens are assumed to be in the--- order that they appear in the document!+{- | Turn a list of relatively-positioned tokens into a list of absolutely-positioned tokens. The tokens are assumed to be in the+ order that they appear in the document!+-} absolutizeTokens :: [SemanticTokenRelative] -> [SemanticTokenAbsolute] absolutizeTokens xs = DList.toList $ go 0 0 xs mempty-  where-    -- Pass an accumulator to make this tail-recursive-    go :: UInt -> UInt -> [SemanticTokenRelative] -> DList.DList SemanticTokenAbsolute -> DList.DList SemanticTokenAbsolute-    go _ _ [] acc = acc-    go lastLine lastChar (SemanticTokenRelative dl dc len ty mods:ts) acc =-      let-        lastCharInLine = if dl == 0 then lastChar else 0-        l = lastLine + dl-        c = lastCharInLine + dc-      in go l c ts (DList.snoc acc (SemanticTokenAbsolute l c len ty mods))+ where+  -- Pass an accumulator to make this tail-recursive+  go :: UInt -> UInt -> [SemanticTokenRelative] -> DList.DList SemanticTokenAbsolute -> DList.DList SemanticTokenAbsolute+  go _ _ [] acc = acc+  go lastLine lastChar (SemanticTokenRelative dl dc len ty mods : ts) acc =+    let+      lastCharInLine = if dl == 0 then lastChar else 0+      l = lastLine + dl+      c = lastCharInLine + dc+     in+      go l c ts (DList.snoc acc (SemanticTokenAbsolute l c len ty mods))  -- | Encode a series of relatively-positioned semantic tokens into an integer array following the given legend. encodeTokens :: SemanticTokensLegend -> [SemanticTokenRelative] -> Either Text [UInt]-encodeTokens SemanticTokensLegend{_tokenTypes=tts,_tokenModifiers=tms} sts =+encodeTokens SemanticTokensLegend{_tokenTypes = tts, _tokenModifiers = tms} sts =   DList.toList . DList.concat <$> traverse encodeToken sts-  where-    -- Note that there's no "fast" version of these (e.g. backed by an IntMap or similar)-    -- in general, due to the possibility  of unknown token types which are only identified by strings.-    tyMap :: Map.Map SemanticTokenTypes UInt-    tyMap = Map.fromList $ zip (fmap fromOpenEnumBaseType tts) [0..]-    modMap :: Map.Map SemanticTokenModifiers Int-    modMap = Map.fromList $ zip (fmap fromOpenEnumBaseType tms) [0..]+ where+  -- Note that there's no "fast" version of these (e.g. backed by an IntMap or similar)+  -- in general, due to the possibility  of unknown token types which are only identified by strings.+  tyMap :: Map.Map SemanticTokenTypes UInt+  tyMap = Map.fromList $ zip (fmap fromOpenEnumBaseType tts) [0 ..]+  modMap :: Map.Map SemanticTokenModifiers Int+  modMap = Map.fromList $ zip (fmap fromOpenEnumBaseType tms) [0 ..] -    lookupTy :: SemanticTokenTypes -> Either Text UInt-    lookupTy ty = case Map.lookup ty tyMap of-        Just tycode -> pure tycode-        Nothing -> throwError $ "Semantic token type " <> fromString (show ty) <> " did not appear in the legend"-    lookupMod :: SemanticTokenModifiers -> Either Text Int-    lookupMod modifier = case Map.lookup modifier modMap of-        Just modcode -> pure modcode-        Nothing -> throwError $ "Semantic token modifier " <> fromString (show modifier) <> " did not appear in the legend"+  lookupTy :: SemanticTokenTypes -> Either Text UInt+  lookupTy ty = case Map.lookup ty tyMap of+    Just tycode -> pure tycode+    Nothing -> throwError $ "Semantic token type " <> fromString (show ty) <> " did not appear in the legend"+  lookupMod :: SemanticTokenModifiers -> Either Text Int+  lookupMod modifier = case Map.lookup modifier modMap of+    Just modcode -> pure modcode+    Nothing -> throwError $ "Semantic token modifier " <> fromString (show modifier) <> " did not appear in the legend" -    -- Use a DList here for better efficiency when concatenating all these together-    encodeToken :: SemanticTokenRelative -> Either Text (DList.DList UInt)-    encodeToken (SemanticTokenRelative dl dc len ty mods) = do-      tycode <- lookupTy ty-      modcodes <- traverse lookupMod mods-      let combinedModcode :: Int = foldl' Bits.setBit Bits.zeroBits modcodes+  -- Use a DList here for better efficiency when concatenating all these together+  encodeToken :: SemanticTokenRelative -> Either Text (DList.DList UInt)+  encodeToken (SemanticTokenRelative dl dc len ty mods) = do+    tycode <- lookupTy ty+    modcodes <- traverse lookupMod mods+    let combinedModcode :: Int = foldl' Bits.setBit Bits.zeroBits modcodes -      pure [dl, dc, len, tycode, fromIntegral combinedModcode ]+    pure [dl, dc, len, tycode, fromIntegral combinedModcode]  -- This is basically 'SemanticTokensEdit', but slightly easier to work with.+ -- | An edit to a buffer of items.-data Edit a = Edit { editStart :: UInt, editDeleteCount :: UInt, editInsertions :: [a] }+data Edit a = Edit {editStart :: UInt, editDeleteCount :: UInt, editInsertions :: [a]}   deriving stock (Read, Show, Eq, Ord)  -- | Compute a list of edits that will turn the first list into the second list. computeEdits :: Eq a => [a] -> [a] -> [Edit a] computeEdits l r = DList.toList $ go 0 Nothing (Diff.getGroupedDiff l r) mempty-  where-    {--    Strategy: traverse the list of diffs, keeping the current index and (maybe) an in-progress 'Edit'.-    Whenever we see a 'Diff' that's only one side or the other, we can bundle that in to our in-progress-    'Edit'. We only have to stop if we see a 'Diff' that's on both sides (i.e. unchanged), then we-    dump the 'Edit' into the accumulator.-    We need the index, because 'Edit's need to say where they start.-    -}-    go :: UInt -> Maybe (Edit a) -> [Diff.Diff [a]] -> DList.DList (Edit a) -> DList.DList (Edit a)-    -- No more diffs: append the current edit if there is one and return-    go _ e [] acc = acc <> DList.fromList (maybeToList e)--    -- Items only on the left (i.e. deletions): increment the current index, and record the count of deletions,-    -- starting a new edit if necessary.-    go ix e (Diff.First ds : rest) acc =-      let-        deleteCount = fromIntegral $ Prelude.length ds-        edit = fromMaybe (Edit ix 0 []) e-      in go (ix + deleteCount) (Just (edit{editDeleteCount=editDeleteCount edit + deleteCount})) rest acc-    -- Items only on the right (i.e. insertions): don't increment the current index, and record the insertions,-    -- starting a new edit if necessary.-    go ix e (Diff.Second as : rest) acc =-      let edit = fromMaybe (Edit ix 0 []) e-      in go ix (Just (edit{editInsertions=editInsertions edit <> as})) rest acc--    -- Items on both sides: increment the current index appropriately (since the items appear on the left),-    -- and append the current edit (if there is one) to our list of edits (since we can't continue it with a break).-    go ix e (Diff.Both bs _bs : rest) acc =-      let bothCount = fromIntegral $ Prelude.length bs-      in go (ix + bothCount) Nothing rest (acc <> DList.fromList (maybeToList e))+ where+  {-+  Strategy: traverse the list of diffs, keeping the current index and (maybe) an in-progress 'Edit'.+  Whenever we see a 'Diff' that's only one side or the other, we can bundle that in to our in-progress+  'Edit'. We only have to stop if we see a 'Diff' that's on both sides (i.e. unchanged), then we+  dump the 'Edit' into the accumulator.+  We need the index, because 'Edit's need to say where they start.+  -}+  go :: UInt -> Maybe (Edit a) -> [Diff.Diff [a]] -> DList.DList (Edit a) -> DList.DList (Edit a)+  -- No more diffs: append the current edit if there is one and return+  go _ e [] acc = acc <> DList.fromList (maybeToList e)+  -- Items only on the left (i.e. deletions): increment the current index, and record the count of deletions,+  -- starting a new edit if necessary.+  go ix e (Diff.First ds : rest) acc =+    let+      deleteCount = fromIntegral $ Prelude.length ds+      edit = fromMaybe (Edit ix 0 []) e+     in+      go (ix + deleteCount) (Just (edit{editDeleteCount = editDeleteCount edit + deleteCount})) rest acc+  -- Items only on the right (i.e. insertions): don't increment the current index, and record the insertions,+  -- starting a new edit if necessary.+  go ix e (Diff.Second as : rest) acc =+    let edit = fromMaybe (Edit ix 0 []) e+     in go ix (Just (edit{editInsertions = editInsertions edit <> as})) rest acc+  -- Items on both sides: increment the current index appropriately (since the items appear on the left),+  -- and append the current edit (if there is one) to our list of edits (since we can't continue it with a break).+  go ix e (Diff.Both bs _bs : rest) acc =+    let bothCount = fromIntegral $ Prelude.length bs+     in go (ix + bothCount) Nothing rest (acc <> DList.fromList (maybeToList e))  -- | Convenience method for making a 'SemanticTokens' from a list of 'SemanticTokenAbsolute's. An error may be returned if @@ -166,10 +180,11 @@   encoded <- encodeTokens legend $ relativizeTokens sts   pure $ SemanticTokens Nothing encoded --- | Convenience function for making a 'SemanticTokensDelta' from a previous and current 'SemanticTokens'.--- The resulting 'SemanticTokensDelta' lacks a result ID, which must be set separately if you are using that.+{- | Convenience function for making a 'SemanticTokensDelta' from a previous and current 'SemanticTokens'.+ The resulting 'SemanticTokensDelta' lacks a result ID, which must be set separately if you are using that.+-} makeSemanticTokensDelta :: SemanticTokens -> SemanticTokens -> SemanticTokensDelta-makeSemanticTokensDelta SemanticTokens{_data_=prevTokens} SemanticTokens{_data_=curTokens} =+makeSemanticTokensDelta SemanticTokens{_data_ = prevTokens} SemanticTokens{_data_ = curTokens} =   let edits = computeEdits prevTokens curTokens       stEdits = fmap (\(Edit s ds as) -> SemanticTokensEdit s ds (Just as)) edits-  in SemanticTokensDelta Nothing stEdits+   in SemanticTokensDelta Nothing stEdits
src/Language/LSP/Protocol/Types/Singletons.hs view

file too large to diff

src/Language/LSP/Protocol/Types/Uri.hs view

file too large to diff

src/Language/LSP/Protocol/Types/Uri/OsPath.hs view

file too large to diff

src/Language/LSP/Protocol/Types/WatchKinds.hs view

file too large to diff

src/Language/LSP/Protocol/Utils/Misc.hs view

file too large to diff

src/Language/LSP/Protocol/Utils/SMethodMap.hs view

file too large to diff

test/CapabilitiesSpec.hs view

file too large to diff

test/JsonSpec.hs view

file too large to diff

test/LocationSpec.hs view

file too large to diff

test/Main.hs view

file too large to diff

test/MethodSpec.hs view

file too large to diff

test/SemanticTokensSpec.hs view

file too large to diff

test/ServerCapabilitiesSpec.hs view

file too large to diff

test/Spec.hs view

file too large to diff

test/TypesSpec.hs view

file too large to diff

test/URIFilePathSpec.hs view

file too large to diff

test/WorkspaceEditSpec.hs view

file too large to diff