Browse Source

Use GlobalAssemblyInfo.cs for all projects.

newNRvisualizers
Daniel Grunwald 14 years ago
parent
commit
191ac7c9df
  1. 3
      ICSharpCode.NRefactory.CSharp/ICSharpCode.NRefactory.CSharp.csproj
  2. 20
      ICSharpCode.NRefactory.CSharp/Properties/AssemblyInfo.cs
  3. 3
      ICSharpCode.NRefactory.CSharp/TypeSystem/CSharpDocumentationComment.cs
  4. 5
      ICSharpCode.NRefactory.CSharp/TypeSystem/CSharpParsedFile.cs
  5. 8
      ICSharpCode.NRefactory.CSharp/TypeSystem/TypeSystemConvertVisitor.cs
  6. 12
      ICSharpCode.NRefactory.ConsistencyCheck/ICSharpCode.NRefactory.ConsistencyCheck.csproj
  7. 10
      ICSharpCode.NRefactory.ConsistencyCheck/IDStringConsistencyCheck.cs
  8. 20
      ICSharpCode.NRefactory.ConsistencyCheck/Properties/AssemblyInfo.cs
  9. 2
      ICSharpCode.NRefactory.ConsistencyCheck/Readme.txt
  10. 5
      ICSharpCode.NRefactory.Demo/ICSharpCode.NRefactory.Demo.csproj
  11. 20
      ICSharpCode.NRefactory.Demo/Properties/AssemblyInfo.cs
  12. 11
      ICSharpCode.NRefactory.Tests/Documentation/CSharpCrefParserTests.cs
  13. 51
      ICSharpCode.NRefactory.Tests/Documentation/CSharpDocumentationTests.cs
  14. 3
      ICSharpCode.NRefactory.Tests/ICSharpCode.NRefactory.Tests.csproj
  15. 18
      ICSharpCode.NRefactory.Tests/Properties/AssemblyInfo.cs
  16. 3
      ICSharpCode.NRefactory.VB/ICSharpCode.NRefactory.VB.csproj
  17. 22
      ICSharpCode.NRefactory.VB/Properties/AssemblyInfo.cs
  18. 22
      ICSharpCode.NRefactory/Documentation/DocumentationComment.cs
  19. 3
      ICSharpCode.NRefactory/Documentation/XmlDocumentationProvider.cs

3
ICSharpCode.NRefactory.CSharp/ICSharpCode.NRefactory.CSharp.csproj

@ -56,6 +56,9 @@ @@ -56,6 +56,9 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\ICSharpCode.NRefactory\Properties\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Analysis\ControlFlow.cs" />
<Compile Include="Analysis\DefiniteAssignmentAnalysis.cs" />
<Compile Include="Analysis\ReachabilityAnalysis.cs" />

20
ICSharpCode.NRefactory.CSharp/Properties/AssemblyInfo.cs

@ -10,22 +10,4 @@ using System.Runtime.InteropServices; @@ -10,22 +10,4 @@ using System.Runtime.InteropServices;
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ICSharpCode.NRefactory.CSharp")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("ICSharpCode")]
[assembly: AssemblyProduct("SharpDevelop/MonoDevelop")]
[assembly: AssemblyCopyright("Copyright 2010-2012 AlphaSierraPapa")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("5.0.0.4")]
[assembly: AssemblyDescription("C# parser and semantic analysis")]

3
ICSharpCode.NRefactory.CSharp/TypeSystem/CSharpDocumentationComment.cs

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
using System;
using ICSharpCode.NRefactory.Documentation;
using ICSharpCode.NRefactory.Editor;
using ICSharpCode.NRefactory.TypeSystem;
namespace ICSharpCode.NRefactory.CSharp.TypeSystem
@ -27,7 +28,7 @@ namespace ICSharpCode.NRefactory.CSharp.TypeSystem @@ -27,7 +28,7 @@ namespace ICSharpCode.NRefactory.CSharp.TypeSystem
/// </summary>
sealed class CSharpDocumentationComment : DocumentationComment
{
public CSharpDocumentationComment(string xmlDoc, ITypeResolveContext context) : base(xmlDoc, context)
public CSharpDocumentationComment(ITextSource xmlDoc, ITypeResolveContext context) : base(xmlDoc, context)
{
}

5
ICSharpCode.NRefactory.CSharp/TypeSystem/CSharpParsedFile.cs

@ -19,6 +19,7 @@ @@ -19,6 +19,7 @@
using System;
using System.Collections.Generic;
using ICSharpCode.NRefactory.Documentation;
using ICSharpCode.NRefactory.Editor;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.NRefactory.TypeSystem.Implementation;
using System.Linq;
@ -215,9 +216,9 @@ namespace ICSharpCode.NRefactory.CSharp.TypeSystem @@ -215,9 +216,9 @@ namespace ICSharpCode.NRefactory.CSharp.TypeSystem
var context = unresolvedTypeDef.CreateResolveContext(new SimpleTypeResolveContext(resolvedTypeDef));
if (resolvedEntity is IMember)
context = context.WithCurrentMember((IMember)resolvedEntity);
return new CSharpDocumentationComment(xmlDoc, context);
return new CSharpDocumentationComment(new StringTextSource(xmlDoc), context);
} else {
return new DocumentationComment(xmlDoc, new SimpleTypeResolveContext(resolvedEntity));
return new DocumentationComment(new StringTextSource(xmlDoc), new SimpleTypeResolveContext(resolvedEntity));
}
}
}

