Skip to content

Commit 33e881d

Browse files
razzmatazzbaronfel
authored andcommitted
src/Types.fs: Do not use Obsolete attribute to annotate deprecated types in LSP
Language servers may still need/want to support deprecated types for older clients which results in unnecessary obsoletion warnings from the compiler.
1 parent 79a884c commit 33e881d

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

src/Types.fs

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ type SymbolTag =
196196

197197
/// Represents information about programming constructs like variables, classes,
198198
/// interfaces etc.
199-
[<Obsolete("Use DocumentSymbol or WorkspaceSymbol instead.")>]
199+
///
200+
/// Deprecated: use DocumentSymbol or WorkspaceSymbol instead.
200201
type SymbolInformation =
201202
{
202203
/// The name of this symbol.
@@ -209,7 +210,8 @@ type SymbolInformation =
209210
Tags: SymbolTag[] option
210211

211212
/// Indicates if this symbol is deprecated.
212-
[<Obsolete("Use Tags instead")>]
213+
///
214+
/// Deprecated: Use Tags instead
213215
Deprecated: bool option
214216

215217
/// The location of this symbol. The location's range is used by a tool
@@ -247,7 +249,8 @@ type DocumentSymbol =
247249
/// tags for this document symbol.
248250
Tags: SymbolTag[] option
249251
/// Indicates if this symbol is deprecated.
250-
[<Obsolete("Use Tags instead")>]
252+
///
253+
/// Deprecated: Use Tags instead
251254
Deprecated: bool option
252255
/// The range enclosing this symbol not including leading/trailing whitespace
253256
/// but everything else like comments. This information is typically used to
@@ -1440,11 +1443,13 @@ type InitializeParams =
14401443
/// https://en.wikipedia.org/wiki/IETF_language_tag)
14411444
Locale: string option
14421445
/// The rootPath of the workspace. Is null if no folder is open.
1443-
[<Obsolete("Use RootUri instead")>]
1446+
///
1447+
/// Deprecated: Use RootUri instead
14441448
RootPath: string option
14451449
/// The rootUri of the workspace. Is null if no folder is open. If both
14461450
/// `rootPath` and `rootUri` are set `rootUri` wins.
1447-
[<Obsolete("Use WorkspaceFolders instead")>]
1451+
///
1452+
/// Deprecated: Use WorkspaceFolders instead
14481453
RootUri: string option
14491454
/// User provided initialization options.
14501455
InitializationOptions: JToken option
@@ -2328,10 +2333,11 @@ type MarkedStringData = { Language: string; Value: string }
23282333
///
23292334
/// Note that markdown strings will be sanitized - that means html will be
23302335
/// escaped.
2336+
///
2337+
/// Deprecated: Use MarkupContent instead
23312338
/// </summary>
23322339
[<ErasedUnion>]
23332340
[<RequireQualifiedAccess>]
2334-
[<Obsolete("Use MarkupContent instead")>]
23352341
type MarkedString =
23362342
| String of string
23372343
| WithLanguage of MarkedStringData
@@ -2387,7 +2393,8 @@ type TextDocumentContentChangeEvent =
23872393
Range: Range option
23882394

23892395
/// The length of the range that got replaced.
2390-
[<Obsolete("Use Range instead")>]
2396+
///
2397+
/// Deprecated: Use Range instead
23912398
RangeLength: int option
23922399

23932400
/// The new text of the range/document.
@@ -2566,7 +2573,8 @@ type CompletionItem =
25662573
Documentation: Documentation option
25672574

25682575
/// Indicates if this item is deprecated.
2569-
[<Obsolete("Use Tags instead if supported")>]
2576+
///
2577+
/// Deprecated: Use Tags instead if supported
25702578
Deprecated: bool option
25712579

25722580
/// Select this item when showing.
@@ -2592,8 +2600,8 @@ type CompletionItem =
25922600
/// and a completion item with an `insertText` of `console` is provided it
25932601
/// will only insert `sole`. Therefore it is recommended to use `textEdit` instead
25942602
/// since it avoids additional client side interpretation.
2595-
2596-
[<Obsolete("Use TextEdit instead")>]
2603+
///
2604+
/// Deprecated: Use TextEdit instead
25972605
InsertText: string option
25982606

25992607
/// The format of the insert text. The format applies to both the `insertText` property

0 commit comments

Comments
 (0)