Skip to content

Commit 348897d

Browse files
committed
Apply remaining 3.17 updates.
1 parent 04aa637 commit 348897d

40 files changed

+533
-165
lines changed

.build/.build.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="JetBrains.ReSharper.CommandLineTools" ExcludeAssets="All" />
1514
<PackageReference Include="GitVersion.Tool" ExcludeAssets="All" />
1615
<PackageReference Include="ReportGenerator" ExcludeAssets="All" />
1716
<PackageReference Include="JetBrains.ReSharper.CommandLineTools" ExcludeAssets="All" />

language-server-protocol.sha.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- This is the last commit we caught up with https://github.com/Microsoft/language-server-protocol/commits/gh-pages
2-
lastSha: bdcc0f2
2+
lastSha: 5fc92456c046ed980646bb95c1d2e390d5b3ef9d
33

4-
https://github.com/Microsoft/language-server-protocol/compare/ed804013dc545b0e10bcb0a57d872c414bbc1f3c..gh-pages
4+
https://github.com/Microsoft/language-server-protocol/compare/5fc92456c046ed980646bb95c1d2e390d5b3ef9d..gh-pages
55

src/Protocol/Client/Capabilities/IWindowClientCapabilities.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
public interface IWindowClientCapabilities : ICapabilitiesBase
44
{
55
/// <summary>
6-
/// Whether client supports handling progress notifications.
6+
/// Whether the client supports server initiated progress using the `window/workDoneProgress/create` request.
77
/// </summary>
88
Supports<bool> WorkDoneProgress { get; set; }
99

@@ -21,4 +21,4 @@ public interface IWindowClientCapabilities : ICapabilitiesBase
2121
/// </summary>
2222
Supports<ShowDocumentClientCapabilities> ShowDocument { get; set; }
2323
}
24-
}
24+
}

src/Protocol/Client/Capabilities/WindowClientCapabilities.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities
66
public class WindowClientCapabilities : CapabilitiesBase, IWindowClientCapabilities
77
{
88
/// <summary>
9-
/// Whether client supports handling progress notifications.
9+
/// Whether the client supports server initiated progress using the `window/workDoneProgress/create` request.
1010
/// </summary>
1111
public Supports<bool> WorkDoneProgress { get; set; }
1212

src/Protocol/Features/Document/ColorFeature.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public partial record ColorPresentation
7676

7777
/// <summary>
7878
/// An [edit](#TextEdit) which is applied to a document when selecting
79-
/// this presentation for the color. When `falsy` the [label](#ColorPresentation.label)
79+
/// this presentation for the color. When omitted the [label](#ColorPresentation.label)
8080
/// is used.
8181
/// </summary>
8282
[Optional]

src/Protocol/Features/Document/CompletionFeature.cs

+41-41
Original file line numberDiff line numberDiff line change
@@ -113,22 +113,22 @@ public partial record CompletionItem : ICanBeResolved, IRequest<CompletionItem>,
113113

114114
/// <summary>
115115
/// A string that shoud be used when comparing this item
116-
/// with other items. When `falsy` the label is used.
116+
/// with other items. When omitted the label is used.
117117
/// </summary>
118118
[Optional]
119119
public string? SortText { get; init; }
120120

121121
/// <summary>
122122
/// A string that should be used when filtering a set of
123-
/// completion items. When `falsy` the label is used.
123+
/// completion items. When omitted the label is used.
124124
/// </summary>
125125

126126
[Optional]
127127
public string? FilterText { get; init; }
128128

129129
/// <summary>
130130
/// A string that should be inserted a document when selecting
131-
/// this completion. When `falsy` the label is used.
131+
/// this completion. When omitted the label is used.
132132
/// </summary>
133133

134134
[Optional]
@@ -223,7 +223,7 @@ public partial record CompletionItem : ICanBeResolved, IRequest<CompletionItem>,
223223
[Optional]
224224
public JToken? Data { get; init; }
225225

226-
private string DebuggerDisplay => $"[{Kind}] {Label}{( Tags?.Any() == true ? $" tags: {string.Join(", ", Tags.Select(z => z.ToString()))}" : "" )}";
226+
private string DebuggerDisplay => $"[{Kind}] {Label}{(Tags?.Any() == true ? $" tags: {string.Join(", ", Tags.Select(z => z.ToString()))}" : "")}";
227227

228228
/// <inheritdoc />
229229
public override string ToString() => DebuggerDisplay;
@@ -351,7 +351,7 @@ public class CompletionRegistrationCompletionItemOptions
351351
/// details (see also `CompletionItemLabelDetails`) when receiving
352352
/// a completion item in a resolve call.
353353
///
354-
/// @since 3.17.0 - proposed state
354+
/// @since 3.17.0
355355
/// </summary>
356356
[Optional]
357357
public bool? LabelDetailsSupport { get; set; }
@@ -438,7 +438,7 @@ public CompletionList(IEnumerable<CompletionItem> items, bool isIncomplete) : ba
438438
/// signals support for this via the `completionList.itemDefaults`
439439
/// capability.
440440
///
441-
/// @since 3.17.0 - proposed state
441+
/// @since 3.17.0
442442
/// </summary>
443443
[Optional]
444444
public CompletionListItemDefaults? ItemDefaults { get; set; }
@@ -450,11 +450,11 @@ public CompletionList(IEnumerable<CompletionItem> items, bool isIncomplete) : ba
450450
{
451451
ItemDefaults = list.ItemDefaults
452452
},
453-
_ => null
453+
_ => null
454454
};
455455

