Fix suggestions after keyword (#1071)

Co-authored-by: Monica Gupta <mogupt@microsoft.com>
This commit is contained in:
Monica Gupta
2020-09-10 09:52:26 -07:00
committed by GitHub
parent bb735a409f
commit 66cba8b77d

View File

@@ -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