Skip to content

Commit

Permalink
New UI form for Find Variable/Parameter references, use a tree view t…
Browse files Browse the repository at this point in the history
…o show references that have been found.
  • Loading branch information
sqlgreen committed Mar 2, 2016
1 parent c31e16e commit 3f27684
Show file tree
Hide file tree
Showing 12 changed files with 620 additions and 377 deletions.
59 changes: 41 additions & 18 deletions SQL2012_BIDSHelper.csproj
Expand Up @@ -23,7 +23,7 @@
</UpgradeBackupLocation>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>BIDSHelper.snk</AssemblyOriginatorKeyFile>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
Expand Down Expand Up @@ -54,8 +54,11 @@
<DebugType>full</DebugType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CodeAnalysisRuleSet>..\..\..\Program Files (x86)\Microsoft Visual Studio 11.0\Team Tools\Static Analysis Tools\Rule Sets\BIDSHelper.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet>BasicCorrectnessRules.ruleset</CodeAnalysisRuleSet>
<RunCodeAnalysis>false</RunCodeAnalysis>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisIgnoreGeneratedCode>false</CodeAnalysisIgnoreGeneratedCode>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>false</DebugSymbols>
Expand All @@ -70,6 +73,7 @@
<NoWarn>1591</NoWarn>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent>
Expand All @@ -87,6 +91,7 @@
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<ItemGroup>
Expand All @@ -110,6 +115,7 @@
</Reference>
<Reference Include="Microsoft.AnalysisServices.AdomdClient, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<SpecificVersion>True</SpecificVersion>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.AnalysisServices.BackEnd">
<HintPath>$(ProgramFiles)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\Business Intelligence Semantic Model\Microsoft.AnalysisServices.BackEnd.dll</HintPath>
Expand All @@ -129,16 +135,18 @@
<HintPath>c:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Microsoft.AnalysisServices.Design.DLL</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.AnalysisServices.MPFProjectBase, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=x86">
<HintPath>$(ProgramFiles)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\Business Intelligence Semantic Model\Microsoft.AnalysisServices.MPFProjectBase.dll</HintPath>
<Reference Include="Microsoft.AnalysisServices.MPFProjectBase.11, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies\Business Intelligence Semantic Model\Microsoft.AnalysisServices.MPFProjectBase.11.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.AnalysisServices.Project, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<SpecificVersion>True</SpecificVersion>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.AnalysisServices.VSHost, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<HintPath>$(ProgramFiles)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\Business Intelligence Semantic Model\Microsoft.AnalysisServices.VSHost.dll</HintPath>
<Reference Include="Microsoft.AnalysisServices.VSHost.11, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies\Business Intelligence Semantic Model\Microsoft.AnalysisServices.VSHost.11.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.DataTransformationServices.Controls, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
Expand All @@ -161,6 +169,7 @@
</Reference>
<Reference Include="Microsoft.DataWarehouse.Interfaces, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<SpecificVersion>True</SpecificVersion>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.DataWarehouse.VsIntegration, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<SpecificVersion>True</SpecificVersion>
Expand All @@ -169,25 +178,29 @@
</Reference>
<Reference Include="Microsoft.ReportViewer.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<HintPath>..\..\..\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.Common\11.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.Common.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.ReportViewer.WinForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<HintPath>..\..\..\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WinForms\11.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.WinForms.DLL</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.SqlServer.DlgGrid, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<SpecificVersion>True</SpecificVersion>
<HintPath>.\Microsoft.SqlServer.DlgGrid.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SqlServer.DTSPipelineWrap, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<SpecificVersion>True</SpecificVersion>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.SQLServer.DTSRuntimeWrap, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91">
<SpecificVersion>True</SpecificVersion>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.SqlServer.ExecPackageTaskWrap, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<Reference Include="Microsoft.SqlServer.ExecPackageTaskWrap, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>False</EmbedInteropTypes>
<HintPath>..\..\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SqlServer.ExecPackageTaskWrap\v4.0_12.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.ExecPackageTaskWrap.dll</HintPath>
<HintPath>..\..\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SqlServer.ExecPackageTaskWrap\v4.0_11.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.ExecPackageTaskWrap.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.SqlServer.Graph, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand All @@ -204,19 +217,25 @@
</Reference>
<Reference Include="Microsoft.SQLServer.ManagedDTS, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<SpecificVersion>True</SpecificVersion>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.SqlServer.SQLTask, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Program Files (x86)\Microsoft SQL Server\110\DTS\Tasks\Microsoft.SqlServer.SQLTask.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<SpecificVersion>True</SpecificVersion>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Shell, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="msddsp, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>True</SpecificVersion>
<HintPath>DLLs\SQL2012\msddsp.dll</HintPath>
Expand Down Expand Up @@ -265,6 +284,7 @@
</Reference>
<Reference Include="Microsoft.SqlServer.Dts.Design, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91">
<SpecificVersion>True</SpecificVersion>
<Private>False</Private>
</Reference>
<Reference Include="WindowsBase" />
</ItemGroup>
Expand Down Expand Up @@ -509,12 +529,6 @@
<Compile Include="SSIS\DesignPracticesPlugin.cs" />
<Compile Include="SSIS\DesignPracticeScanner\DesignPractice.cs" />
<Compile Include="SSIS\DesignPracticeScanner\DesignPractices.cs" />
<Compile Include="SSIS\FindReferences.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="SSIS\FindReferences.Designer.cs">
<DependentUpon>FindReferences.cs</DependentUpon>
</Compile>
<Compile Include="SSIS\FindReferencesControl.cs">
<SubType>UserControl</SubType>
</Compile>
Expand All @@ -527,9 +541,18 @@
<Compile Include="SSIS\FindUnusedVariables.Designer.cs">
<DependentUpon>FindUnusedVariables.cs</DependentUpon>
</Compile>
<Compile Include="SSIS\FindVariableReferences.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="SSIS\FindVariableReferences.Designer.cs">
<DependentUpon>FindVariableReferences.cs</DependentUpon>
</Compile>
<Compile Include="SSIS\FindVariables.cs" />
<Compile Include="SSIS\PackageHelper.cs">
</Compile>
<Compile Include="SSIS\ParametersWindowPlugin.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="SSIS\SortablePackagePropertiesPlugin.cs" />
<Compile Include="SSIS\RelativePathsPlugin.cs" />
<Compile Include="SSIS\AutoSortProjectFilesPlugin.cs" />
Expand Down Expand Up @@ -972,16 +995,16 @@
<DependentUpon>DesignWarningsOptionsPage.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="SSIS\FindReferences.resx">
<DependentUpon>FindReferences.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="SSIS\FindReferencesControl.resx">
<DependentUpon>FindReferencesControl.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="SSIS\FindUnusedVariables.resx">
<DependentUpon>FindUnusedVariables.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="SSIS\FindVariableReferences.resx">
<DependentUpon>FindVariableReferences.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="SSIS\SortablePackageProperties.rdlc" />
<EmbeddedResource Include="SSIS\ExpressionListControl.resx">
<DependentUpon>ExpressionListControl.cs</DependentUpon>
Expand Down
4 changes: 2 additions & 2 deletions SQL2012_BIDSHelper.csproj.user
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ProjectFiles</ProjectView>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
<PropertyGroup>
<ReferencePath>C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\;C:\Program Files (x86)\Microsoft SQL Server\110\SDK\Assemblies\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies\Business Intelligence Semantic Model\</ReferencePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<StartAction>Program</StartAction>
<StartProgram>C:\Program Files %28x86%29\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe</StartProgram>
<StartArguments>/resetaddin BIDSHelper2012-ForTesting.addin</StartArguments>
<StartArguments>"C:\Users\greendg\Documents\Visual Studio 2012\Projects\SSISPlay\SSISPlay.sln"</StartArguments>
</PropertyGroup>
</Project>
19 changes: 5 additions & 14 deletions SQL2014_BIDSHelper.csproj
Expand Up @@ -503,17 +503,11 @@
<Compile Include="SSIS\DesignPracticesPlugin.cs" />
<Compile Include="SSIS\DesignPracticeScanner\DesignPractice.cs" />
<Compile Include="SSIS\DesignPracticeScanner\DesignPractices.cs" />
<Compile Include="SSIS\FindReferences.cs">
<Compile Include="SSIS\FindVariableReferences.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="SSIS\FindReferences.Designer.cs">
<DependentUpon>FindReferences.cs</DependentUpon>
</Compile>
<Compile Include="SSIS\FindReferencesControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="SSIS\FindReferencesControl.Designer.cs">
<DependentUpon>FindReferencesControl.cs</DependentUpon>
<Compile Include="SSIS\FindVariableReferences.Designer.cs">
<DependentUpon>FindVariableReferences.cs</DependentUpon>
</Compile>
<Compile Include="SSIS\FindUnusedVariables.cs">
<SubType>Form</SubType>
Expand Down Expand Up @@ -967,11 +961,8 @@
<DependentUpon>DesignWarningsOptionsPage.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="SSIS\FindReferences.resx">
<DependentUpon>FindReferences.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="SSIS\FindReferencesControl.resx">
<DependentUpon>FindReferencesControl.cs</DependentUpon>
<EmbeddedResource Include="SSIS\FindVariableReferences.resx">
<DependentUpon>FindVariableReferences.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="SSIS\FindUnusedVariables.resx">
Expand Down
22 changes: 17 additions & 5 deletions SSIS/Biml/BimlUtility.cs
Expand Up @@ -113,14 +113,26 @@ private static string GetValidationReporterMessage(ValidationItem item)
builder.AppendFormat("Schema {0}. ", item.SchemaName);
}

if (item.Exception != null)
ParseException(item.Exception, ref builder);

return builder.ToString().TrimEnd();
}

private static void ParseException(System.Exception exception, ref StringBuilder builder)
{
if (exception == null)
{
// Just show the exception type name, which can help indicate the type of issue, e.g. invalid XML vs invalid BIML
// We don't want the full Exception as it is confusing and makes you think something has gone wrong.
builder.AppendFormat("Exception type: {0}", item.Exception.GetType().Name);
return;
}

return builder.ToString().TrimEnd();
// Changed my mind!!!
//// Just show the exception type name, which can help indicate the type of issue, e.g. invalid XML vs invalid BIML
//// We don't want the full Exception as it is confusing and makes you think something has gone wrong.
//builder.AppendFormat("Exception type: {0}", item.Exception.GetType().Name);

builder.AppendFormat("\tException type: {0}, Message: {1}\r\n", exception.GetType().Name, exception.Message);

ParseException(exception.InnerException, ref builder);
}

private static void GetMessageString(string input, ref StringBuilder builder)
Expand Down

0 comments on commit 3f27684

Please sign in to comment.