Skip to content

SignatureHelp and CompletionItem spec fix #258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": []
}