456456
public static CompletionList From(CompletionList? source, IEnumerable<CompletionItem>? result)
457-
=> new ((source?.Items ?? Array.Empty<CompletionItem>()).Concat(result ?? Array.Empty<CompletionItem>()))
457+
=> new((source?.Items ?? Array.Empty<CompletionItem>()).Concat(result ?? Array.Empty<CompletionItem>()))
458458
{
459459
ItemDefaults = source?.ItemDefaults
460460
};
@@ -559,7 +559,7 @@ public CompletionList(bool isIncomplete, params CompletionItem<T>[] items) : bas
559559
/// signals support for this via the `completionList.itemDefaults`
560560
/// capability.
561561
///
562-
/// @since 3.17.0 - proposed state
562+
/// @since 3.17.0
563563
/// </summary>
564564
[Optional]
565565
public CompletionListItemDefaults? ItemDefaults { get; set; }
@@ -574,71 +574,71 @@ public CompletionList(bool isIncomplete, params CompletionItem<T>[] items) : bas
574574
},
575575
_ => null
576576
};
577-
577+
578578
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("container")]
579-
public static implicit operator CompletionList? (CompletionList<T>? container) => container switch
579+
public static implicit operator CompletionList?(CompletionList<T>? container) => container switch
580580
{
581581
not null => new CompletionList(container.Select(value => (CompletionItem)value), container.IsIncomplete)
582582
{
583583
ItemDefaults = container.ItemDefaults
584584
},
585-
_ => null
585+
_ => null
586586
};
587-
587+
588588
}
589-
590-
internal class TypedCompletionListConverter : JsonConverter
591-
{
592-
public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
593-
{
594-
serializer.Serialize(writer, (CompletionList?)value);
595-
}
596589

597-
public override object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer)
598-
{
599-
var completionList = serializer.Deserialize<CompletionList>(reader);
600-
return objectType.GetMethod(nameof(CompletionList<IHandlerIdentity>.Create), BindingFlags.Static | BindingFlags.Public)!
601-
.Invoke(null, new object[] { completionList })!;
602-
}
590+
internal class TypedCompletionListConverter : JsonConverter
591+
{
592+
public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
593+
{
594+
serializer.Serialize(writer, (CompletionList?)value);
595+
}
603596

604-
public override bool CanConvert(Type objectType)
605-
{
606-
return objectType.IsGenericType && objectType.GetGenericTypeDefinition() == typeof(CompletionList<>);
607-
}
597+
public override object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer)
598+
{
599+
var completionList = serializer.Deserialize<CompletionList>(reader);
600+
return objectType.GetMethod(nameof(CompletionList<IHandlerIdentity>.Create), BindingFlags.Static | BindingFlags.Public)!
601+
.Invoke(null, new object[] { completionList })!;
602+
}
608603

