Skip to content

Commit

Permalink
SignatureHelp and CompletionItem spec fix (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerLeonhardt authored Jul 9, 2020
1 parent d82ff82 commit dca32a6
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/Protocol/Models/CompletionItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class CompletionItem : ICanBeResolved, IRequest<CompletionItem>
///
/// @since 3.15.0
/// </summary>
[Optional]
public Container<CompletionItemTag> Tags { get; set; }

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Protocol/Models/SignatureHelp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class SignatureHelp
/// <summary>
/// One or more signatures.
/// </summary>
public Container<SignatureInformation> Signatures { get; set; }
public Container<SignatureInformation> Signatures { get; set; } = new Container<SignatureInformation>();

/// <summary>
/// The active signature.
Expand Down
1 change: 0 additions & 1 deletion test/Lsp.Tests/Models/CompletionItemTests_$SimpleTest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"label": null,
"kind": 1,
"tags": null,
"deprecated": false,
"preselect": false,
"insertTextFormat": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
{
"label": null,
"kind": 7,
"tags": null,
"detail": "details",
"deprecated": false,
"preselect": false,
Expand Down
1 change: 0 additions & 1 deletion test/Lsp.Tests/Models/CompletionListTests_$SimpleTest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
{
"label": null,
"kind": 7,
"tags": null,
"detail": "details",
"deprecated": false,
"preselect": false,
Expand Down
12 changes: 12 additions & 0 deletions test/Lsp.Tests/Models/SignatureHelpTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,17 @@ public void SimpleTest(string expected)
var deresult = new Serializer(ClientVersion.Lsp3).DeserializeObject<SignatureHelp>(expected);
deresult.Should().BeEquivalentTo(model);
}

[Theory, JsonFixture]
public void NoSignaturesTest(string expected)
{
var model = new SignatureHelp();
var result = Fixture.SerializeObject(model);

result.Should().Be(expected);

var deresult = new Serializer(ClientVersion.Lsp3).DeserializeObject<SignatureHelp>(expected);
deresult.Should().BeEquivalentTo(model);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"signatures": []
}

0 comments on commit dca32a6

Please sign in to comment.