Skip to content

Commit

Permalink
Auto-sync from Azure-Kusto-Service
Browse files Browse the repository at this point in the history
  • Loading branch information
Kusto Build System committed Jan 28, 2025
1 parent bb03d16 commit 3c3b184
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 16 deletions.
22 changes: 17 additions & 5 deletions src/Kusto.Language/Editor/ClientParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,40 @@
public class ClientParameter : SyntaxReference
{
public string Name { get; }
public int Index { get; }
public int? Index { get; }

public ClientParameter(string name, int index, TextRange range)
public ClientParameter(string name, int? index, TextRange range)
: base(range)
{
this.Name = name;
this.Index = index;
}

public ClientParameter(string name, int index, int start, int length)
public ClientParameter(string name, int? index, int start, int length)
: this(name, index, new TextRange(start, length))
{
}

public ClientParameter(string name, TextRange range)
: this(name, 0, range)
: this(name, null, range)
{
}

public ClientParameter(string name, int start, int length)
: this(name, 0, start, length)
: this(name, null, start, length)
{
}

public override string ToString()
{
if (Index != null)
{
return $"{Name}[{Index}]";
}
else
{
return Name;
}
}
}
}
2 changes: 1 addition & 1 deletion src/Kusto.Language/Editor/CommonCodeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ internal IReadOnlyList<ClientParameter> GetClientParameters(string blockText)
}

var name = blockText.Substring(nameStart, nameLength);
var index = indexLength > 0 && Int32.TryParse(blockText.Substring(indexStart, indexLength), out var value) ? value : 0;
int? index = indexLength > 0 && Int32.TryParse(blockText.Substring(indexStart, indexLength), out var value) ? value : null;
list.Add(new ClientParameter(name, index, openBrace, len));

start = openBrace + len;
Expand Down
6 changes: 2 additions & 4 deletions src/Kusto.Language/Functions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3414,8 +3414,7 @@ private static TypeSymbol SeriesDecomposeAnomaliesResult(CustomReturnTypeContext
&& gm.WhereClause != null
&& (gm.WhereClause == context.Location || gm.WhereClause.IsAncestorOf(context.Location))
&& (gm.ProjectClause == context.Location || gm.WhereClause.IsAncestorOf(context.Location));
})
.Hide();
});

public static readonly FunctionSymbol NodeDegreeOut =
new FunctionSymbol("node_degree_out",
Expand All @@ -3428,8 +3427,7 @@ private static TypeSymbol SeriesDecomposeAnomaliesResult(CustomReturnTypeContext
&& gm.WhereClause != null
&& (gm.WhereClause == context.Location || gm.WhereClause.IsAncestorOf(context.Location))
&& (gm.ProjectClause == context.Location || gm.WhereClause.IsAncestorOf(context.Location));
})
.Hide();
});

#endregion

Expand Down
Loading

0 comments on commit 3c3b184

Please sign in to comment.