Skip to content

Commit 7e7de5f

Browse files
Updated protocol to sync with the latest spec
1 parent 46705b0 commit 7e7de5f

7 files changed

+47
-4
lines changed

language-server-protocol.sha.txt

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

4-
https://github.com/Microsoft/language-server-protocol/compare/<lastSha>..<newSha>
4+
https://github.com/Microsoft/language-server-protocol/compare/<lastSha>..gh-pages

src/Protocol/Models/ApplyWorkspaceEditResponse.cs

+10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Newtonsoft.Json;
22
using Newtonsoft.Json.Serialization;
3+
using OmniSharp.Extensions.LanguageServer.Protocol.Serialization;
34

45
namespace OmniSharp.Extensions.LanguageServer.Protocol.Models
56
{
@@ -9,5 +10,14 @@ public class ApplyWorkspaceEditResponse
910
/// Indicates whether the edit was applied or not.
1011
/// </summary>
1112
public bool Applied { get; set; }
13+
14+
/// <summary>
15+
/// An optional textual description for why the edit was not applied.
16+
/// This may be used may be used by the server for diagnostic
17+
/// logging or to provide a suitable error for a request that
18+
/// triggered the edit.
19+
/// </summary>
20+
[Optional]
21+
public string FailureReason { get; set; }
1222
}
1323
}

src/Protocol/Models/CompletionRegistrationOptions.cs

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Newtonsoft.Json;
1+
using Newtonsoft.Json;
22
using Newtonsoft.Json.Serialization;
33
using OmniSharp.Extensions.LanguageServer.Protocol.Serialization;
44

@@ -18,5 +18,15 @@ public class CompletionRegistrationOptions : TextDocumentRegistrationOptions, IC
1818
/// </summary>
1919
[Optional]
2020
public bool ResolveProvider { get; set; }
21+
22+
/// <summary>
23+
/// The list of all possible characters that commit a completion. This field can be used
24+
/// if clients don't support individual commit characters per completion item. See
25+
/// `ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport`
26+
///
27+
/// Since 3.2.0
28+
/// </summary>
29+
[Optional]
30+
public Container<string> AllCommitCharacters { get; set; }
2131
}
2232
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
namespace OmniSharp.Extensions.LanguageServer.Protocol.Models
2+
{
3+
public interface IDeclarationOptions { }
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
2+
3+
namespace OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities
4+
{
5+
public class DeclarationOptions : StaticTextDocumentRegistrationOptions, IDeclarationOptions
6+
{
7+
public static DeclarationOptions Of(IDeclarationOptions options)
8+
{
9+
return new DeclarationOptions() { };
10+
}
11+
}
12+
}

src/Protocol/Server/Capabilities/ServerCapabilities.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Collections.Generic;
1+
using System.Collections.Generic;
22
using Newtonsoft.Json;
33
using Newtonsoft.Json.Linq;
44
using Newtonsoft.Json.Serialization;
@@ -134,6 +134,12 @@ public class ServerCapabilities
134134
/// </summary>
135135
public BooleanOr<FoldingRangeOptions> FoldingRangeProvider { get; set; }
136136
/// <summary>
137+
/// The server provides folding provider support.
138+
///
139+
/// Since 3.14.0
140+
/// </summary>
141+
public BooleanOr<DeclarationOptions> DeclarationProvider { get; set; }
142+
/// <summary>
137143
/// Workspace specific server capabilities
138144
/// </summary>
139145
[Optional]

src/Server/LanguageServer.cs

+1
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ async Task<InitializeResult> IRequestHandler<InitializeParams, InitializeResult>
428428
TypeDefinitionProvider = ccp.GetStaticOptions(textDocumentCapabilities.TypeDefinition).Get<ITypeDefinitionOptions, TypeDefinitionOptions>(TypeDefinitionOptions.Of),
429429
ColorProvider = ccp.GetStaticOptions(textDocumentCapabilities.ColorProvider).Get<IColorOptions, ColorOptions>(ColorOptions.Of),
430430
FoldingRangeProvider = ccp.GetStaticOptions(textDocumentCapabilities.FoldingRange).Get<IFoldingRangeOptions, FoldingRangeOptions>(FoldingRangeOptions.Of),
431+
DeclarationProvider = ccp.GetStaticOptions(textDocumentCapabilities.Declaration).Get<IDeclarationOptions, DeclarationOptions>(DeclarationOptions.Of),
431432
};
432433

433434
if (_collection.ContainsHandler(typeof(IDidChangeWorkspaceFoldersHandler)))

0 commit comments

Comments
 (0)