Skip to content

Commit

Permalink
attempt to update Signum Analyzer, waiting for dotnet/roslyn#17974 (c…
Browse files Browse the repository at this point in the history
  • Loading branch information
olmobrutall committed Oct 3, 2018
1 parent 9975360 commit 62c00bc
Show file tree
Hide file tree
Showing 14 changed files with 63 additions and 316 deletions.
32 changes: 0 additions & 32 deletions Signum.Analyzer/Signum.Analyzer.Test/Properties/AssemblyInfo.cs

This file was deleted.

155 changes: 23 additions & 132 deletions Signum.Analyzer/Signum.Analyzer.Test/Signum.Analyzer.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,140 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{176CB0AA-80C9-432D-875C-4D1B1BAADBB3}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Signum.Analyzer.Test</RootNamespace>
<AssemblyName>Signum.Analyzer.Test</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CodeAnalysis, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CodeAnalysis.Common.1.0.0\lib\net45\Microsoft.CodeAnalysis.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.CodeAnalysis.CSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CodeAnalysis.CSharp.1.0.0\lib\net45\Microsoft.CodeAnalysis.CSharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.CodeAnalysis.CSharp.Workspaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CodeAnalysis.CSharp.Workspaces.1.0.0\lib\net45\Microsoft.CodeAnalysis.CSharp.Workspaces.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.CodeAnalysis.Workspaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CodeAnalysis.Workspaces.Common.1.0.0\lib\net45\Microsoft.CodeAnalysis.Workspaces.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.CodeAnalysis.Workspaces.Desktop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CodeAnalysis.Workspaces.Common.1.0.0\lib\net45\Microsoft.CodeAnalysis.Workspaces.Desktop.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Collections.Immutable, Version=1.1.36.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Collections.Immutable.1.1.36\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Composition.AttributedModel, Version=1.0.27.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.AttributedModel.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Composition.Convention, Version=1.0.27.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.Convention.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Composition.Hosting, Version=1.0.27.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.Hosting.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Composition.Runtime, Version=1.0.27.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.Runtime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Composition.TypedParts, Version=1.0.27.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.TypedParts.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Reflection.Metadata, Version=1.0.21.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reflection.Metadata.1.0.21\lib\portable-net45+win8\System.Reflection.Metadata.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
</ItemGroup>
<ItemGroup>
<Compile Include="LiteCastTest.cs" />
<Compile Include="LiteEqualiyTest.cs" />
<Compile Include="ExpressionFieldTest.cs" />
<Compile Include="Verifiers\CodeFixVerifier.cs" />
<Compile Include="Verifiers\DiagnosticVerifier.cs" />
<Compile Include="AutoPropertyTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Signum.Engine\Signum.Engine.csproj">
<Project>{7f2db6fe-c109-4057-b207-c62a767f905d}</Project>
<Name>Signum.Engine</Name>
</ProjectReference>
<ProjectReference Include="..\..\Signum.Entities\Signum.Entities.csproj">
<Project>{f2b51d08-498d-4c9f-8112-9521a7762b02}</Project>
<Name>Signum.Entities</Name>
</ProjectReference>
<ProjectReference Include="..\..\Signum.Utilities\Signum.Utilities.csproj">
<Project>{f7d3f72d-741d-4f67-8cf8-cd41b9035fed}</Project>
<Name>Signum.Utilities</Name>
</ProjectReference>
<ProjectReference Include="..\Signum.Analyzer\Signum.Analyzer.csproj">
<Project>{76c5cd0b-36e5-431f-904b-8c97dd215d42}</Project>
<Name>Signum.Analyzer</Name>
</ProjectReference>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="2.6.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="2.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
</ItemGroup>

<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
<Folder Include="Properties\" />
</ItemGroup>

<ItemGroup>
<Analyzer Include="..\packages\Microsoft.CodeAnalysis.Analyzers.1.0.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll" />
<Analyzer Include="..\packages\Microsoft.CodeAnalysis.Analyzers.1.0.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" />
<ProjectReference Include="..\..\Signum.Engine\Signum.Engine.csproj" />
<ProjectReference Include="..\..\Signum.Entities\Signum.Entities.csproj" />
<ProjectReference Include="..\..\Signum.Utilities\Signum.Utilities.csproj" />
<ProjectReference Include="..\Signum.Analyzer\Signum.Analyzer.csproj" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>


</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ namespace TestHelper
public abstract partial class CodeFixVerifier : DiagnosticVerifier
{
/// <summary>
/// Returns the codefix being tested (C#) - to be implemented in non-abstract class
/// </summary>
/// <returns>The CodeFixProvider to be used for CSharp code</returns>
protected virtual CodeFixProvider GetCSharpCodeFixProvider()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ protected static Document CreateDocument(string source)
}

