From 952696941aaf18089a0a37f2f4108c47a561045d Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sat, 3 Sep 2011 16:55:00 +0200 Subject: [PATCH] Adjust SharpDevelop to NRefactory changes (move ICSharpCode.Editor -> ICSharpCode.NRefactory.Editor; put NR.C# in separate assembly) --- ICSharpCode.NRefactory.CSharp/.gitignore | 3 +++ .../ICSharpCode.NRefactory.CSharp.csproj | 4 ++++ .../Properties/AssemblyInfo.cs | 3 ++- ICSharpCode.NRefactory/TypeSystem/CecilLoader.cs | 16 ++++++++++++++++ .../TypeSystem/IAnnotatable.cs | 2 ++ .../TypeSystem/Implementation/AbstractMember.cs | 1 + .../Implementation/TypeWithElementType.cs | 1 + ICSharpCode.NRefactory/Utils/7BitEncodedInts.cs | 6 ++++++ ICSharpCode.NRefactory/Utils/BitVector16.cs | 1 + 9 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 ICSharpCode.NRefactory.CSharp/.gitignore diff --git a/ICSharpCode.NRefactory.CSharp/.gitignore b/ICSharpCode.NRefactory.CSharp/.gitignore new file mode 100644 index 0000000000..9ce745d95d --- /dev/null +++ b/ICSharpCode.NRefactory.CSharp/.gitignore @@ -0,0 +1,3 @@ + +bin/ +obj/ \ No newline at end of file diff --git a/ICSharpCode.NRefactory.CSharp/ICSharpCode.NRefactory.CSharp.csproj b/ICSharpCode.NRefactory.CSharp/ICSharpCode.NRefactory.CSharp.csproj index 9fd0af8d3e..a0c7024ec6 100644 --- a/ICSharpCode.NRefactory.CSharp/ICSharpCode.NRefactory.CSharp.csproj +++ b/ICSharpCode.NRefactory.CSharp/ICSharpCode.NRefactory.CSharp.csproj @@ -14,6 +14,10 @@ False 4 false + True + ..\ICSharpCode.NRefactory.snk + False + File AnyCPU diff --git a/ICSharpCode.NRefactory/Properties/AssemblyInfo.cs b/ICSharpCode.NRefactory/Properties/AssemblyInfo.cs index 41f69eccd2..dbfc9e9759 100644 --- a/ICSharpCode.NRefactory/Properties/AssemblyInfo.cs +++ b/ICSharpCode.NRefactory/Properties/AssemblyInfo.cs @@ -21,6 +21,7 @@ using System.Runtime.InteropServices; // 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 : // @@ -28,4 +29,4 @@ using System.Runtime.InteropServices; // // 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.0")] +[assembly: AssemblyVersion("5.0.0.1")] diff --git a/ICSharpCode.NRefactory/TypeSystem/CecilLoader.cs b/ICSharpCode.NRefactory/TypeSystem/CecilLoader.cs index ab3ae6ca3b..a2085d64eb 100644 --- a/ICSharpCode.NRefactory/TypeSystem/CecilLoader.cs +++ b/ICSharpCode.NRefactory/TypeSystem/CecilLoader.cs @@ -95,6 +95,7 @@ namespace ICSharpCode.NRefactory.TypeSystem /// Loads the assembly definition into a project content. /// /// IProjectContent that represents the assembly + [CLSCompliant(false)] public IProjectContent LoadAssembly(AssemblyDefinition assemblyDefinition) { if (assemblyDefinition == null) @@ -155,6 +156,7 @@ namespace ICSharpCode.NRefactory.TypeSystem /// The Cecil TypeDefinition. /// The project content used as parent for the new type. /// ITypeDefinition representing the Cecil type. + [CLSCompliant(false)] public ITypeDefinition LoadType(TypeDefinition typeDefinition, IProjectContent projectContent) { if (typeDefinition == null) @@ -317,6 +319,7 @@ namespace ICSharpCode.NRefactory.TypeSystem /// This is used to support the 'dynamic' type. /// The entity that owns this type reference. /// Used for generic type references. + [CLSCompliant(false)] public ITypeReference ReadTypeReference( TypeReference type, ICustomAttributeProvider typeAttributes = null, @@ -791,6 +794,7 @@ namespace ICSharpCode.NRefactory.TypeSystem } } + [CLSCompliant(false)] public IAttribute ReadAttribute(CustomAttribute attribute) { if (attribute == null) @@ -852,6 +856,7 @@ namespace ICSharpCode.NRefactory.TypeSystem #endregion #region Read Constant Value + [CLSCompliant(false)] public IConstantValue ReadConstantValue(CustomAttributeArgument arg) { object value = arg.Value; @@ -1100,6 +1105,7 @@ namespace ICSharpCode.NRefactory.TypeSystem #endregion #region Read Method + [CLSCompliant(false)] public IMethod ReadMethod(MethodDefinition method, ITypeDefinition parentType, EntityType methodType = EntityType.Method) { DefaultMethod m = new DefaultMethod(parentType, method.Name); @@ -1206,6 +1212,7 @@ namespace ICSharpCode.NRefactory.TypeSystem #endregion #region Read Parameter + [CLSCompliant(false)] public IParameter ReadParameter(ParameterDefinition parameter, IParameterizedMember parentMember = null) { if (parameter == null) @@ -1248,6 +1255,7 @@ namespace ICSharpCode.NRefactory.TypeSystem || att == FieldAttributes.FamORAssem; } + [CLSCompliant(false)] public IField ReadField(FieldDefinition field, ITypeDefinition parentType) { if (field == null) @@ -1318,6 +1326,7 @@ namespace ICSharpCode.NRefactory.TypeSystem #endregion #region Read Property + [CLSCompliant(false)] public IProperty ReadProperty(PropertyDefinition property, ITypeDefinition parentType, EntityType propertyType = EntityType.Property) { if (property == null) @@ -1362,6 +1371,7 @@ namespace ICSharpCode.NRefactory.TypeSystem #endregion #region Read Event + [CLSCompliant(false)] public IEvent ReadEvent(EventDefinition ev, ITypeDefinition parentType) { if (ev == null) @@ -1408,11 +1418,13 @@ namespace ICSharpCode.NRefactory.TypeSystem return result as T; } + [CLSCompliant(false)] public AssemblyDefinition GetCecilObject (IProjectContent content) { return InternalGetCecilObject (content); } + [CLSCompliant(false)] public TypeDefinition GetCecilObject (ITypeDefinition type) { if (type == null) @@ -1423,21 +1435,25 @@ namespace ICSharpCode.NRefactory.TypeSystem return cecilType.typeDefinition; } + [CLSCompliant(false)] public MethodDefinition GetCecilObject (IMethod method) { return InternalGetCecilObject (method); } + [CLSCompliant(false)] public FieldDefinition GetCecilObject (IField field) { return InternalGetCecilObject (field); } + [CLSCompliant(false)] public EventDefinition GetCecilObject (IEvent evt) { return InternalGetCecilObject (evt); } + [CLSCompliant(false)] public PropertyDefinition GetCecilObject (IProperty property) { return InternalGetCecilObject (property); diff --git a/ICSharpCode.NRefactory/TypeSystem/IAnnotatable.cs b/ICSharpCode.NRefactory/TypeSystem/IAnnotatable.cs index 2021496969..25f2684a97 100644 --- a/ICSharpCode.NRefactory/TypeSystem/IAnnotatable.cs +++ b/ICSharpCode.NRefactory/TypeSystem/IAnnotatable.cs @@ -83,6 +83,8 @@ namespace ICSharpCode.NRefactory // Annotations: points either null (no annotations), to the single annotation, // or to an AnnotationList. // Once it is pointed at an AnnotationList, it will never change (this allows thread-safety support by locking the list) + + [CLSCompliant(false)] protected object annotations; sealed class AnnotationList : List, ICloneable diff --git a/ICSharpCode.NRefactory/TypeSystem/Implementation/AbstractMember.cs b/ICSharpCode.NRefactory/TypeSystem/Implementation/AbstractMember.cs index 15a0d63ea4..d706d1c826 100644 --- a/ICSharpCode.NRefactory/TypeSystem/Implementation/AbstractMember.cs +++ b/ICSharpCode.NRefactory/TypeSystem/Implementation/AbstractMember.cs @@ -44,6 +44,7 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation Accessibility accessibility; EntityType entityType; + [CLSCompliant(false)] protected BitVector16 flags; const ushort FlagSealed = 0x0001; const ushort FlagAbstract = 0x0002; diff --git a/ICSharpCode.NRefactory/TypeSystem/Implementation/TypeWithElementType.cs b/ICSharpCode.NRefactory/TypeSystem/Implementation/TypeWithElementType.cs index ff08e14a35..0aa6d5cf69 100644 --- a/ICSharpCode.NRefactory/TypeSystem/Implementation/TypeWithElementType.cs +++ b/ICSharpCode.NRefactory/TypeSystem/Implementation/TypeWithElementType.cs @@ -23,6 +23,7 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation [Serializable] public abstract class TypeWithElementType : AbstractType { + [CLSCompliant(false)] protected IType elementType; protected TypeWithElementType(IType elementType) diff --git a/ICSharpCode.NRefactory/Utils/7BitEncodedInts.cs b/ICSharpCode.NRefactory/Utils/7BitEncodedInts.cs index b16047c95c..01f507293f 100644 --- a/ICSharpCode.NRefactory/Utils/7BitEncodedInts.cs +++ b/ICSharpCode.NRefactory/Utils/7BitEncodedInts.cs @@ -35,6 +35,7 @@ namespace ICSharpCode.NRefactory.Utils return unchecked((short)(ushort)base.Read7BitEncodedInt()); } + [CLSCompliant(false)] public override ushort ReadUInt16() { return unchecked((ushort)base.Read7BitEncodedInt()); @@ -45,6 +46,7 @@ namespace ICSharpCode.NRefactory.Utils return base.Read7BitEncodedInt(); } + [CLSCompliant(false)] public override uint ReadUInt32() { return unchecked((uint)base.Read7BitEncodedInt()); @@ -55,6 +57,7 @@ namespace ICSharpCode.NRefactory.Utils return unchecked((long)this.ReadUInt64()); } + [CLSCompliant(false)] public override ulong ReadUInt64() { ulong num = 0; @@ -85,6 +88,7 @@ namespace ICSharpCode.NRefactory.Utils base.Write7BitEncodedInt(unchecked((ushort)value)); } + [CLSCompliant(false)] public override void Write(ushort value) { base.Write7BitEncodedInt(value); @@ -95,6 +99,7 @@ namespace ICSharpCode.NRefactory.Utils base.Write7BitEncodedInt(value); } + [CLSCompliant(false)] public override void Write(uint value) { base.Write7BitEncodedInt(unchecked((int)value)); @@ -105,6 +110,7 @@ namespace ICSharpCode.NRefactory.Utils this.Write(unchecked((ulong)value)); } + [CLSCompliant(false)] public override void Write(ulong value) { while (value >= 128) { diff --git a/ICSharpCode.NRefactory/Utils/BitVector16.cs b/ICSharpCode.NRefactory/Utils/BitVector16.cs index a8b5122159..62fa602c72 100644 --- a/ICSharpCode.NRefactory/Utils/BitVector16.cs +++ b/ICSharpCode.NRefactory/Utils/BitVector16.cs @@ -24,6 +24,7 @@ namespace ICSharpCode.NRefactory.Utils /// Holds 16 boolean values. /// [Serializable] + [CLSCompliant(false)] public struct BitVector16 : IEquatable { ushort data;