From 909df643b554c9a3b10bac5c1713a1f568b718cf Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sat, 2 Jun 2018 13:07:02 +0200 Subject: [PATCH] Remove dead NRefactory code: DomRegion + IUnresolvedFile --- .../ICSharpCode.Decompiler.Tests.csproj | 2 +- .../CSharp/Syntax/AstNode.cs | 53 +--- .../CSharp/Syntax/SyntaxTree.cs | 7 - .../CSharp/TypeSystem/UsingScope.cs | 9 - .../ICSharpCode.Decompiler.csproj | 3 - .../TypeSystem/DomRegion.cs | 231 ------------------ ICSharpCode.Decompiler/TypeSystem/Error.cs | 140 ----------- .../TypeSystem/IAttribute.cs | 5 - .../TypeSystem/IUnresolvedFile.cs | 78 ------ .../DefaultUnresolvedAttribute.cs | 13 - .../Implementation/UnresolvedAttributeBlob.cs | 4 - .../UnresolvedSecurityDeclarationBlob.cs | 4 - .../TypeSystem/TypeSystemExtensions.cs | 27 -- 13 files changed, 9 insertions(+), 567 deletions(-) delete mode 100644 ICSharpCode.Decompiler/TypeSystem/DomRegion.cs delete mode 100644 ICSharpCode.Decompiler/TypeSystem/Error.cs delete mode 100644 ICSharpCode.Decompiler/TypeSystem/IUnresolvedFile.cs diff --git a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj index cc5d423c4..7576afbeb 100644 --- a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj +++ b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj @@ -7,7 +7,7 @@ True - $(NoWarn),67,169,1058,728,1720,649 + 1701;1702;1705,67,169,1058,728,1720,649,168,251 False diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/AstNode.cs b/ICSharpCode.Decompiler/CSharp/Syntax/AstNode.cs index 794a9f928..b12334470 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/AstNode.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/AstNode.cs @@ -194,24 +194,6 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax return child.EndLocation; } } - - public DomRegion Region { - get { - return new DomRegion (StartLocation, EndLocation); - } - } - - /// - /// Gets the region from StartLocation to EndLocation for this node. - /// The file name of the region is set based on the parent SyntaxTree's file name. - /// If this node is not connected to a whole compilation, the file name will be null. - /// - public DomRegion GetRegion() - { - var syntaxTree = (this.Ancestors.LastOrDefault() ?? this) as SyntaxTree; - string fileName = (syntaxTree != null ? syntaxTree.FileName : null); - return new DomRegion(fileName, this.StartLocation, this.EndLocation); - } public AstNode Parent { get { return parent; } @@ -310,40 +292,22 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax public IEnumerable DescendantsAndSelf { get { return GetDescendantsImpl(true); } } - - static bool IsInsideRegion(DomRegion region, AstNode pos) - { - if (region.IsEmpty) - return true; - var nodeRegion = pos.Region; - return region.IntersectsWith(nodeRegion) || region.OverlapsWith(nodeRegion); - } - + public IEnumerable DescendantNodes (Func descendIntoChildren = null) { - return GetDescendantsImpl(false, new DomRegion (), descendIntoChildren); - } - - public IEnumerable DescendantNodes (DomRegion region, Func descendIntoChildren = null) - { - return GetDescendantsImpl(false, region, descendIntoChildren); + return GetDescendantsImpl(false, descendIntoChildren); } - + public IEnumerable DescendantNodesAndSelf (Func descendIntoChildren = null) { - return GetDescendantsImpl(true, new DomRegion (), descendIntoChildren); - } - - public IEnumerable DescendantNodesAndSelf (DomRegion region, Func descendIntoChildren = null) - { - return GetDescendantsImpl(true, region, descendIntoChildren); + return GetDescendantsImpl(true, descendIntoChildren); } + - IEnumerable GetDescendantsImpl(bool includeSelf, DomRegion region = new DomRegion (), Func descendIntoChildren = null) + IEnumerable GetDescendantsImpl(bool includeSelf, Func descendIntoChildren = null) { if (includeSelf) { - if (IsInsideRegion (region, this)) - yield return this; + yield return this; if (descendIntoChildren != null && !descendIntoChildren(this)) yield break; } @@ -356,8 +320,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax // This allows removing/replacing nodes while iterating through the list. if (pos.nextSibling != null) nextStack.Push(pos.nextSibling); - if (IsInsideRegion(region, pos)) - yield return pos; + yield return pos; if (pos.firstChild != null && (descendIntoChildren == null || descendIntoChildren(pos))) pos = pos.firstChild; else diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/SyntaxTree.cs b/ICSharpCode.Decompiler/CSharp/Syntax/SyntaxTree.cs index 1ce3e13ae..f16d84c2c 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/SyntaxTree.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/SyntaxTree.cs @@ -59,13 +59,6 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax IList conditionalSymbols = null; - List errors = new List (); - - public List Errors { - get { return errors; } - } - - /// /// Gets the conditional symbols used to parse the source file. Note that this list contains /// the conditional symbols at the start of the first token in the file - including the ones defined diff --git a/ICSharpCode.Decompiler/CSharp/TypeSystem/UsingScope.cs b/ICSharpCode.Decompiler/CSharp/TypeSystem/UsingScope.cs index 47a91c34f..e50bf0431 100644 --- a/ICSharpCode.Decompiler/CSharp/TypeSystem/UsingScope.cs +++ b/ICSharpCode.Decompiler/CSharp/TypeSystem/UsingScope.cs @@ -33,7 +33,6 @@ namespace ICSharpCode.Decompiler.CSharp.TypeSystem public class UsingScope : AbstractFreezable { readonly UsingScope parent; - DomRegion region; string shortName = ""; IList usings; IList> usingAliases; @@ -79,14 +78,6 @@ namespace ICSharpCode.Decompiler.CSharp.TypeSystem get { return parent; } } - public DomRegion Region { - get { return region; } - set { - FreezableHelper.ThrowIfFrozen(this); - region = value; - } - } - public string ShortNamespaceName { get { return shortName; diff --git a/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj b/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj index 8c13eb980..e87d87739 100644 --- a/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj +++ b/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj @@ -456,8 +456,6 @@ - - @@ -537,7 +535,6 @@ - diff --git a/ICSharpCode.Decompiler/TypeSystem/DomRegion.cs b/ICSharpCode.Decompiler/TypeSystem/DomRegion.cs deleted file mode 100644 index 2659895cb..000000000 --- a/ICSharpCode.Decompiler/TypeSystem/DomRegion.cs +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Globalization; -using ICSharpCode.Decompiler.CSharp.Syntax; - -namespace ICSharpCode.Decompiler.TypeSystem -{ - [Serializable] - public struct DomRegion : IEquatable - { - readonly string fileName; - readonly int beginLine; - readonly int endLine; - readonly int beginColumn; - readonly int endColumn; - - public readonly static DomRegion Empty = new DomRegion(); - - public bool IsEmpty { - get { - return BeginLine <= 0; - } - } - - public string FileName { - get { return fileName; } - } - - public int BeginLine { - get { - return beginLine; - } - } - - /// - /// if the end line is == -1 the end column is -1 too - /// this stands for an unknwon end - /// - public int EndLine { - get { - return endLine; - } - } - - public int BeginColumn { - get { - return beginColumn; - } - } - - /// - /// if the end column is == -1 the end line is -1 too - /// this stands for an unknown end - /// - public int EndColumn { - get { - return endColumn; - } - } - - public TextLocation Begin { - get { - return new TextLocation (beginLine, beginColumn); - } - } - - public TextLocation End { - get { - return new TextLocation (endLine, endColumn); - } - } - - public DomRegion (int beginLine, int beginColumn, int endLine, int endColumn) : this (null, beginLine, beginColumn, endLine, endColumn) - { - } - - public DomRegion(string fileName, int beginLine, int beginColumn, int endLine, int endColumn) - { - this.fileName = fileName; - this.beginLine = beginLine; - this.beginColumn = beginColumn; - this.endLine = endLine; - this.endColumn = endColumn; - } - - public DomRegion (int beginLine, int beginColumn) : this (null, beginLine, beginColumn) - { - } - - public DomRegion (string fileName, int beginLine, int beginColumn) - { - this.fileName = fileName; - this.beginLine = beginLine; - this.beginColumn = beginColumn; - this.endLine = -1; - this.endColumn = -1; - } - - public DomRegion (TextLocation begin, TextLocation end) : this (null, begin, end) - { - } - - public DomRegion (string fileName, TextLocation begin, TextLocation end) - { - this.fileName = fileName; - this.beginLine = begin.Line; - this.beginColumn = begin.Column; - this.endLine = end.Line; - this.endColumn = end.Column; - } - - public DomRegion (TextLocation begin) : this (null, begin) - { - } - - public DomRegion (string fileName, TextLocation begin) - { - this.fileName = fileName; - this.beginLine = begin.Line; - this.beginColumn = begin.Column; - this.endLine = -1; - this.endColumn = -1; - } - - /// - /// Returns true, if the given coordinates (line, column) are in the region. - /// This method assumes that for an unknown end the end line is == -1 - /// - public bool IsInside(int line, int column) - { - if (IsEmpty) - return false; - return line >= BeginLine && - (line <= EndLine || EndLine == -1) && - (line != BeginLine || column >= BeginColumn) && - (line != EndLine || column <= EndColumn); - } - - public bool IsInside(TextLocation location) - { - return IsInside(location.Line, location.Column); - } - - /// - /// Returns true, if the given coordinates (line, column) are in the region. - /// This method assumes that for an unknown end the end line is == -1 - /// - public bool Contains(int line, int column) - { - if (IsEmpty) - return false; - return line >= BeginLine && - (line <= EndLine || EndLine == -1) && - (line != BeginLine || column >= BeginColumn) && - (line != EndLine || column < EndColumn); - } - - public bool Contains(TextLocation location) - { - return Contains(location.Line, location.Column); - } - - public bool IntersectsWith (DomRegion region) - { - return region.Begin <= End && region.End >= Begin; - } - - public bool OverlapsWith (DomRegion region) - { - var maxBegin = Begin > region.Begin ? Begin : region.Begin; - var minEnd = End < region.End ? End : region.End; - return maxBegin < minEnd; - } - - public override string ToString() - { - return string.Format( - CultureInfo.InvariantCulture, - "[DomRegion FileName={0}, Begin=({1}, {2}), End=({3}, {4})]", - fileName, beginLine, beginColumn, endLine, endColumn); - } - - public override bool Equals(object obj) - { - return obj is DomRegion && Equals((DomRegion)obj); - } - - public override int GetHashCode() - { - unchecked { - int hashCode = fileName != null ? fileName.GetHashCode() : 0; - hashCode ^= beginColumn + 1100009 * beginLine + 1200007 * endLine + 1300021 * endColumn; - return hashCode; - } - } - - public bool Equals(DomRegion other) - { - return beginLine == other.beginLine && beginColumn == other.beginColumn - && endLine == other.endLine && endColumn == other.endColumn - && fileName == other.fileName; - } - - public static bool operator ==(DomRegion left, DomRegion right) - { - return left.Equals(right); - } - - public static bool operator !=(DomRegion left, DomRegion right) - { - return !left.Equals(right); - } - } -} diff --git a/ICSharpCode.Decompiler/TypeSystem/Error.cs b/ICSharpCode.Decompiler/TypeSystem/Error.cs deleted file mode 100644 index e21b77175..000000000 --- a/ICSharpCode.Decompiler/TypeSystem/Error.cs +++ /dev/null @@ -1,140 +0,0 @@ -// -// Error.cs -// -// Author: -// Mike Krüger -// -// Copyright (c) 2011 Mike Krüger -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; -using ICSharpCode.Decompiler.CSharp.Syntax; - -namespace ICSharpCode.Decompiler.TypeSystem -{ - /// - /// Enum that describes the type of an error. - /// - public enum ErrorType - { - Unknown, - Error, - Warning - } - - /// - /// Descibes an error during parsing. - /// - [Serializable] - public class Error - { - readonly ErrorType errorType; - readonly string message; - readonly DomRegion region; - - /// - /// The type of the error. - /// - public ErrorType ErrorType { get { return errorType; } } - - /// - /// The error description. - /// - public string Message { get { return message; } } - - /// - /// The region of the error. - /// - public DomRegion Region { get { return region; } } - - /// - /// Initializes a new instance of the class. - /// - /// - /// The error type. - /// - /// - /// The description of the error. - /// - /// - /// The region of the error. - /// - public Error (ErrorType errorType, string message, DomRegion region) - { - this.errorType = errorType; - this.message = message; - this.region = region; - } - - /// - /// Initializes a new instance of the class. - /// - /// - /// The error type. - /// - /// - /// The description of the error. - /// - /// - /// The location of the error. - /// - public Error (ErrorType errorType, string message, TextLocation location) - { - this.errorType = errorType; - this.message = message; - this.region = new DomRegion (location, location); - } - - /// - /// Initializes a new instance of the class. - /// - /// - /// The error type. - /// - /// - /// The description of the error. - /// - /// - /// The line of the error. - /// - /// - /// The column of the error. - /// - public Error (ErrorType errorType, string message, int line, int col) : this (errorType, message, new TextLocation (line, col)) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// - /// The error type. - /// - /// - /// The description of the error. - /// - public Error (ErrorType errorType, string message) - { - this.errorType = errorType; - this.message = message; - this.region = DomRegion.Empty; - } - } -} diff --git a/ICSharpCode.Decompiler/TypeSystem/IAttribute.cs b/ICSharpCode.Decompiler/TypeSystem/IAttribute.cs index 6c9438663..ef6b940e7 100644 --- a/ICSharpCode.Decompiler/TypeSystem/IAttribute.cs +++ b/ICSharpCode.Decompiler/TypeSystem/IAttribute.cs @@ -27,11 +27,6 @@ namespace ICSharpCode.Decompiler.TypeSystem [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")] public interface IUnresolvedAttribute { - /// - /// Gets the code region of this attribute. - /// - DomRegion Region { get; } - /// /// Resolves the attribute. /// diff --git a/ICSharpCode.Decompiler/TypeSystem/IUnresolvedFile.cs b/ICSharpCode.Decompiler/TypeSystem/IUnresolvedFile.cs deleted file mode 100644 index 30a5b8344..000000000 --- a/ICSharpCode.Decompiler/TypeSystem/IUnresolvedFile.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.Collections.Generic; -using ICSharpCode.Decompiler.CSharp.Syntax; - -namespace ICSharpCode.Decompiler.TypeSystem -{ - /// - /// Represents a single file that was parsed. - /// - public interface IUnresolvedFile - { - /// - /// Returns the full path of the file. - /// - string FileName { get; } - - /// - /// Gets the time when the file was last written. - /// - DateTime? LastWriteTime { get; set; } - - /// - /// Gets all top-level type definitions. - /// - IList TopLevelTypeDefinitions { get; } - - /// - /// Gets all assembly attributes that are defined in this file. - /// - IList AssemblyAttributes { get; } - - /// - /// Gets all module attributes that are defined in this file. - /// - IList ModuleAttributes { get; } - - /// - /// Gets the top-level type defined at the specified location. - /// Returns null if no type is defined at that location. - /// - IUnresolvedTypeDefinition GetTopLevelTypeDefinition(TextLocation location); - - /// - /// Gets the type (potentially a nested type) defined at the specified location. - /// Returns null if no type is defined at that location. - /// - IUnresolvedTypeDefinition GetInnermostTypeDefinition(TextLocation location); - - /// - /// Gets the member defined at the specified location. - /// Returns null if no member is defined at that location. - /// - IUnresolvedMember GetMember(TextLocation location); - - /// - /// Gets the parser errors. - /// - IList Errors { get; } - } -} diff --git a/ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultUnresolvedAttribute.cs b/ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultUnresolvedAttribute.cs index 36771f595..718cb06d8 100644 --- a/ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultUnresolvedAttribute.cs +++ b/ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultUnresolvedAttribute.cs @@ -30,7 +30,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation public sealed class DefaultUnresolvedAttribute : AbstractFreezable, IUnresolvedAttribute, IFreezable, ISupportsInterning { ITypeReference attributeType; - DomRegion region; IList constructorParameterTypes; IList positionalArguments; IList> namedArguments; @@ -66,14 +65,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation get { return attributeType; } } - public DomRegion Region { - get { return region; } - set { - FreezableHelper.ThrowIfFrozen(this); - region = value; - } - } - public IList ConstructorParameterTypes { get { if (constructorParameterTypes == null) @@ -213,10 +204,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation get { return attributeType; } } - public DomRegion Region { - get { return unresolved.Region; } - } - public IMethod Constructor { get { if (!constructorResolved) { diff --git a/ICSharpCode.Decompiler/TypeSystem/Implementation/UnresolvedAttributeBlob.cs b/ICSharpCode.Decompiler/TypeSystem/Implementation/UnresolvedAttributeBlob.cs index f4b1aedcd..7e75aa876 100644 --- a/ICSharpCode.Decompiler/TypeSystem/Implementation/UnresolvedAttributeBlob.cs +++ b/ICSharpCode.Decompiler/TypeSystem/Implementation/UnresolvedAttributeBlob.cs @@ -52,10 +52,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation this.blob = blob; } - DomRegion IUnresolvedAttribute.Region { - get { return DomRegion.Empty; } - } - public IAttribute CreateResolvedAttribute(ITypeResolveContext context) { if (context.CurrentAssembly == null) diff --git a/ICSharpCode.Decompiler/TypeSystem/Implementation/UnresolvedSecurityDeclarationBlob.cs b/ICSharpCode.Decompiler/TypeSystem/Implementation/UnresolvedSecurityDeclarationBlob.cs index e9c944308..19f67e321 100644 --- a/ICSharpCode.Decompiler/TypeSystem/Implementation/UnresolvedSecurityDeclarationBlob.cs +++ b/ICSharpCode.Decompiler/TypeSystem/Implementation/UnresolvedSecurityDeclarationBlob.cs @@ -129,10 +129,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation this.index = index; } - DomRegion IUnresolvedAttribute.Region { - get { return DomRegion.Empty; } - } - IAttribute IUnresolvedAttribute.CreateResolvedAttribute(ITypeResolveContext context) { return secDecl.Resolve(context.CurrentAssembly)[index]; diff --git a/ICSharpCode.Decompiler/TypeSystem/TypeSystemExtensions.cs b/ICSharpCode.Decompiler/TypeSystem/TypeSystemExtensions.cs index f859af87f..a8fb66936 100644 --- a/ICSharpCode.Decompiler/TypeSystem/TypeSystemExtensions.cs +++ b/ICSharpCode.Decompiler/TypeSystem/TypeSystemExtensions.cs @@ -226,15 +226,6 @@ namespace ICSharpCode.Decompiler.TypeSystem #endregion #region GetType/Member - /// - /// Gets all unresolved type definitions from the file. - /// For partial classes, each part is returned. - /// - public static IEnumerable GetAllTypeDefinitions (this IUnresolvedFile file) - { - return TreeTraversal.PreOrder(file.TopLevelTypeDefinitions, t => t.NestedTypes); - } - /// /// Gets all unresolved type definitions from the assembly. /// For partial classes, each part is returned. @@ -266,24 +257,6 @@ namespace ICSharpCode.Decompiler.TypeSystem { return compilation.Assemblies.SelectMany(a => a.TopLevelTypeDefinitions); } - - /// - /// Gets the type (potentially a nested type) defined at the specified location. - /// Returns null if no type is defined at that location. - /// - public static IUnresolvedTypeDefinition GetInnermostTypeDefinition (this IUnresolvedFile file, int line, int column) - { - return file.GetInnermostTypeDefinition (new TextLocation (line, column)); - } - - /// - /// Gets the member defined at the specified location. - /// Returns null if no member is defined at that location. - /// - public static IUnresolvedMember GetMember (this IUnresolvedFile file, int line, int column) - { - return file.GetMember (new TextLocation (line, column)); - } #endregion #region Resolve on collections