lsp-types 2.0.0.1 → 2.0.1.0
raw patch · 9 files changed
+24/−12 lines, 9 filesdep ~hashablePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: hashable
API changes (from Hackage documentation)
+ Language.LSP.Protocol.Message: isOptionalMethod :: SomeMethod -> Bool
- Language.LSP.Protocol.Message: regHelper :: forall m_abb7L x_abb7M. SMethod m_abb7L -> (Show (RegistrationOptions m_abb7L) => ToJSON (RegistrationOptions m_abb7L) => FromJSON (RegistrationOptions m_abb7L) => x_abb7M) -> x_abb7M
+ Language.LSP.Protocol.Message: regHelper :: forall m_abb9i x_abb9j. SMethod m_abb9i -> (Show (RegistrationOptions m_abb9i) => ToJSON (RegistrationOptions m_abb9i) => FromJSON (RegistrationOptions m_abb9i) => x_abb9j) -> x_abb9j
Files
- ChangeLog.md +9/−0
- generated/Language/LSP/Protocol/Internal/Types/CompletionItem.hs +0/−1
- generated/Language/LSP/Protocol/Internal/Types/DocumentSymbol.hs +0/−1
- generated/Language/LSP/Protocol/Internal/Types/InitializeParams.hs +0/−2
- generated/Language/LSP/Protocol/Internal/Types/SymbolInformation.hs +0/−1
- generated/Language/LSP/Protocol/Internal/Types/UInitializeParams.hs +0/−2
- generator/CodeGen.hs +6/−2
- lsp-types.cabal +3/−3
- src/Language/LSP/Protocol/Message/Method.hs +6/−0
ChangeLog.md view
@@ -1,5 +1,14 @@ # Revision history for lsp-types +## 2.0.1.0++* Removed deprecation pragmas from fields, as these cannot currently be avoided.+* Added `isOptionalMethod`, that checks whether a method is optional according to the spec.++## 2.0.0.1++* Fixed missing `extra-source-files` for `metamodel.json`.+ ## 2.0.0.0 * Breaking change: major restructure to generate types and methods from the LSP metamodel.
generated/Language/LSP/Protocol/Internal/Types/CompletionItem.hs view
@@ -24,7 +24,6 @@ import qualified Language.LSP.Protocol.Internal.Types.TextEdit import qualified Language.LSP.Protocol.Types.Common -{-# DEPRECATED _deprecated "Use `tags` instead." #-} {-| A completion item represents a text snippet that is proposed to complete text that is being typed.
generated/Language/LSP/Protocol/Internal/Types/DocumentSymbol.hs view
@@ -17,7 +17,6 @@ import qualified Language.LSP.Protocol.Internal.Types.SymbolTag import qualified Language.LSP.Protocol.Types.Common -{-# DEPRECATED _deprecated "Use tags instead" #-} {-| Represents programming constructs like variables, classes, interfaces etc. that appear in a document. Document symbols can be hierarchical and they
generated/Language/LSP/Protocol/Internal/Types/InitializeParams.hs view
@@ -21,8 +21,6 @@ import qualified Language.LSP.Protocol.Types.Common import qualified Language.LSP.Protocol.Types.Uri -{-# DEPRECATED _rootPath "in favour of rootUri." #-}-{-# DEPRECATED _rootUri "in favour of workspaceFolders." #-} {-| -}
generated/Language/LSP/Protocol/Internal/Types/SymbolInformation.hs view
@@ -17,7 +17,6 @@ import qualified Language.LSP.Protocol.Internal.Types.SymbolTag import qualified Language.LSP.Protocol.Types.Common -{-# DEPRECATED _deprecated "Use tags instead" #-} {-| Represents information about programming constructs like variables, classes, interfaces etc.
generated/Language/LSP/Protocol/Internal/Types/UInitializeParams.hs view
@@ -20,8 +20,6 @@ import qualified Language.LSP.Protocol.Types.Common import qualified Language.LSP.Protocol.Types.Uri -{-# DEPRECATED _rootPath "in favour of rootUri." #-}-{-# DEPRECATED _rootUri "in favour of workspaceFolders." #-} {-| The initialize parameters -}
generator/CodeGen.hs view
@@ -295,8 +295,12 @@ propDoc <- multilineHaddock . pretty <$> mkDocumentation documentation since proposed pure $ hardvcat [propDoc, pretty n <+> "::" <+> mty] - -- Annoyingly, this won't deprecate the lens, which is defined somewhere else entirely. Unclear what to do about that.- let deprecations = optDeprecated tn deprecated ++ (flip concatMap props $ \Property{name, deprecated} -> optDeprecated (makeFieldName name) deprecated)+ -- 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+ -- Nothing as the value, which counts as "using" the field. So there is no way for users to avoid the+ -- deprecation warning, which is silly. To do this properly we'd need to do something clever with+ -- pattern synonyms maybe?+ let deprecations = optDeprecated tn deprecated ensureImport "GHC.Generics" Unqual ensureImport "Control.DeepSeq" Unqual
lsp-types.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: lsp-types-version: 2.0.0.1+version: 2.0.1.0 synopsis: Haskell library for the Microsoft Language Server Protocol, data types @@ -68,7 +68,7 @@ UndecidableInstances build-depends:- , aeson >=1.2.2.0+ , aeson >=1.2.2.0 && <2.2 , base >=4.11 && <5 , binary , containers@@ -77,7 +77,7 @@ , Diff >=0.2 , dlist , exceptions- , hashable+ , hashable >=1.3.4.0 , lens >=4.15.2 , mod , mtl <2.4
src/Language/LSP/Protocol/Message/Method.hs view
@@ -14,6 +14,7 @@ import Data.Aeson.Types import Data.Function (on)+import Data.List (isPrefixOf) import Data.GADT.Compare import Data.Proxy import Data.Type.Equality@@ -28,6 +29,11 @@ --------------- -- SomeMethod ---------------++-- | Is this an "optional" method which servers and clients are allowed to ignore?+isOptionalMethod :: SomeMethod -> Bool+-- See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#dollarRequests+isOptionalMethod m = "$/" `isPrefixOf` someMethodToMethodString m deriving stock instance Show SomeMethod instance Eq SomeMethod where