609-
public override bool CanRead => true;
604+
public override bool CanConvert(Type objectType)
605+
{
606+
return objectType.IsGenericType && objectType.GetGenericTypeDefinition() == typeof(CompletionList<>);
610607
}
611608

609+
public override bool CanRead => true;
610+
}
611+
612612
public record CompletionListItemDefaults
613613
{
614614
/// <summary>
615615
/// A default commit character set.
616616
///
617-
/// @since 3.17.0 - proposed state
617+
/// @since 3.17.0
618618
/// </summary>
619619
[Optional]
620620
public Container<string>? CommitCharacters { get; init; }
621621

622622
/// <summary>
623623
/// A default edit range
624624
///
625-
/// @since 3.17.0 - proposed state
625+
/// @since 3.17.0
626626
/// </summary>
627627
[Optional]
628628
public RangeOrEditRange? EditRange { get; init; }
629629

630630
/// <summary>
631631
/// A default insert text format
632632
///
633-
/// @since 3.17.0 - proposed state
633+
/// @since 3.17.0
634634
/// </summary>
635635
[Optional]
636636
public InsertTextFormat? InsertTextFormat { get; init; }
637637

638638
/// <summary>
639639
/// A default insert text mode
640640
///
641-
/// @since 3.17.0 - proposed state
641+
/// @since 3.17.0
642642
/// </summary>
643643
public InsertTextMode? InsertTextMode { get; init; }
644644

@@ -704,7 +704,7 @@ public partial class CompletionCapability : DynamicCapability
704704
/// The client's default when the completion item doesn't provide a
705705
/// `insertTextMode` property.
706706
///
707-
/// @since 3.17.0 - proposed state
707+
/// @since 3.17.0
708708
/// </summary>
709709
[Optional]
710710
public InsertTextMode? InsertTextMode { get; set; }
@@ -713,7 +713,7 @@ public partial class CompletionCapability : DynamicCapability
713713
/// The client supports the following `CompletionList` specific
714714
/// capabilities.
715715
///
716-
/// @since 3.17.0 - proposed state
716+
/// @since 3.17.0
717717
/// </summary>
718718
[Optional]
719719
public CompletionListCapabilityOptions? CompletionList { get; set; }
@@ -723,19 +723,19 @@ public partial class CompletionCapability : DynamicCapability
723723
/// The client supports the following `CompletionList` specific
724724
/// capabilities.
725725
///
726-
/// @since 3.17.0 - proposed state
726+
/// @since 3.17.0
727727
/// </summary>
728728
public class CompletionListCapabilityOptions
729729
{
730730
/// <summary>
731-
/// The client supports the the following itemDefaults on
731+
/// The client supports the following itemDefaults on
732732
/// a completion list.
733733
///
734734
/// The value lists the supported property names of the
735735
/// `CompletionList.itemDefaults` object. If omitted
736736
/// no properties are supported.
737737
///
738-
/// @since 3.17.0 - proposed state
738+
/// @since 3.17.0
739739
/// </summary>
740740
[Optional]
741741
public Container<string>? ItemDefaults { get; set; }
@@ -832,7 +832,7 @@ public class CompletionItemCapabilityOptions
832832
/// The client has support for completion item label
833833
/// details (see also `CompletionItemLabelDetails`).
834834
///
835-
/// @since 3.17.0 - proposed state
835+
/// @since 3.17.0
836836
/// </summary>
837837
[Optional]
838838
public bool LabelDetailsSupport { get; set; }

src/Protocol/Features/Document/DiagnosticsFeature.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ public partial class DiagnosticClientCapabilities : DynamicCapability
508508
/// Capabilities specific to the code lens requests scoped to the
509509
/// workspace.
510510
///
511-
/// @since 3.16.0.
511+
/// @since 3.17.0.
512512
/// </summary>
513513
[CapabilityKey(nameof(ClientCapabilities.Workspace), nameof(WorkspaceClientCapabilities.Diagnostics))]
514514
public class DiagnosticWorkspaceClientCapabilities : ICapability

src/Protocol/Features/Document/DocumentLinkFeature.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public partial record DocumentLinkParams : ITextDocumentIdentifierParams, IParti
3232
/// </summary>
3333
public TextDocumentIdentifier TextDocument { get; init; } = null!;
3434
}
35-
35+
3636
public partial class DocumentLinkContainer { }
3737

3838
/// <summary>

src/Protocol/Features/Document/DocumentOnTypeFormattingFeature.cs

+9-4
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,23 @@ public partial record DocumentOnTypeFormattingParams : ITextDocumentIdentifierPa
2828
public TextDocumentIdentifier TextDocument { get; init; } = null!;
2929

3030
/// <summary>
31-
/// The position at which this request was sent.
31+
/// The position around which the on type formatting should happen.
32+
/// This is not necessarily the exact position where the character denoted
33+
/// by the property `ch` got typed.
3234
/// </summary>
3335
public Position Position { get; init; } = null!;
3436

3537
/// <summary>
36-
/// The character that has been typed.
38+
/// The character that has been typed that triggered the formatting
39+
/// on type request.That is not necessarily the last character that
40+
/// got inserted into the document since the client could auto insert
41+
/// characters as well(e.g.like automatic brace completion).
3742
/// </summary>
3843
[JsonProperty("ch")]
3944
public string Character { get; init; } = null!;
4045

4146
/// <summary>
42-
/// The format options.
47+
/// The formatting options.
4348
/// </summary>
4449
public FormattingOptions Options { get; init; } = null!;
4550
}
@@ -49,7 +54,7 @@ public partial record DocumentOnTypeFormattingParams : ITextDocumentIdentifierPa
4954
public partial class DocumentOnTypeFormattingRegistrationOptions : ITextDocumentRegistrationOptions, IWorkDoneProgressOptions
5055
{
5156
/// <summary>
52-
/// A character on which formatting should be triggered, like `}`.
57+
/// A character on which formatting should be triggered, like `{`.
5358
/// </summary>
5459
public string FirstTriggerCharacter { get; set; } = null!;
5560

src/Protocol/Features/Document/InlayHintFeature.cs

+3-6
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ public partial record InlayHint : ICanBeResolved, IRequest<InlayHint>, IDoesNotP
128128

129129
private string DebuggerDisplay => ToString();
130130
}
131-
132-
public partial class InlayHintContainer {}
131+
132+
public partial class InlayHintContainer { }
133133

