Skip to content

Commit e36e59c

Browse files
committed
LSP 3.15: Add TextDocumentClientCapabilities.
1 parent c9efbaa commit e36e59c

File tree

1 file changed

+83
-6
lines changed

1 file changed

+83
-6
lines changed

LanguageServer.VsCode/Contracts/InitializationRequest.cs

Lines changed: 83 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,19 @@ public class ClientCapabilities
4848
/// Workspace specific client capabilities.
4949
/// </summary>
5050
[JsonProperty]
51-
public WorkspaceCapability Workspace { get; set; }
51+
public WorkspaceClientCapability Workspace { get; set; }
5252

5353
/// <summary>
5454
/// Text document specific client capabilities.
5555
/// </summary>
5656
[JsonProperty]
57-
public TextDocumentCapability TextDocument { get; set; }
57+
public TextDocumentClientCapabilities TextDocument { get; set; }
5858

5959
/// <summary>
6060
/// Window specific client capabilities.
6161
/// </summary>
6262
[JsonProperty]
63-
public WindowCapability Window { get; set; }
63+
public WindowClientCapability Window { get; set; }
6464

6565
/// <summary>
6666
/// Experimental client capabilities.
@@ -73,7 +73,7 @@ public class ClientCapabilities
7373
/// Defines capabilities the editor / tool provides on the workspace.
7474
/// </summary>
7575
[JsonObject(MemberSerialization.OptIn)]
76-
public class WorkspaceCapability
76+
public class WorkspaceClientCapability
7777
{
7878
/// <summary>
7979
/// The client supports applying batch edits to the workspace by supporting
@@ -130,7 +130,7 @@ public class WorkspaceEditCapability : ClientCapability
130130
/// Defines capabilities the editor / tool provides on text documents.
131131
/// </summary>
132132
[JsonObject(MemberSerialization.OptIn)]
133-
public class TextDocumentCapability
133+
public class TextDocumentClientCapabilities
134134
{
135135

136136
/// <summary>
@@ -157,12 +157,30 @@ public class TextDocumentCapability
157157
[JsonProperty]
158158
public TextDocumentSignatureHelpCapability SignatureHelp { get; set; }
159159

160+
/// <summary>
161+
/// Capabilities specific to the `textDocument/declaration` request. (LSP 3.14)
162+
/// </summary>
163+
[JsonProperty]
164+
public DynamicClientCapability Declaration { get; set; }
165+
160166
/// <summary>
161167
/// The server provides goto definition support.
162168
/// </summary>
163169
[JsonProperty]
164170
public DynamicClientCapability Definition { get; set; }
165171

172+
/// <summary>
173+
/// Capabilities specific to the `textDocument/implementation` request. (LSP 3.6)
174+
/// </summary>
175+
[JsonProperty]
176+
public DynamicClientCapability Implementation { get; set; }
177+
178+
/// <summary>
179+
/// Capabilities specific to the `textDocument/typeDefinition` request. (LSP 3.6)
180+
/// </summary>
181+
[JsonProperty]
182+
public DynamicClientCapability TypeDefinition { get; set; }
183+
166184
/// <summary>
167185
/// The server provides find references support.
168186
/// </summary>
@@ -199,6 +217,19 @@ public class TextDocumentCapability
199217
[JsonProperty]
200218
public DynamicClientCapability CodeLens { get; set; }
201219

220+
/// <summary>
221+
/// Capabilities specific to the `textDocument/documentLink` request.
222+
/// </summary>
223+
[JsonProperty]
224+
public DynamicClientCapability DocumentLink { get; set; }
225+
226+
/// <summary>
227+
/// Capabilities specific to the `textDocument/documentColor` and the `textDocument/colorPresentation` request.
228+
/// (LSP 3.6)
229+
/// </summary>
230+
[JsonProperty]
231+
public DynamicClientCapability ColorProvider { get; set; }
232+
202233
/// <summary>
203234
/// The server provides document formatting.
204235
/// </summary>
@@ -223,6 +254,24 @@ public class TextDocumentCapability
223254
[JsonProperty]
224255
public DynamicClientCapability Rename { get; set; }
225256

257+
/// <summary>
258+
/// Capabilities specific to the `textDocument/publishDiagnostics` notification.
259+
/// </summary>
260+
[JsonProperty]
261+
public DynamicClientCapability PublishDiagnostics { get; set; }
262+
263+
/// <summary>
264+
/// Capabilities specific to the `textDocument/foldingRange` notification. (LSP 3.10)
265+
/// </summary>
266+
[JsonProperty]
267+
public FoldingRangeClientCapabilities FoldingRange { get; set; }
268+
269+
/// <summary>
270+
/// Capabilities specific to the `textDocument/selectionRange` notification. (LSP 3.15)
271+
/// </summary>
272+
[JsonProperty]
273+
public DynamicClientCapability SelectionRange { get; set; }
274+
226275
}
227276

228277
public class TextDocumentSynchronizationCapability : DynamicClientCapability
@@ -352,7 +401,35 @@ public class TextDocumentSignatureInformationCapability
352401
public IList<MarkupKind> DocumentationFormat { get; set; }
353402
}
354403

355-
public class WindowCapability : ClientCapability
404+
[JsonObject(MemberSerialization.OptIn)]
405+
public class DocumentLinkClientCapabilities : DynamicClientCapability
406+
{
407+
/// <summary>
408+
/// Whether the client supports the `tooltip` property on `DocumentLink`. (LSP 3.15)
409+
/// </summary>
410+
[JsonProperty]
411+
public bool TooltipSupport { get; set; }
412+
}
413+
414+
[JsonObject(MemberSerialization.OptIn)]
415+
public class FoldingRangeClientCapabilities : DynamicClientCapability
416+
{
417+
/// <summary>
418+
/// The maximum number of folding ranges that the client prefers to receive per document.
419+
/// The value serves as a hint, servers are free to follow the limit.
420+
/// </summary>
421+
[JsonProperty]
422+
public int RangeLimit { get; set; }
423+
424+
/// <summary>
425+
/// If set, the client signals that it only supports folding complete lines. If set, client will
426+
/// ignore specified `startCharacter` and `endCharacter` properties in a FoldingRange.
427+
/// </summary>
428+
[JsonProperty]
429+
public bool LineFoldingOnly { get; set; }
430+
}
431+
432+
public class WindowClientCapability : ClientCapability
356433
{
357434
/// <summary>
358435
/// Whether client supports handling progress notifications.

0 commit comments

Comments
 (0)