8
ICSharpCode.NRefactory.CSharp/TypeSystem/TypeSystemConvertVisitor.cs

@ -52,6 +52,12 @@ namespace ICSharpCode.NRefactory.CSharp.TypeSystem @@ -52,6 +52,12 @@ namespace ICSharpCode.NRefactory.CSharp.TypeSystem
set { interningProvider = value; }
}
/// <summary>
/// Gets/Sets whether to ignore XML documentation.
/// The default value is false.
/// </summary>
public bool SkipXmlDocumentation { get; set; }
/// <summary>
/// Creates a new TypeSystemConvertVisitor.
/// </summary>
@ -1117,6 +1123,8 @@ namespace ICSharpCode.NRefactory.CSharp.TypeSystem @@ -1117,6 +1123,8 @@ namespace ICSharpCode.NRefactory.CSharp.TypeSystem
#region XML Documentation
void AddXmlDocumentation(IUnresolvedEntity entity, AstNode entityDeclaration)
{
if (this.SkipXmlDocumentation)
return;
List<string> documentation = null;
for (AstNode node = entityDeclaration.PrevSibling; node != null && node.NodeType == NodeType.Whitespace; node = node.PrevSibling) {
Comment c = node as Comment;

12
ICSharpCode.NRefactory.ConsistencyCheck/ICSharpCode.NRefactory.ConsistencyCheck.csproj

@ -11,13 +11,17 @@ @@ -11,13 +11,17 @@
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'x86' ">
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputPath>bin\Debug\</OutputPath>
<DebugSymbols>True</DebugSymbols>
<DebugSymbols>true</DebugSymbols>
<DebugType>Full</DebugType>
<Optimize>False</Optimize>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
@ -31,6 +35,9 @@ @@ -31,6 +35,9 @@
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Build" />
<Reference Include="System" />
@ -47,6 +54,9 @@ @@ -47,6 +54,9 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\ICSharpCode.NRefactory\Properties\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="CSharpProject.cs" />
<Compile Include="FindReferencesConsistencyCheck.cs" />
<Compile Include="IDStringConsistencyCheck.cs" />

10
ICSharpCode.NRefactory.ConsistencyCheck/IDStringConsistencyCheck.cs

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
using ICSharpCode.NRefactory.Documentation;
using ICSharpCode.NRefactory.TypeSystem;
@ -30,19 +31,22 @@ namespace ICSharpCode.NRefactory.ConsistencyCheck @@ -30,19 +31,22 @@ namespace ICSharpCode.NRefactory.ConsistencyCheck
{
foreach (var project in solution.Projects) {
var compilation = project.Compilation;
HashSet<string> idStrings = new HashSet<string>();
var context = compilation.TypeResolveContext;
foreach (var typeDef in compilation.MainAssembly.GetAllTypeDefinitions()) {
Check(typeDef, context);
Check(typeDef, context, idStrings);
foreach (var member in typeDef.Members) {
Check(member, context);
Check(member, context, idStrings);
}
}
}
}
static void Check(IEntity entity, ITypeResolveContext context)
static void Check(IEntity entity, ITypeResolveContext context, HashSet<string> idStrings)
{
string id = IDStringProvider.GetIDString(entity);
if (!idStrings.Add(id))
throw new InvalidOperationException("Duplicate ID string " + id);
IEntity resolvedEntity = IDStringProvider.FindEntity(id, context);
if (resolvedEntity != entity)
throw new InvalidOperationException(id);

20
ICSharpCode.NRefactory.ConsistencyCheck/Properties/AssemblyInfo.cs

@ -10,22 +10,4 @@ using System.Runtime.InteropServices; @@ -10,22 +10,4 @@ using System.Runtime.InteropServices;
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ICSharpCode.NRefactory.ConsistencyCheck")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ICSharpCode.NRefactory.ConsistencyCheck")]
[assembly: AssemblyCopyright("Copyright 2011")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyDescription("Loads a solution and performs various self-tests using the parsed code.")]

2
ICSharpCode.NRefactory.ConsistencyCheck/Readme.txt

@ -5,5 +5,7 @@ These checks assume that the code is valid C# without any compilation errors, @@ -5,5 +5,7 @@ These checks assume that the code is valid C# without any compilation errors,
so make sure to only pass in compilable source code.
Checks currently being performed:
- Checks that ID strings are unique and refer back to the correct entity
- Roundtripping test: parses C# code and outputs it again using CSharpOutputVisitor, checking that only whitespace is changing
- ResolverTest: fully resolves all ASTs and validates that no errors are detected (no false positives in semantic error checking)
- RandomizedOrderResolverTest: checks that the order of Resolve()/GetResolverState() calls has no effect on the result

5
ICSharpCode.NRefactory.Demo/ICSharpCode.NRefactory.Demo.csproj

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<PropertyGroup>
<ProjectGuid>{9C19E629-C93E-4ACB-9A4B-13072B5AEF9D}</ProjectGuid>
@ -55,6 +55,9 @@ @@ -55,6 +55,9 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\ICSharpCode.NRefactory\Properties\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="CSDemo.cs" />
<Compile Include="CSDemo.Designer.cs">
<DependentUpon>CSDemo.cs</DependentUpon>

20
ICSharpCode.NRefactory.Demo/Properties/AssemblyInfo.cs

@ -10,22 +10,4 @@ using System.Runtime.InteropServices; @@ -10,22 +10,4 @@ using System.Runtime.InteropServices;
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ICSharpCode.NRefactory.Demo")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ICSharpCode.NRefactory.Demo")]
[assembly: AssemblyCopyright("Copyright 2010")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyDescription("WinForms-based demo application for NRefactory")]

