From 66cba8b77d31e73e7681b0035aa430feb535f47b Mon Sep 17 00:00:00 2001 From: Monica Gupta Date: Thu, 10 Sep 2020 09:52:26 -0700 Subject: [PATCH] Fix suggestions after keyword (#1071) Co-authored-by: Monica Gupta --- src/Microsoft.Kusto.ServiceLayer/DataSource/KustoDataSource.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/KustoDataSource.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/KustoDataSource.cs index 31ca487a..99b6b87e 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/KustoDataSource.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/KustoDataSource.cs @@ -420,7 +420,7 @@ namespace Microsoft.Kusto.ServiceLayer.DataSource public override LanguageServices.Contracts.CompletionItem[] GetAutoCompleteSuggestions(ScriptDocumentInfo scriptDocumentInfo, Position textPosition, bool throwOnError = false){ var kustoCodeService = new KustoCodeService(scriptDocumentInfo.Contents, SchemaState); var script = CodeScript.From(scriptDocumentInfo.Contents, SchemaState); - script.TryGetTextPosition(textPosition.Line + 1, textPosition.Character, out int position); // Gets the actual offset based on line and local offset + script.TryGetTextPosition(textPosition.Line + 1, textPosition.Character + 1, out int position); // Gets the actual offset based on line and local offset var completion = kustoCodeService.GetCompletionItems(position); scriptDocumentInfo.ScriptParseInfo.CurrentSuggestions = completion.Items; // this is declaration item so removed for now, but keep the info when api gets updated