Skip to content

Commit

Permalink
LSP Protocol: Add note re. JSON attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
mhutch committed Jun 17, 2024
1 parent 9098078 commit 1b41857
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ internal interface IPartialResultParams<T>
/// An <see cref="IProgress{T}"/> instance that can be used to report partial results
/// via the <c>$/progress</c> notification.
/// </summary>
// NOTE: these JSON attributes are not inherited, they are here as a reference for implementations
[JsonPropertyName(Methods.PartialResultTokenName)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IProgress<T>? PartialResultToken { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ internal interface IStaticRegistrationOptions
/// <summary>
/// Gets or sets the id used to register the request. The id can be used to deregister the request again.
/// </summary>
// NOTE: these JSON attributes are not inherited, they are here as a reference for implementations
[JsonPropertyName("id")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Id { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ internal interface ITextDocumentParams
/// <summary>
/// The identifier of the document.
/// </summary>
// NOTE: these JSON attributes are not inherited, they are here as a reference for implementations
[JsonPropertyName("textDocument")]
[JsonRequired]
public TextDocumentIdentifier TextDocument { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ internal interface ITextDocumentPositionParams : ITextDocumentParams
/// <summary>
/// The position within the document.
/// </summary>
// NOTE: these JSON attributes are not inherited, they are here as a reference for implementations
[JsonPropertyName("position")]
[JsonRequired]
public Position Position { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ internal interface ITextDocumentRegistrationOptions
/// A document selector to identify the scope of the registration. If set to
/// <see langword="null"/> the document selector provided on the client side will be used.
/// </summary>
// NOTE: these JSON attributes are not inherited, they are here as a reference for implementations
[JsonPropertyName("documentSelector")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public DocumentFilter[]? DocumentSelector { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ internal interface IWorkDoneProgressOptions
/// </para>
/// </summary>
/// <remarks>Since LSP 3.15</remarks>
// NOTE: these JSON attributes are not inherited, they are here as a reference for implementations
[JsonPropertyName("workDoneProgress")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public bool WorkDoneProgress { get; init; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ internal interface IWorkDoneProgressParams
/// </para>
/// </summary>
/// <remarks>Since LSP 3.15</remarks>
// NOTE: these JSON attributes are not inherited, they are here as a reference for implementations
[JsonPropertyName(Methods.WorkDoneTokenName)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IProgress<WorkDoneProgress>? WorkDoneToken { get; set; }
Expand Down

0 comments on commit 1b41857

Please sign in to comment.