Skip to content

Commit dca32a6

Browse files
SignatureHelp and CompletionItem spec fix (#258)
1 parent d82ff82 commit dca32a6

7 files changed

+17
-4
lines changed

src/Protocol/Models/CompletionItem.cs

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public class CompletionItem : ICanBeResolved, IRequest<CompletionItem>
2727
///
2828
/// @since 3.15.0
2929
/// </summary>
30+
[Optional]
3031
public Container<CompletionItemTag> Tags { get; set; }
3132

3233
/// <summary>

src/Protocol/Models/SignatureHelp.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class SignatureHelp
1212
/// <summary>
1313
/// One or more signatures.
1414
/// </summary>
15-
public Container<SignatureInformation> Signatures { get; set; }
15+
public Container<SignatureInformation> Signatures { get; set; } = new Container<SignatureInformation>();
1616

1717
/// <summary>
1818
/// The active signature.

test/Lsp.Tests/Models/CompletionItemTests_$SimpleTest.json

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"label": null,
33
"kind": 1,
4-
"tags": null,
54
"deprecated": false,
65
"preselect": false,
76
"insertTextFormat": 0,

test/Lsp.Tests/Models/CompletionListTests_$ComplexTest.json

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
{
55
"label": null,
66
"kind": 7,
7-
"tags": null,
87
"detail": "details",
98
"deprecated": false,
109
"preselect": false,

test/Lsp.Tests/Models/CompletionListTests_$SimpleTest.json

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
{
33
"label": null,
44
"kind": 7,
5-
"tags": null,
65
"detail": "details",
76
"deprecated": false,
87
"preselect": false,

test/Lsp.Tests/Models/SignatureHelpTests.cs

+12
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,17 @@ public void SimpleTest(string expected)
3131
var deresult = new Serializer(ClientVersion.Lsp3).DeserializeObject<SignatureHelp>(expected);
3232
deresult.Should().BeEquivalentTo(model);
3333
}
34+
35+
[Theory, JsonFixture]
36+
public void NoSignaturesTest(string expected)
37+
{
38+
var model = new SignatureHelp();
39+
var result = Fixture.SerializeObject(model);
40+
41+
result.Should().Be(expected);
42+
43+
var deresult = new Serializer(ClientVersion.Lsp3).DeserializeObject<SignatureHelp>(expected);
44+
deresult.Should().BeEquivalentTo(model);
45+
}
3446
}
3547
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"signatures": []
3+
}

0 commit comments

Comments
 (0)