Skip to content

Commit a1c7dff

Browse files
authored
Merge pull request #496 from haskell/mpj/no-deprecate-fields
Don't deprecate fields
2 parents e9d2cff + 25d2eb4 commit a1c7dff

File tree

8 files changed

+15
-10
lines changed

8 files changed

+15
-10
lines changed

lsp-types/ChangeLog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Revision history for lsp-types
22

3+
## 2.0.0.2
4+
5+
* Removed deprecation pragmas from fields, as these cannot currently be avoided.
6+
7+
## 2.0.0.1
8+
9+
* Fixed missing `extra-source-files` for `metamodel.json`.
10+
311
## 2.0.0.0
412

513
* Breaking change: major restructure to generate types and methods from the LSP metamodel.

lsp-types/generated/Language/LSP/Protocol/Internal/Types/CompletionItem.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import qualified Language.LSP.Protocol.Internal.Types.MarkupContent
2424
import qualified Language.LSP.Protocol.Internal.Types.TextEdit
2525
import qualified Language.LSP.Protocol.Types.Common
2626

27-
{-# DEPRECATED _deprecated "Use `tags` instead." #-}
2827
{-|
2928
A completion item represents a text snippet that is
3029
proposed to complete text that is being typed.

lsp-types/generated/Language/LSP/Protocol/Internal/Types/DocumentSymbol.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import qualified Language.LSP.Protocol.Internal.Types.SymbolKind
1717
import qualified Language.LSP.Protocol.Internal.Types.SymbolTag
1818
import qualified Language.LSP.Protocol.Types.Common
1919

20-
{-# DEPRECATED _deprecated "Use tags instead" #-}
2120
{-|
2221
Represents programming constructs like variables, classes, interfaces etc.
2322
that appear in a document. Document symbols can be hierarchical and they

lsp-types/generated/Language/LSP/Protocol/Internal/Types/InitializeParams.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import qualified Language.LSP.Protocol.Internal.Types.WorkspaceFolder
2121
import qualified Language.LSP.Protocol.Types.Common
2222
import qualified Language.LSP.Protocol.Types.Uri
2323

24-
{-# DEPRECATED _rootPath "in favour of rootUri." #-}
25-
{-# DEPRECATED _rootUri "in favour of workspaceFolders." #-}
2624
{-|
2725
2826
-}

lsp-types/generated/Language/LSP/Protocol/Internal/Types/SymbolInformation.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import qualified Language.LSP.Protocol.Internal.Types.SymbolKind
1717
import qualified Language.LSP.Protocol.Internal.Types.SymbolTag
1818
import qualified Language.LSP.Protocol.Types.Common
1919

20-
{-# DEPRECATED _deprecated "Use tags instead" #-}
2120
{-|
2221
Represents information about programming constructs like variables, classes,
2322
interfaces etc.

lsp-types/generated/Language/LSP/Protocol/Internal/Types/UInitializeParams.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ import qualified Language.LSP.Protocol.Internal.Types.TraceValues
2020
import qualified Language.LSP.Protocol.Types.Common
2121
import qualified Language.LSP.Protocol.Types.Uri
2222

23-
{-# DEPRECATED _rootPath "in favour of rootUri." #-}
24-
{-# DEPRECATED _rootUri "in favour of workspaceFolders." #-}
2523
{-|
2624
The initialize parameters
2725
-}

lsp-types/generator/CodeGen.hs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,12 @@ printStruct tn s@Structure{name, documentation, since, proposed, deprecated} = d
295295
propDoc <- multilineHaddock . pretty <$> mkDocumentation documentation since proposed
296296
pure $ hardvcat [propDoc, pretty n <+> "::" <+> mty]
297297

298-
-- Annoyingly, this won't deprecate the lens, which is defined somewhere else entirely. Unclear what to do about that.
299-
let deprecations = optDeprecated tn deprecated ++ (flip concatMap props $ \Property{name, deprecated} -> optDeprecated (makeFieldName name) deprecated)
298+
-- We do *not* deprecate fields. We can't really represent this properly: typically a deprecated field
299+
-- is optional, and the "correct" thing to do is to omit it. But in our representaiton that means passing
300+
-- Nothing as the value, which counts as "using" the field. So there is no way for users to avoid the
301+
-- deprecation warning, which is silly. To do this properly we'd need to do something clever with
302+
-- pattern synonyms maybe?
303+
let deprecations = optDeprecated tn deprecated
300304

301305
ensureImport "GHC.Generics" Unqual
302306
ensureImport "Control.DeepSeq" Unqual

lsp-types/lsp-types.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 3.0
22
name: lsp-types
3-
version: 2.0.0.1
3+
version: 2.0.0.2
44
synopsis:
55
Haskell library for the Microsoft Language Server Protocol, data types
66

0 commit comments

Comments
 (0)