Skip to content

Commit

Permalink
Use GlobalAssemblyInfo.cs for all projects.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrunwald committed Feb 20, 2012
1 parent 2faf35e commit 191ac7c
Show file tree
Hide file tree
Showing 19 changed files with 131 additions and 110 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
20 changes: 1 addition & 19 deletions ICSharpCode.NRefactory.CSharp/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,4 @@
// 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")]
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

using System;
using ICSharpCode.NRefactory.Documentation;
using ICSharpCode.NRefactory.Editor;
using ICSharpCode.NRefactory.TypeSystem;

namespace ICSharpCode.NRefactory.CSharp.TypeSystem
Expand All @@ -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)
{
}

Expand Down
5 changes: 3 additions & 2 deletions ICSharpCode.NRefactory.CSharp/TypeSystem/CSharpParsedFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -215,9 +216,9 @@ public DocumentationComment GetDocumentation(IUnresolvedEntity entity, IEntity r
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));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ public IInterningProvider InterningProvider {
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>
Expand Down Expand Up @@ -1117,6 +1123,8 @@ void ConvertParameters(IList<IUnresolvedParameter> outputList, IEnumerable<Param
#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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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" />
Expand All @@ -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" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -30,19 +31,22 @@ public static void Run(Solution solution)
{
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,4 @@
// 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 changes: 2 additions & 0 deletions ICSharpCode.NRefactory.ConsistencyCheck/Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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>
Expand Down Expand Up @@ -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>
Expand Down
20 changes: 1 addition & 19 deletions ICSharpCode.NRefactory.Demo/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,4 @@
// 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")]
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,17 @@ public void Generic()
});
}

[Test]
public void MixedGeneric()
{
ParseUtilCSharp.AssertDocumentationReference(
"IGeneric<X, Y}",
new DocumentationReference {
MemberName = "IGeneric",
TypeArguments = { new SimpleType("X"), new SimpleType("Y") }
});
}

[Test]
public void MethodInGeneric()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,63 @@ public void TypeDocumentationLookup()
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);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
18 changes: 1 addition & 17 deletions ICSharpCode.NRefactory.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,4 @@
// 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 changes: 3 additions & 0 deletions ICSharpCode.NRefactory.VB/ICSharpCode.NRefactory.VB.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
22 changes: 1 addition & 21 deletions ICSharpCode.NRefactory.VB/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,4 @@
// 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")]
Loading

0 comments on commit 191ac7c

Please sign in to comment.