134134
/// <summary>
135135
/// An inlay hint label part allows for interactive and composite labels
@@ -251,7 +251,6 @@ public override StringOrInlayHintLabelParts ReadJson(
251251
///
252252
/// @since 3.17.0
253253
/// </summary>
254-
///
255254
[JsonConverter(typeof(NumberEnumConverter))]
256255
public enum InlayHintKind
257256
{
@@ -273,9 +272,7 @@ public partial class InlayHintRegistrationOptions : ITextDocumentRegistrationOpt
273272
{
274273
/// <summary>
275274
/// The server provides support to resolve additional
276-
/// information for a code action.
277-
///
278-
/// @since 3.16.0
275+
/// information for an inlay hint item.
279276
/// </summary>
280277
[Optional]
281278
public bool ResolveProvider { get; set; }

src/Protocol/Features/Document/LinkedEditingRangeFeature.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@ public partial record LinkedEditingRanges
2525
{
2626
/// <summary>
2727
/// A list of ranges that can be renamed together. The ranges must have
28-
/// identical length and contain identical text content. The ranges cannot overlap.
28+
/// identical length and contain identical text content. The ranges cannot
29+
/// overlap.
2930
/// </summary>
3031
public Container<Range> Ranges { get; init; } = null!;
3132

3233
/// <summary>
33-
/// An optional word pattern (regular expression) that describes valid contents for
34-
/// the given ranges. If no pattern is provided, the client configuration's word
35-
/// pattern will be used.
34+
/// An optional word pattern (regular expression) that describes valid
35+
/// contents for the given ranges. If no pattern is provided, the client
36+
/// configuration's word pattern will be used.
3637
/// </summary>
3738
[Optional]
3839
public string? WordPattern { get; init; }

0 commit comments

Comments
 (0)