Skip to content

Commit 5aade2f

Browse files
wip to bring uptodate with latest lsp spec
1 parent eb2ff5d commit 5aade2f

27 files changed

+309
-29
lines changed

language-server-protocol.sha.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- This is the last commit we caught up with https://github.com/Microsoft/language-server-protocol
2+
05e3af34464671a788679080f06558db52d1097b

src/Protocol/Client/Capabilities/CompletionCapability.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using Newtonsoft.Json;
2+
13
namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities
24
{
35
public class CompletionCapability : DynamicCapability, ConnectedCapability<ICompletionHandler>
@@ -7,5 +9,11 @@ public class CompletionCapability : DynamicCapability, ConnectedCapability<IComp
79
/// capabilities.
810
/// </summary>
911
public CompletionItemCapability CompletionItem { get; set; }
12+
13+
/// <summary>
14+
/// The client supports to send additional context information for a `textDocument/completion` request.
15+
/// </summary>
16+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
17+
public bool? ContextSupport { get; set; }
1018
}
1119
}

src/Protocol/Client/Capabilities/CompletionItemCapability.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
using Newtonsoft.Json;
1+
using Newtonsoft.Json;
22
using Newtonsoft.Json.Serialization;
3+
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
34

45
namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities
56
{
@@ -14,6 +15,20 @@ public class CompletionItemCapability
1415
/// the end of the snippet. Placeholders with equal identifiers are linked,
1516
/// that is typing in one will update others too.
1617
/// </summary>
17-
public bool SnippetSupport { get; set; }
18+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
19+
public bool? SnippetSupport { get; set; }
20+
21+
/// <summary>
22+
/// Client supports commit characters on a completion item.
23+
/// </summary>
24+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
25+
public bool? CommitCharactersSupport { get; set; }
26+
27+
/// <summary>
28+
/// Client supports the follow content formats for the documentation
29+
/// property. The order describes the preferred format of the client.
30+
/// </summary>
31+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
32+
public Container<MarkupKind> DocumentationFormat { get; set; }
1833
}
1934
}

src/Protocol/Client/Capabilities/DynamicCapability.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public class DynamicCapability
99
/// <summary>
1010
/// Whether completion supports dynamic registration.
1111
/// </summary>
12-
public bool DynamicRegistration { get; set; }
12+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
13+
public bool? DynamicRegistration { get; set; }
1314
}
1415
}
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1+
using Newtonsoft.Json;
2+
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
3+
14
namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities
25
{
3-
public class HoverCapability : DynamicCapability, ConnectedCapability<IHoverHandler> { }
6+
public class HoverCapability : DynamicCapability, ConnectedCapability<IHoverHandler>
7+
{
8+
/// <summary>
9+
/// Client supports the follow content formats for the content property. The order describes the preferred format of the client.
10+
/// </summary>
11+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
12+
public Container<MarkupKind> ContentFormat { get; set; }
13+
}
414
}
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities
22
{
3-
public class SignatureHelpCapability : DynamicCapability, ConnectedCapability<ISignatureHelpHandler> { }
3+
public class SignatureHelpCapability : DynamicCapability, ConnectedCapability<ISignatureHelpHandler>
4+
{
5+
/// <summary>
6+
/// The client supports the following `SignatureInformation`
7+
/// specific properties.
8+
/// </summary>
9+
public SignatureInformationCapability SignatureInformation { get; set; }
10+
}
411
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using Newtonsoft.Json;
2+
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
3+
4+
namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities
5+
{
6+
public class SignatureInformationCapability
7+
{
8+
/// <summary>
9+
/// Client supports the follow content formats for the content property. The order describes the preferred format of the client.
10+
/// </summary>
11+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
12+
public Container<MarkupKind> ContentFormat { get; set; }
13+
}
14+
}
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using Newtonsoft.Json;
12
using OmniSharp.Extensions.LanguageServer.Protocol;
23

34
namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities
@@ -7,18 +8,21 @@ public class SynchronizationCapability : DynamicCapability, ConnectedCapability<
78
/// <summary>
89
/// The client supports sending will save notifications.
910
/// </summary>
10-
public bool WillSave { get; set; }
11+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
12+
public bool? WillSave { get; set; }
1113

1214
/// <summary>
1315
/// The client supports sending a will save request and
1416
/// waits for a response providing text edits which will
1517
/// be applied to the document before it is saved.
1618
/// </summary>
17-
public bool WillSaveWaitUntil { get; set; }
19+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
20+
public bool? WillSaveWaitUntil { get; set; }
1821

1922
/// <summary>
2023
/// The client supports did save notifications.
2124
/// </summary>
22-
public bool DidSave { get; set; }
25+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
26+
public bool? DidSave { get; set; }
2327
}
2428
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using Newtonsoft.Json;
4+
using Newtonsoft.Json.Converters;
5+
using Newtonsoft.Json.Linq;
6+
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
7+
8+
namespace OmniSharp.Extensions.LanguageServer.Protocol.Converters
9+
{
10+
class LowercaseStringEnumConverter : StringEnumConverter
11+
{
12+
public LowercaseStringEnumConverter() : base(true) { }
13+
}
14+
}

src/Protocol/Converters/MarkedStringCollectionConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
4343

4444
public override bool CanConvert(Type objectType) => objectType == typeof(MarkedStringContainer);
4545
}
46-
}
46+
}

0 commit comments

Comments
 (0)