private static readonly MetadataReference CorlibReference = MetadataReference.CreateFromFile(typeof(object).Assembly.Location);
private static readonly MetadataReference SystemCoreReference = MetadataReference.CreateFromFile(typeof(Enumerable).Assembly.Location);
private static readonly MetadataReference SystemRuntimeReference = MetadataReference.CreateFromFile(typeof(DateTime).Assembly.Location);
private static readonly MetadataReference SystemLinqReference = MetadataReference.CreateFromFile(typeof(Enumerable).Assembly.Location);
private static readonly MetadataReference CSharpSymbolsReference = MetadataReference.CreateFromFile(typeof(CSharpCompilation).Assembly.Location);
private static readonly MetadataReference CodeAnalysisReference = MetadataReference.CreateFromFile(typeof(Compilation).Assembly.Location);
private static readonly MetadataReference EntityReference = MetadataReference.CreateFromFile(typeof(Entity).Assembly.Location);
Expand All @@ -263,7 +264,8 @@ private static Project CreateProject(string[] sources)
.CurrentSolution
.AddProject(projectId, TestProjectName, TestProjectName, LanguageNames.CSharp)
.AddMetadataReference(projectId, CorlibReference)
.AddMetadataReference(projectId, SystemCoreReference)
.AddMetadataReference(projectId, SystemRuntimeReference)
.AddMetadataReference(projectId, SystemLinqReference)
.AddMetadataReference(projectId, CSharpSymbolsReference)
.AddMetadataReference(projectId, CodeAnalysisReference)
.AddMetadataReference(projectId, EntityReference)
Expand Down
19 changes: 14 additions & 5 deletions Signum.Analyzer/Signum.Analyzer.sln
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2036
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Signum.Analyzer.Test", "Signum.Analyzer.Test\Signum.Analyzer.Test.csproj", "{176CB0AA-80C9-432D-875C-4D1B1BAADBB3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Signum.Analyzer", "Signum.Analyzer\Signum.Analyzer.csproj", "{76C5CD0B-36E5-431F-904B-8C97DD215D42}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Signum.Engine", "..\Signum.Engine\Signum.Engine.csproj", "{7F2DB6FE-C109-4057-B207-C62A767F905D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Signum.Engine", "..\Signum.Engine\Signum.Engine.csproj", "{7F2DB6FE-C109-4057-B207-C62A767F905D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Signum.Entities", "..\Signum.Entities\Signum.Entities.csproj", "{F2B51D08-498D-4C9F-8112-9521A7762B02}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Signum.Entities", "..\Signum.Entities\Signum.Entities.csproj", "{F2B51D08-498D-4C9F-8112-9521A7762B02}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Signum.Utilities", "..\Signum.Utilities\Signum.Utilities.csproj", "{F7D3F72D-741D-4F67-8CF8-CD41B9035FED}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Signum.Utilities", "..\Signum.Utilities\Signum.Utilities.csproj", "{F7D3F72D-741D-4F67-8CF8-CD41B9035FED}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Signum.MSBuildTask", "..\Signum.MSBuildTask\Signum.MSBuildTask.csproj", "{FDF4C8D3-6C88-4F11-91CB-3EA9CDC1094E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -39,8 +41,15 @@ Global
{F7D3F72D-741D-4F67-8CF8-CD41B9035FED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F7D3F72D-741D-4F67-8CF8-CD41B9035FED}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F7D3F72D-741D-4F67-8CF8-CD41B9035FED}.Release|Any CPU.Build.0 = Release|Any CPU
{FDF4C8D3-6C88-4F11-91CB-3EA9CDC1094E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FDF4C8D3-6C88-4F11-91CB-3EA9CDC1094E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FDF4C8D3-6C88-4F11-91CB-3EA9CDC1094E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FDF4C8D3-6C88-4F11-91CB-3EA9CDC1094E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {940107F0-B289-49BA-96A1-8CA9AE36F33C}
EndGlobalSection
EndGlobal
2 changes: 1 addition & 1 deletion Signum.Analyzer/Signum.Analyzer/AutoPropertyAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Signum.Analyzer
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class AutoPropertyAnalyzer : DiagnosticAnalyzer
{
public static readonly string DiagnosticId = "SF0001";
public const string DiagnosticId = "SF0001";

internal static DiagnosticDescriptor Rule = new DiagnosticDescriptor(DiagnosticId,
"Use auto-properties in entities",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public static class AutoPropertyFixer
{
public static async Task<Solution> FixAllProperties(Document document, ClassDeclarationSyntax parentClass, CancellationToken cancellationToken)
{
throw new InvalidCastException();

var currentSolution = document.Project.Solution;
var currentDocument = document;
var currentClass = parentClass;
Expand Down
2 changes: 1 addition & 1 deletion Signum.Analyzer/Signum.Analyzer/ExpressionFieldAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Signum.Analyzer
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class ExpressionFieldAnalyzer : DiagnosticAnalyzer
{
public static readonly string DiagnosticId = "SF0002";
public const string DiagnosticId = "SF0002";

internal static DiagnosticDescriptor Rule = new DiagnosticDescriptor(DiagnosticId,
"Use ExpressionFieldAttribute in non-trivial method or property",
Expand Down
31 changes: 0 additions & 31 deletions Signum.Analyzer/Signum.Analyzer/Properties/AssemblyInfo.cs

This file was deleted.

Loading

0 comments on commit 62c00bc

Please sign in to comment.