Skip to content

Commit a112131

Browse files
committed
Don't deprecate fields
As reported on IRC, this is silly since there's no way to avoid the deprecation warning.
1 parent e9d2cff commit a112131

File tree

6 files changed

+6
-9
lines changed

6 files changed

+6
-9
lines changed

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

0 commit comments

Comments
 (0)