11
ICSharpCode.NRefactory.Tests/Documentation/CSharpCrefParserTests.cs

@ -126,6 +126,17 @@ namespace ICSharpCode.NRefactory.Documentation @@ -126,6 +126,17 @@ namespace ICSharpCode.NRefactory.Documentation
});
}
[Test]
public void MixedGeneric()
{
ParseUtilCSharp.AssertDocumentationReference(
"IGeneric<X, Y}",
new DocumentationReference {
MemberName = "IGeneric",
TypeArguments = { new SimpleType("X"), new SimpleType("Y") }
});
}
[Test]
public void MethodInGeneric()
{

51
ICSharpCode.NRefactory.Tests/Documentation/CSharpDocumentationTests.cs

@ -45,18 +45,63 @@ namespace ICSharpCode.NRefactory.Documentation @@ -45,18 +45,63 @@ namespace ICSharpCode.NRefactory.Documentation
Init(@"using System;
/// <summary/>
class Test { }");
Assert.AreEqual(" <summary/>", typeDefinition.Documentation.Xml);
Assert.AreEqual("<summary/>", typeDefinition.Documentation.Xml);
}
[Test]
public void MultilineTypeDocumentationLookup()
public void TypeDocumentationLookup2()
{
Init(@"using System;
/// <summary>
/// Documentation
/// </summary>
class Test { }");
Assert.AreEqual(" <summary>" + Environment.NewLine + " Documentation" + Environment.NewLine + " </summary>", typeDefinition.Documentation.Xml);
Assert.AreEqual("<summary>" + Environment.NewLine + "Documentation" + Environment.NewLine + "</summary>", typeDefinition.Documentation.Xml);
}
[Test]
public void TypeDocumentationLookupWithIndentation()
{
Init(@"using System;
/// <summary>
/// Documentation
/// </summary>
class Test { }");
Assert.AreEqual("<summary>" + Environment.NewLine + " Documentation" + Environment.NewLine + "</summary>", typeDefinition.Documentation.Xml);
}
[Test]
public void MultilineDocumentation()
{
Init(@"using System;
/** <summary>Documentation</summary> */
class Test { }");
Assert.AreEqual("<summary>Documentation</summary>", typeDefinition.Documentation.Xml);
}
[Test]
public void MultilineDocumentation2()
{
Init(@"using System;
/**
<summary>
Documentation
</summary>
*/
class Test { }");
Assert.AreEqual("<summary>" + Environment.NewLine + " Documentation" + Environment.NewLine + "</summary>", typeDefinition.Documentation.Xml);
}
[Test]
public void MultilineDocumentationCommonPattern()
{
Init(@"using System;
/**
* <summary>
* Documentation
* </summary>*/
class Test { }");
Assert.AreEqual("<summary>" + Environment.NewLine + " Documentation" + Environment.NewLine + "</summary>", typeDefinition.Documentation.Xml);
}
}
}

3
ICSharpCode.NRefactory.Tests/ICSharpCode.NRefactory.Tests.csproj

@ -76,6 +76,9 @@ @@ -76,6 +76,9 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\ICSharpCode.NRefactory\Properties\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="CSharp\Analysis\DefiniteAssignmentTests.cs" />
<Compile Include="CSharp\AstStructureTests.cs" />
<Compile Include="CSharp\CSharpAmbienceTests.cs" />

18
ICSharpCode.NRefactory.Tests/Properties/AssemblyInfo.cs

@ -10,20 +10,4 @@ using System.Runtime.InteropServices; @@ -10,20 +10,4 @@ using System.Runtime.InteropServices;
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ICSharpCode.NRefactory.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyDescription("NRefactory unit tests")]

3
ICSharpCode.NRefactory.VB/ICSharpCode.NRefactory.VB.csproj

@ -47,6 +47,9 @@ @@ -47,6 +47,9 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\ICSharpCode.NRefactory\Properties\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Ast\AstNode.cs" />
<Compile Include="Ast\AstNodeCollection.cs" />
<Compile Include="Ast\Comment.cs" />

22
ICSharpCode.NRefactory.VB/Properties/AssemblyInfo.cs

@ -10,24 +10,4 @@ using System.Runtime.InteropServices; @@ -10,24 +10,4 @@ using System.Runtime.InteropServices;
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ICSharpCode.NRefactory.VB")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ICSharpCode.NRefactory.VB")]
[assembly: AssemblyCopyright("Copyright 2010")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
//[assembly: CLSCompliant(true)]
// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("5.0.0.4")]
[assembly: AssemblyDescription("VB syntax tree")]

22
ICSharpCode.NRefactory/Documentation/DocumentationComment.cs

@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System;
using ICSharpCode.NRefactory.Editor;
using ICSharpCode.NRefactory.TypeSystem;
namespace ICSharpCode.NRefactory.Documentation
@ -26,13 +27,13 @@ namespace ICSharpCode.NRefactory.Documentation @@ -26,13 +27,13 @@ namespace ICSharpCode.NRefactory.Documentation
/// </summary>
public class DocumentationComment
{
string xml;
ITextSource xml;
protected readonly ITypeResolveContext context;
/// <summary>
/// Gets the XML code for this documentation comment.
/// </summary>
public string Xml {
public ITextSource Xml {
get { return xml; }
}
@ -41,7 +42,7 @@ namespace ICSharpCode.NRefactory.Documentation @@ -41,7 +42,7 @@ namespace ICSharpCode.NRefactory.Documentation
/// </summary>
/// <param name="xml">The XML text.</param>
/// <param name="context">Context for resolving cref attributes.</param>
public DocumentationComment(string xml, ITypeResolveContext context)
public DocumentationComment(ITextSource xml, ITypeResolveContext context)
{
if (xml == null)
throw new ArgumentNullException("xml");
@ -51,6 +52,21 @@ namespace ICSharpCode.NRefactory.Documentation @@ -51,6 +52,21 @@ namespace ICSharpCode.NRefactory.Documentation
this.context = context;
}
/// <summary>
/// Creates a new DocumentationComment.
/// </summary>
/// <param name="xml">The XML text.</param>
/// <param name="context">Context for resolving cref attributes.</param>
public DocumentationComment(string xml, ITypeResolveContext context)
{
if (xml == null)
throw new ArgumentNullException("xml");
if (context == null)
throw new ArgumentNullException("context");
this.xml = new StringTextSource(xml);
this.context = context;
}
/// <summary>
/// Resolves the given cref value to an entity.
/// Returns null if the entity is not found, or if the cref attribute is syntactically invalid.

3
ICSharpCode.NRefactory/Documentation/XmlDocumentationProvider.cs

@ -22,6 +22,7 @@ using System.Diagnostics; @@ -22,6 +22,7 @@ using System.Diagnostics;
using System.IO;
using System.Runtime.Serialization;
using System.Xml;
using ICSharpCode.NRefactory.Editor;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.NRefactory.TypeSystem.Implementation;
@ -307,7 +308,7 @@ namespace ICSharpCode.NRefactory.Documentation @@ -307,7 +308,7 @@ namespace ICSharpCode.NRefactory.Documentation
{
string xmlDoc = GetDocumentation(IDStringProvider.GetIDString(entity));
if (xmlDoc != null) {
return new DocumentationComment(xmlDoc, new SimpleTypeResolveContext(entity));
return new DocumentationComment(new StringTextSource(xmlDoc), new SimpleTypeResolveContext(entity));
} else {
return null;
}

Loading…
Cancel
Save