From d39a67df306f337c2f7d0ce7b0a8c9ce2ade6801 Mon Sep 17 00:00:00 2001 From: Justin M <63619224+JustinMDotNet@users.noreply.github.com> Date: Fri, 11 Sep 2020 15:22:58 -0700 Subject: [PATCH] 3643 Intellisense fix for spaces (#1073) * 3643 Enhanced GetAutoCompleteSuggestions to escape spaces in the insertText when generating list of suggestions. Changed detail to include kind. * 3643 Fixed formatting * 3643 Changed variable in GetAutoCompleteSuggestions --- .../DataSource/KustoDataSource.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/KustoDataSource.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/KustoDataSource.cs index 99b6b87e..ff6fea2c 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/KustoDataSource.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/KustoDataSource.cs @@ -429,7 +429,11 @@ namespace Microsoft.Kusto.ServiceLayer.DataSource foreach (var autoCompleteItem in completion.Items) { var label = autoCompleteItem.DisplayText; - completions.Add(AutoCompleteHelper.CreateCompletionItem(label, label + " keyword", label, KustoIntellisenseHelper.CreateCompletionItemKind(autoCompleteItem.Kind), scriptDocumentInfo.StartLine, scriptDocumentInfo.StartColumn, textPosition.Character)); + var insertText = KustoQueryUtils.EscapeName(label); + var completionKind = KustoIntellisenseHelper.CreateCompletionItemKind(autoCompleteItem.Kind); + completions.Add(AutoCompleteHelper.CreateCompletionItem(label, autoCompleteItem.Kind.ToString(), + insertText, completionKind, scriptDocumentInfo.StartLine, scriptDocumentInfo.StartColumn, + textPosition.Character)); } return completions.ToArray();