mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 18:47:57 -05:00
Fix suggestions after keyword (#1071)
Co-authored-by: Monica Gupta <mogupt@microsoft.com>
This commit is contained in:
@@ -420,7 +420,7 @@ namespace Microsoft.Kusto.ServiceLayer.DataSource
|
|||||||
public override LanguageServices.Contracts.CompletionItem[] GetAutoCompleteSuggestions(ScriptDocumentInfo scriptDocumentInfo, Position textPosition, bool throwOnError = false){
|
public override LanguageServices.Contracts.CompletionItem[] GetAutoCompleteSuggestions(ScriptDocumentInfo scriptDocumentInfo, Position textPosition, bool throwOnError = false){
|
||||||
var kustoCodeService = new KustoCodeService(scriptDocumentInfo.Contents, SchemaState);
|
var kustoCodeService = new KustoCodeService(scriptDocumentInfo.Contents, SchemaState);
|
||||||
var script = CodeScript.From(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);
|
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
|
scriptDocumentInfo.ScriptParseInfo.CurrentSuggestions = completion.Items; // this is declaration item so removed for now, but keep the info when api gets updated
|
||||||
|
|||||||
Reference in New Issue
Block a user