From 3fc9da02cadb2b03c240bae22de9d785620e3001 Mon Sep 17 00:00:00 2001 From: Shengyu Fu Date: Sun, 4 Aug 2019 15:15:41 -0700 Subject: [PATCH 1/3] Need to match the command field in the vscode language service client contract --- .../LanguageServices/Contracts/Completion.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.SqlTools.ServiceLayer/LanguageServices/Contracts/Completion.cs b/src/Microsoft.SqlTools.ServiceLayer/LanguageServices/Contracts/Completion.cs index b4d85eaf..288f4f76 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/LanguageServices/Contracts/Completion.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/LanguageServices/Contracts/Completion.cs @@ -58,7 +58,7 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices.Contracts /// /// The identifier of the actual command handler, like `vsintellicode.completionItemSelected`. /// - public string CommandStr { get; set; } + public string command { get; set; } /// /// Arguments that the command handler should be invoked with. From 9bbc7a20c9c0ecd1b7b2a1a8253f4050244f4598 Mon Sep 17 00:00:00 2001 From: Shengyu Fu Date: Mon, 5 Aug 2019 16:22:51 -0700 Subject: [PATCH 2/3] Fix tests with the updated the Command class --- test/CompletionExtSample/CompletionExt.cs | 2 +- .../LanguageServer/LanguageServiceTests.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/CompletionExtSample/CompletionExt.cs b/test/CompletionExtSample/CompletionExt.cs index 3d277461..9c1f52c9 100644 --- a/test/CompletionExtSample/CompletionExt.cs +++ b/test/CompletionExtSample/CompletionExt.cs @@ -66,7 +66,7 @@ namespace Microsoft.SqlTools.Test.CompletionExtension { item.Command = new Command { - CommandStr = "vsintellicode.completionItemSelected", + command = "vsintellicode.completionItemSelected", Arguments = new object[] { new Dictionary { { "IsCommit", "True" } } } }; } diff --git a/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/LanguageServer/LanguageServiceTests.cs b/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/LanguageServer/LanguageServiceTests.cs index 2cb2d362..1ab1ec5e 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/LanguageServer/LanguageServiceTests.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/LanguageServer/LanguageServiceTests.cs @@ -184,7 +184,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.LanguageServer //Validate the first completion item in the list is preselected Assert.True(completions[0].Preselect.HasValue && completions[0].Preselect.Value, "Preselect is not set properly in the first completion item by the completion extension!"); //Validate the Command object attached to the completion item by the extension - Assert.True(completions[0].Command != null && completions[0].Command.CommandStr == "vsintellicode.completionItemSelected", "Command is not set properly in the first completion item by the completion extension!"); + Assert.True(completions[0].Command != null && completions[0].Command.command == "vsintellicode.completionItemSelected", "Command is not set properly in the first completion item by the completion extension!"); //clean up the temp file File.Delete(assemblyCopyPath); From c919dba89f08e857c08b59a3e860157ccc408371 Mon Sep 17 00:00:00 2001 From: Shengyu Fu Date: Tue, 6 Aug 2019 17:18:20 -0700 Subject: [PATCH 3/3] Adding Title/Tooltip for Command class. --- .../LanguageServices/Contracts/Completion.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Microsoft.SqlTools.ServiceLayer/LanguageServices/Contracts/Completion.cs b/src/Microsoft.SqlTools.ServiceLayer/LanguageServices/Contracts/Completion.cs index 288f4f76..3f491141 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/LanguageServices/Contracts/Completion.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/LanguageServices/Contracts/Completion.cs @@ -55,11 +55,21 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices.Contracts public class Command { + /// + /// Title of the command. + /// + public string Title { get; set; } + /// /// The identifier of the actual command handler, like `vsintellicode.completionItemSelected`. /// public string command { get; set; } + /// + /// A tooltip for the command, when represented in the UI. + /// + public string Tooltip { get; set; } + /// /// Arguments that the command handler should be invoked with. ///