Adding property type and rules to compare properties in Execution Plans (#1522)

* Adding plan index in file info

* Adding basic framework for prop comparison

* Remoing none and and fixing some better values

* Fixing file formatting

* Fixing some formatting

* Fixing casing

* Fixing compilation

* fixing compilation error
This commit is contained in:
Aasim Khan
2022-05-31 17:15:43 -07:00
committed by GitHub
parent 0c37dc50f9
commit fed1cef7bf
5 changed files with 159 additions and 52 deletions

View File

@@ -63,7 +63,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan
{
overlays.Add(new Badge
{
Type = BadgeType.CRITICALWARNING,
Type = BadgeType.CriticalWarning,
Tooltip = SR.WarningOverlayTooltip
});
}
@@ -71,7 +71,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan
{
overlays.Add(new Badge
{
Type = BadgeType.WARNING,
Type = BadgeType.Warning,
Tooltip = SR.WarningOverlayTooltip
});
}
@@ -80,7 +80,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan
{
overlays.Add(new Badge
{
Type = BadgeType.PARALLELISM,
Type = BadgeType.Parallelism,
Tooltip = SR.ParallelismOverlayTooltip
});
}
@@ -105,7 +105,32 @@ namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan
var complexProperty = prop.Value as ExpandableObjectWrapper;
if (complexProperty == null)
{
if(!prop.IsBrowsable)
{
continue;
}
var propertyValue = prop.DisplayValue;
var propertyDataType = PropertyValueDataType.String;
switch (prop.Value)
{
case string stringValue:
propertyDataType = PropertyValueDataType.String;
break;
case int integerValue:
case long longIntegerValue:
case uint unsignedIntegerValue:
case ulong unsignedLongValue:
case float floatValue:
case double doubleValue:
propertyDataType = PropertyValueDataType.Number;
break;
case bool booleanValue:
propertyDataType = PropertyValueDataType.Boolean;
break;
default:
propertyDataType = PropertyValueDataType.String;
break;
}
propsList.Add(new ExecutionPlanGraphProperty()
{
Name = prop.DisplayName,
@@ -113,7 +138,9 @@ namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan
ShowInTooltip = prop.ShowInTooltip,
DisplayOrder = prop.DisplayOrder,
PositionAtBottom = prop.IsLongString,
DisplayValue = GetPropertyDisplayValue(prop)
DisplayValue = GetPropertyDisplayValue(prop),
BetterValue = prop.BetterValue,
DataType = propertyDataType
});
}
else
@@ -126,7 +153,9 @@ namespace Microsoft.SqlTools.ServiceLayer.ExecutionPlan
ShowInTooltip = prop.ShowInTooltip,
DisplayOrder = prop.DisplayOrder,
PositionAtBottom = prop.IsLongString,
DisplayValue = GetPropertyDisplayValue(prop)
DisplayValue = GetPropertyDisplayValue(prop),
BetterValue = prop.BetterValue,
DataType = PropertyValueDataType.Nested
});
}