From 4efa35ae04e964fc2585995895b22868e0bcd38d Mon Sep 17 00:00:00 2001 From: Christoph Wille Date: Thu, 21 Mar 2024 10:39:30 +0100 Subject: [PATCH] Move Analyzer to ILSpyX (temporary: #nullable disable) --- Directory.Packages.props | 1 + ICSharpCode.ILSpyX/Abstractions/ILanguage.cs | 3 +++ {ILSpy => ICSharpCode.ILSpyX}/Analyzers/AnalyzerContext.cs | 7 +++++-- {ILSpy => ICSharpCode.ILSpyX}/Analyzers/AnalyzerHelpers.cs | 4 +++- {ILSpy => ICSharpCode.ILSpyX}/Analyzers/AnalyzerScope.cs | 4 +++- .../Analyzers/Builtin/AttributeAppliedToAnalyzer.cs | 2 +- .../Analyzers/Builtin/EventImplementedByAnalyzer.cs | 4 +++- .../Analyzers/Builtin/EventOverriddenByAnalyzer.cs | 4 +++- .../Analyzers/Builtin/FieldAccessAnalyzer.cs | 5 +++-- .../Analyzers/Builtin/FindTypeInAttributeDecoder.cs | 2 +- .../Analyzers/Builtin/MemberImplementsInterfaceAnalyzer.cs | 4 +++- .../Analyzers/Builtin/MethodImplementedByAnalyzer.cs | 4 +++- .../Analyzers/Builtin/MethodOverriddenByAnalyzer.cs | 4 +++- .../Analyzers/Builtin/MethodUsedByAnalyzer.cs | 4 +++- .../Analyzers/Builtin/MethodUsesAnalyzer.cs | 4 +++- .../Analyzers/Builtin/MethodVirtualUsedByAnalyzer.cs | 4 +++- .../Analyzers/Builtin/PropertyImplementedByAnalyzer.cs | 4 +++- .../Analyzers/Builtin/PropertyOverriddenByAnalyzer.cs | 4 +++- .../Analyzers/Builtin/TypeExposedByAnalyzer.cs | 4 +++- .../Analyzers/Builtin/TypeExtensionMethodsAnalyzer.cs | 6 ++++-- .../Analyzers/Builtin/TypeInstantiatedByAnalyzer.cs | 4 +++- .../Analyzers/Builtin/TypeUsedByAnalyzer.cs | 4 +++- .../Analyzers/ExportAnalyzerAttribute.cs | 4 +++- {ILSpy => ICSharpCode.ILSpyX}/Analyzers/IAnalyzer.cs | 2 +- ICSharpCode.ILSpyX/ICSharpCode.ILSpyX.csproj | 1 + ILSpy.Tests/Analyzers/AnalyzerScopeTests.cs | 2 +- .../Analyzers/MemberImplementsInterfaceAnalyzerTests.cs | 4 ++-- ILSpy.Tests/Analyzers/MethodUsesAnalyzerTests.cs | 4 ++-- ILSpy.Tests/Analyzers/TypeUsedByAnalyzerTests.cs | 4 ++-- ILSpy/Analyzers/AnalyzerSearchTreeNode.cs | 1 + ILSpy/Analyzers/TreeNodes/AnalyzedEventTreeNode.cs | 1 + ILSpy/Analyzers/TreeNodes/AnalyzedFieldTreeNode.cs | 1 + ILSpy/Analyzers/TreeNodes/AnalyzedMethodTreeNode.cs | 1 + ILSpy/Analyzers/TreeNodes/AnalyzedModuleTreeNode.cs | 1 + ILSpy/Analyzers/TreeNodes/AnalyzedPropertyTreeNode.cs | 1 + ILSpy/Analyzers/TreeNodes/AnalyzedTypeTreeNode.cs | 1 + ILSpy/App.xaml.cs | 5 +++++ 37 files changed, 87 insertions(+), 32 deletions(-) rename {ILSpy => ICSharpCode.ILSpyX}/Analyzers/AnalyzerContext.cs (95%) rename {ILSpy => ICSharpCode.ILSpyX}/Analyzers/AnalyzerHelpers.cs (98%) rename {ILSpy => ICSharpCode.ILSpyX}/Analyzers/AnalyzerScope.cs (99%) rename {ILSpy => ICSharpCode.ILSpyX}/Analyzers/Builtin/AttributeAppliedToAnalyzer.cs (99%) rename {ILSpy => ICSharpCode.ILSpyX}/Analyzers/Builtin/EventImplementedByAnalyzer.cs (97%) rename {ILSpy => ICSharpCode.ILSpyX}/Analyzers/Builtin/EventOverriddenByAnalyzer.cs (97%) rename {ILSpy => ICSharpCode.ILSpyX}/Analyzers/Builtin/FieldAccessAnalyzer.cs (98%) rename {ILSpy => ICSharpCode.ILSpyX}/Analyzers/Builtin/FindTypeInAttributeDecoder.cs (99%) rename {ILSpy => ICSharpCode.ILSpyX}/Analyzers/Builtin/MemberImplementsInterfaceAnalyzer.cs (97%) rename {ILSpy => ICSharpCode.ILSpyX}/Analyzers/Builtin/MethodImplementedByAnalyzer.cs (97%) rename {ILSpy => ICSharpCode.ILSpyX}/Analyzers/Builtin/MethodOverriddenByAnalyzer.cs (97%) rename {ILSpy => ICSharpCode.ILSpyX}/Analyzers/Builtin/MethodUsedByAnalyzer.cs (98%) rename {ILSpy => ICSharpCode.ILSpyX}/Analyzers/Builtin/MethodUsesAnalyzer.cs (98%) rename {ILSpy => ICSharpCode.ILSpyX}/Analyzers/Builtin/MethodVirtualUsedByAnalyzer.cs (98%) rename {ILSpy => ICSharpCode.ILSpyX}/Analyzers/Builtin/PropertyImplementedByAnalyzer.cs (97%) rename {ILSpy => ICSharpCode.ILSpyX}/Analyzers/Builtin/PropertyOverriddenByAnalyzer.cs (97%) rename {ILSpy => ICSharpCode.ILSpyX}/Analyzers/Builtin/TypeExposedByAnalyzer.cs (98%) rename {ILSpy => ICSharpCode.ILSpyX}/Analyzers/Builtin/TypeExtensionMethodsAnalyzer.cs (92%) rename {ILSpy => ICSharpCode.ILSpyX}/Analyzers/Builtin/TypeInstantiatedByAnalyzer.cs (98%) rename {ILSpy => ICSharpCode.ILSpyX}/Analyzers/Builtin/TypeUsedByAnalyzer.cs (99%) rename {ILSpy => ICSharpCode.ILSpyX}/Analyzers/ExportAnalyzerAttribute.cs (96%) rename {ILSpy => ICSharpCode.ILSpyX}/Analyzers/IAnalyzer.cs (97%) diff --git a/Directory.Packages.props b/Directory.Packages.props index 2492143b7..b77822de6 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -35,6 +35,7 @@ + diff --git a/ICSharpCode.ILSpyX/Abstractions/ILanguage.cs b/ICSharpCode.ILSpyX/Abstractions/ILanguage.cs index 1947b0cc3..993e37ba8 100644 --- a/ICSharpCode.ILSpyX/Abstractions/ILanguage.cs +++ b/ICSharpCode.ILSpyX/Abstractions/ILanguage.cs @@ -16,6 +16,8 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +using System.Reflection.Metadata; + using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.TypeSystem; @@ -24,6 +26,7 @@ namespace ICSharpCode.ILSpyX.Abstractions public interface ILanguage { bool ShowMember(IEntity member); + CodeMappingInfo GetCodeMappingInfo(PEFile module, EntityHandle member); string GetEntityName(PEFile module, System.Reflection.Metadata.EntityHandle handle, bool fullName, bool omitGenerics); string GetTooltip(IEntity entity); diff --git a/ILSpy/Analyzers/AnalyzerContext.cs b/ICSharpCode.ILSpyX/Analyzers/AnalyzerContext.cs similarity index 95% rename from ILSpy/Analyzers/AnalyzerContext.cs rename to ICSharpCode.ILSpyX/Analyzers/AnalyzerContext.cs index 2e3657103..1e89b5d7e 100644 --- a/ILSpy/Analyzers/AnalyzerContext.cs +++ b/ICSharpCode.ILSpyX/Analyzers/AnalyzerContext.cs @@ -16,6 +16,8 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +#nullable disable + using System; using System.Collections.Concurrent; using System.Reflection.Metadata; @@ -24,8 +26,9 @@ using System.Threading; using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.TypeSystem; using ICSharpCode.ILSpyX; +using ICSharpCode.ILSpyX.Abstractions; -namespace ICSharpCode.ILSpy.Analyzers +namespace ICSharpCode.ILSpyX.Analyzers { /// /// Provides additional context for analyzers. @@ -42,7 +45,7 @@ namespace ICSharpCode.ILSpy.Analyzers /// /// Currently used language. /// - public Language Language { get; internal set; } + public ILanguage Language { get; internal set; } /// /// Allows the analyzer to control whether the tree nodes will be sorted. diff --git a/ILSpy/Analyzers/AnalyzerHelpers.cs b/ICSharpCode.ILSpyX/Analyzers/AnalyzerHelpers.cs similarity index 98% rename from ILSpy/Analyzers/AnalyzerHelpers.cs rename to ICSharpCode.ILSpyX/Analyzers/AnalyzerHelpers.cs index 9126dd615..5836d5e6f 100644 --- a/ILSpy/Analyzers/AnalyzerHelpers.cs +++ b/ICSharpCode.ILSpyX/Analyzers/AnalyzerHelpers.cs @@ -16,12 +16,14 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +#nullable disable + using System.Reflection.Metadata; using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.TypeSystem; -namespace ICSharpCode.ILSpy.Analyzers +namespace ICSharpCode.ILSpyX.Analyzers { internal static class AnalyzerHelpers { diff --git a/ILSpy/Analyzers/AnalyzerScope.cs b/ICSharpCode.ILSpyX/Analyzers/AnalyzerScope.cs similarity index 99% rename from ILSpy/Analyzers/AnalyzerScope.cs rename to ICSharpCode.ILSpyX/Analyzers/AnalyzerScope.cs index 881fc6e98..a0fae5cb8 100644 --- a/ILSpy/Analyzers/AnalyzerScope.cs +++ b/ICSharpCode.ILSpyX/Analyzers/AnalyzerScope.cs @@ -16,6 +16,8 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +#nullable disable + using System.Collections.Generic; using System.Linq; using System.Reflection.Metadata; @@ -26,7 +28,7 @@ using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Util; using ICSharpCode.ILSpyX; -namespace ICSharpCode.ILSpy.Analyzers +namespace ICSharpCode.ILSpyX.Analyzers { using ICSharpCode.Decompiler.TypeSystem; diff --git a/ILSpy/Analyzers/Builtin/AttributeAppliedToAnalyzer.cs b/ICSharpCode.ILSpyX/Analyzers/Builtin/AttributeAppliedToAnalyzer.cs similarity index 99% rename from ILSpy/Analyzers/Builtin/AttributeAppliedToAnalyzer.cs rename to ICSharpCode.ILSpyX/Analyzers/Builtin/AttributeAppliedToAnalyzer.cs index 6007253a6..fa925c9b4 100644 --- a/ILSpy/Analyzers/Builtin/AttributeAppliedToAnalyzer.cs +++ b/ICSharpCode.ILSpyX/Analyzers/Builtin/AttributeAppliedToAnalyzer.cs @@ -26,7 +26,7 @@ using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.TypeSystem; using ICSharpCode.Decompiler.Util; -namespace ICSharpCode.ILSpy.Analyzers.Builtin +namespace ICSharpCode.ILSpyX.Analyzers.Builtin { [ExportAnalyzer(Header = "Applied To", Order = 10)] class AttributeAppliedToAnalyzer : IAnalyzer diff --git a/ILSpy/Analyzers/Builtin/EventImplementedByAnalyzer.cs b/ICSharpCode.ILSpyX/Analyzers/Builtin/EventImplementedByAnalyzer.cs similarity index 97% rename from ILSpy/Analyzers/Builtin/EventImplementedByAnalyzer.cs rename to ICSharpCode.ILSpyX/Analyzers/Builtin/EventImplementedByAnalyzer.cs index 4e87a0f30..f76cac905 100644 --- a/ILSpy/Analyzers/Builtin/EventImplementedByAnalyzer.cs +++ b/ICSharpCode.ILSpyX/Analyzers/Builtin/EventImplementedByAnalyzer.cs @@ -16,6 +16,8 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +#nullable disable + using System.Collections.Generic; using System.ComponentModel.Composition; using System.Diagnostics; @@ -23,7 +25,7 @@ using System.Linq; using ICSharpCode.Decompiler.TypeSystem; -namespace ICSharpCode.ILSpy.Analyzers.Builtin +namespace ICSharpCode.ILSpyX.Analyzers.Builtin { /// /// Shows events that implement an interface event. diff --git a/ILSpy/Analyzers/Builtin/EventOverriddenByAnalyzer.cs b/ICSharpCode.ILSpyX/Analyzers/Builtin/EventOverriddenByAnalyzer.cs similarity index 97% rename from ILSpy/Analyzers/Builtin/EventOverriddenByAnalyzer.cs rename to ICSharpCode.ILSpyX/Analyzers/Builtin/EventOverriddenByAnalyzer.cs index f6c41dc18..199bcdb36 100644 --- a/ILSpy/Analyzers/Builtin/EventOverriddenByAnalyzer.cs +++ b/ICSharpCode.ILSpyX/Analyzers/Builtin/EventOverriddenByAnalyzer.cs @@ -16,6 +16,8 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +#nullable disable + using System.Collections.Generic; using System.ComponentModel.Composition; using System.Diagnostics; @@ -23,7 +25,7 @@ using System.Linq; using ICSharpCode.Decompiler.TypeSystem; -namespace ICSharpCode.ILSpy.Analyzers.Builtin +namespace ICSharpCode.ILSpyX.Analyzers.Builtin { /// /// Shows events that override an event. diff --git a/ILSpy/Analyzers/Builtin/FieldAccessAnalyzer.cs b/ICSharpCode.ILSpyX/Analyzers/Builtin/FieldAccessAnalyzer.cs similarity index 98% rename from ILSpy/Analyzers/Builtin/FieldAccessAnalyzer.cs rename to ICSharpCode.ILSpyX/Analyzers/Builtin/FieldAccessAnalyzer.cs index 38228bc72..f033ce562 100644 --- a/ILSpy/Analyzers/Builtin/FieldAccessAnalyzer.cs +++ b/ICSharpCode.ILSpyX/Analyzers/Builtin/FieldAccessAnalyzer.cs @@ -16,6 +16,8 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +#nullable disable + using System; using System.Collections; using System.Collections.Generic; @@ -30,11 +32,10 @@ using ICSharpCode.Decompiler; using ICSharpCode.Decompiler.Disassembler; using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpy.Analyzers; using ILOpCode = System.Reflection.Metadata.ILOpCode; -namespace ICSharpCode.ILSpy.Analyzers.Builtin +namespace ICSharpCode.ILSpyX.Analyzers.Builtin { /// /// Finds methods where this field is read. diff --git a/ILSpy/Analyzers/Builtin/FindTypeInAttributeDecoder.cs b/ICSharpCode.ILSpyX/Analyzers/Builtin/FindTypeInAttributeDecoder.cs similarity index 99% rename from ILSpy/Analyzers/Builtin/FindTypeInAttributeDecoder.cs rename to ICSharpCode.ILSpyX/Analyzers/Builtin/FindTypeInAttributeDecoder.cs index 1431e3cee..796ef4674 100644 --- a/ILSpy/Analyzers/Builtin/FindTypeInAttributeDecoder.cs +++ b/ICSharpCode.ILSpyX/Analyzers/Builtin/FindTypeInAttributeDecoder.cs @@ -25,7 +25,7 @@ using ICSharpCode.Decompiler; using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.TypeSystem; -namespace ICSharpCode.ILSpy.Analyzers.Builtin +namespace ICSharpCode.ILSpyX.Analyzers.Builtin { public enum TokenSearchResult : byte { diff --git a/ILSpy/Analyzers/Builtin/MemberImplementsInterfaceAnalyzer.cs b/ICSharpCode.ILSpyX/Analyzers/Builtin/MemberImplementsInterfaceAnalyzer.cs similarity index 97% rename from ILSpy/Analyzers/Builtin/MemberImplementsInterfaceAnalyzer.cs rename to ICSharpCode.ILSpyX/Analyzers/Builtin/MemberImplementsInterfaceAnalyzer.cs index d4c87ced5..307c6bb75 100644 --- a/ILSpy/Analyzers/Builtin/MemberImplementsInterfaceAnalyzer.cs +++ b/ICSharpCode.ILSpyX/Analyzers/Builtin/MemberImplementsInterfaceAnalyzer.cs @@ -16,13 +16,15 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +#nullable disable + using System.Collections.Generic; using System.Diagnostics; using System.Linq; using ICSharpCode.Decompiler.TypeSystem; -namespace ICSharpCode.ILSpy.Analyzers.Builtin +namespace ICSharpCode.ILSpyX.Analyzers.Builtin { /// /// Shows members from all corresponding interfaces the selected member implements. diff --git a/ILSpy/Analyzers/Builtin/MethodImplementedByAnalyzer.cs b/ICSharpCode.ILSpyX/Analyzers/Builtin/MethodImplementedByAnalyzer.cs similarity index 97% rename from ILSpy/Analyzers/Builtin/MethodImplementedByAnalyzer.cs rename to ICSharpCode.ILSpyX/Analyzers/Builtin/MethodImplementedByAnalyzer.cs index db9073e2a..03273353b 100644 --- a/ILSpy/Analyzers/Builtin/MethodImplementedByAnalyzer.cs +++ b/ICSharpCode.ILSpyX/Analyzers/Builtin/MethodImplementedByAnalyzer.cs @@ -16,6 +16,8 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +#nullable disable + using System; using System.Collections.Generic; using System.ComponentModel.Composition; @@ -26,7 +28,7 @@ using System.Threading.Tasks; using ICSharpCode.Decompiler.TypeSystem; -namespace ICSharpCode.ILSpy.Analyzers.Builtin +namespace ICSharpCode.ILSpyX.Analyzers.Builtin { /// /// Shows methods that implement an interface method. diff --git a/ILSpy/Analyzers/Builtin/MethodOverriddenByAnalyzer.cs b/ICSharpCode.ILSpyX/Analyzers/Builtin/MethodOverriddenByAnalyzer.cs similarity index 97% rename from ILSpy/Analyzers/Builtin/MethodOverriddenByAnalyzer.cs rename to ICSharpCode.ILSpyX/Analyzers/Builtin/MethodOverriddenByAnalyzer.cs index 7a90f48fa..81a550820 100644 --- a/ILSpy/Analyzers/Builtin/MethodOverriddenByAnalyzer.cs +++ b/ICSharpCode.ILSpyX/Analyzers/Builtin/MethodOverriddenByAnalyzer.cs @@ -16,6 +16,8 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +#nullable disable + using System.Collections.Generic; using System.ComponentModel.Composition; using System.Diagnostics; @@ -23,7 +25,7 @@ using System.Linq; using ICSharpCode.Decompiler.TypeSystem; -namespace ICSharpCode.ILSpy.Analyzers.Builtin +namespace ICSharpCode.ILSpyX.Analyzers.Builtin { /// /// Shows methods that override a method. diff --git a/ILSpy/Analyzers/Builtin/MethodUsedByAnalyzer.cs b/ICSharpCode.ILSpyX/Analyzers/Builtin/MethodUsedByAnalyzer.cs similarity index 98% rename from ILSpy/Analyzers/Builtin/MethodUsedByAnalyzer.cs rename to ICSharpCode.ILSpyX/Analyzers/Builtin/MethodUsedByAnalyzer.cs index a2b698080..ca4217dad 100644 --- a/ILSpy/Analyzers/Builtin/MethodUsedByAnalyzer.cs +++ b/ICSharpCode.ILSpyX/Analyzers/Builtin/MethodUsedByAnalyzer.cs @@ -16,6 +16,8 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +#nullable disable + using System; using System.Collections.Generic; using System.ComponentModel.Composition; @@ -28,7 +30,7 @@ using ICSharpCode.Decompiler.Disassembler; using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.TypeSystem; -namespace ICSharpCode.ILSpy.Analyzers.Builtin +namespace ICSharpCode.ILSpyX.Analyzers.Builtin { /// /// Shows entities that are used by a method. diff --git a/ILSpy/Analyzers/Builtin/MethodUsesAnalyzer.cs b/ICSharpCode.ILSpyX/Analyzers/Builtin/MethodUsesAnalyzer.cs similarity index 98% rename from ILSpy/Analyzers/Builtin/MethodUsesAnalyzer.cs rename to ICSharpCode.ILSpyX/Analyzers/Builtin/MethodUsesAnalyzer.cs index c3e892419..4fe776d8e 100644 --- a/ILSpy/Analyzers/Builtin/MethodUsesAnalyzer.cs +++ b/ICSharpCode.ILSpyX/Analyzers/Builtin/MethodUsesAnalyzer.cs @@ -16,6 +16,8 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +#nullable disable + using System; using System.Collections.Generic; using System.Linq; @@ -26,7 +28,7 @@ using ICSharpCode.Decompiler.Disassembler; using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.TypeSystem; -namespace ICSharpCode.ILSpy.Analyzers.Builtin +namespace ICSharpCode.ILSpyX.Analyzers.Builtin { /// /// Shows entities that are used by a method. diff --git a/ILSpy/Analyzers/Builtin/MethodVirtualUsedByAnalyzer.cs b/ICSharpCode.ILSpyX/Analyzers/Builtin/MethodVirtualUsedByAnalyzer.cs similarity index 98% rename from ILSpy/Analyzers/Builtin/MethodVirtualUsedByAnalyzer.cs rename to ICSharpCode.ILSpyX/Analyzers/Builtin/MethodVirtualUsedByAnalyzer.cs index bf806416c..05ab6bd42 100644 --- a/ILSpy/Analyzers/Builtin/MethodVirtualUsedByAnalyzer.cs +++ b/ICSharpCode.ILSpyX/Analyzers/Builtin/MethodVirtualUsedByAnalyzer.cs @@ -16,6 +16,8 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +#nullable disable + using System.Collections.Generic; using System.Diagnostics; using System.Linq; @@ -25,7 +27,7 @@ using ICSharpCode.Decompiler.Disassembler; using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.TypeSystem; -namespace ICSharpCode.ILSpy.Analyzers.Builtin +namespace ICSharpCode.ILSpyX.Analyzers.Builtin { /// /// Shows entities that are used by a method. diff --git a/ILSpy/Analyzers/Builtin/PropertyImplementedByAnalyzer.cs b/ICSharpCode.ILSpyX/Analyzers/Builtin/PropertyImplementedByAnalyzer.cs similarity index 97% rename from ILSpy/Analyzers/Builtin/PropertyImplementedByAnalyzer.cs rename to ICSharpCode.ILSpyX/Analyzers/Builtin/PropertyImplementedByAnalyzer.cs index 2b8cb8f84..15a505dae 100644 --- a/ILSpy/Analyzers/Builtin/PropertyImplementedByAnalyzer.cs +++ b/ICSharpCode.ILSpyX/Analyzers/Builtin/PropertyImplementedByAnalyzer.cs @@ -16,6 +16,8 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +#nullable disable + using System.Collections.Generic; using System.ComponentModel.Composition; using System.Diagnostics; @@ -23,7 +25,7 @@ using System.Linq; using ICSharpCode.Decompiler.TypeSystem; -namespace ICSharpCode.ILSpy.Analyzers.Builtin +namespace ICSharpCode.ILSpyX.Analyzers.Builtin { /// /// Shows properties that implement an interface property. diff --git a/ILSpy/Analyzers/Builtin/PropertyOverriddenByAnalyzer.cs b/ICSharpCode.ILSpyX/Analyzers/Builtin/PropertyOverriddenByAnalyzer.cs similarity index 97% rename from ILSpy/Analyzers/Builtin/PropertyOverriddenByAnalyzer.cs rename to ICSharpCode.ILSpyX/Analyzers/Builtin/PropertyOverriddenByAnalyzer.cs index 7ec8b5cee..66752a2ec 100644 --- a/ILSpy/Analyzers/Builtin/PropertyOverriddenByAnalyzer.cs +++ b/ICSharpCode.ILSpyX/Analyzers/Builtin/PropertyOverriddenByAnalyzer.cs @@ -16,6 +16,8 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +#nullable disable + using System; using System.Collections.Generic; using System.ComponentModel.Composition; @@ -26,7 +28,7 @@ using System.Threading.Tasks; using ICSharpCode.Decompiler.TypeSystem; -namespace ICSharpCode.ILSpy.Analyzers.Builtin +namespace ICSharpCode.ILSpyX.Analyzers.Builtin { /// /// Shows properties that override a property. diff --git a/ILSpy/Analyzers/Builtin/TypeExposedByAnalyzer.cs b/ICSharpCode.ILSpyX/Analyzers/Builtin/TypeExposedByAnalyzer.cs similarity index 98% rename from ILSpy/Analyzers/Builtin/TypeExposedByAnalyzer.cs rename to ICSharpCode.ILSpyX/Analyzers/Builtin/TypeExposedByAnalyzer.cs index 2b9109638..a41174a01 100644 --- a/ILSpy/Analyzers/Builtin/TypeExposedByAnalyzer.cs +++ b/ICSharpCode.ILSpyX/Analyzers/Builtin/TypeExposedByAnalyzer.cs @@ -16,6 +16,8 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +#nullable disable + using System; using System.Collections.Generic; using System.ComponentModel.Composition; @@ -25,7 +27,7 @@ using System.Text; using System.Threading.Tasks; -namespace ICSharpCode.ILSpy.Analyzers.Builtin +namespace ICSharpCode.ILSpyX.Analyzers.Builtin { using ICSharpCode.Decompiler.TypeSystem; diff --git a/ILSpy/Analyzers/Builtin/TypeExtensionMethodsAnalyzer.cs b/ICSharpCode.ILSpyX/Analyzers/Builtin/TypeExtensionMethodsAnalyzer.cs similarity index 92% rename from ILSpy/Analyzers/Builtin/TypeExtensionMethodsAnalyzer.cs rename to ICSharpCode.ILSpyX/Analyzers/Builtin/TypeExtensionMethodsAnalyzer.cs index 4d1d5bc30..d4edcf074 100644 --- a/ILSpy/Analyzers/Builtin/TypeExtensionMethodsAnalyzer.cs +++ b/ICSharpCode.ILSpyX/Analyzers/Builtin/TypeExtensionMethodsAnalyzer.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; +#nullable disable + +using System.Collections.Generic; using System.ComponentModel.Composition; using System.Diagnostics; using ICSharpCode.Decompiler.TypeSystem; -namespace ICSharpCode.ILSpy.Analyzers.Builtin +namespace ICSharpCode.ILSpyX.Analyzers.Builtin { /// /// Finds all extension methods defined for a type. diff --git a/ILSpy/Analyzers/Builtin/TypeInstantiatedByAnalyzer.cs b/ICSharpCode.ILSpyX/Analyzers/Builtin/TypeInstantiatedByAnalyzer.cs similarity index 98% rename from ILSpy/Analyzers/Builtin/TypeInstantiatedByAnalyzer.cs rename to ICSharpCode.ILSpyX/Analyzers/Builtin/TypeInstantiatedByAnalyzer.cs index cd5b68f1f..e73c888a3 100644 --- a/ILSpy/Analyzers/Builtin/TypeInstantiatedByAnalyzer.cs +++ b/ICSharpCode.ILSpyX/Analyzers/Builtin/TypeInstantiatedByAnalyzer.cs @@ -16,6 +16,8 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +#nullable disable + using System; using System.Collections.Generic; using System.ComponentModel.Composition; @@ -30,7 +32,7 @@ using ICSharpCode.Decompiler.Disassembler; using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.TypeSystem; -namespace ICSharpCode.ILSpy.Analyzers.Builtin +namespace ICSharpCode.ILSpyX.Analyzers.Builtin { /// /// Shows methods that instantiate a type. diff --git a/ILSpy/Analyzers/Builtin/TypeUsedByAnalyzer.cs b/ICSharpCode.ILSpyX/Analyzers/Builtin/TypeUsedByAnalyzer.cs similarity index 99% rename from ILSpy/Analyzers/Builtin/TypeUsedByAnalyzer.cs rename to ICSharpCode.ILSpyX/Analyzers/Builtin/TypeUsedByAnalyzer.cs index ef7ef3fee..5cf7aca03 100644 --- a/ILSpy/Analyzers/Builtin/TypeUsedByAnalyzer.cs +++ b/ICSharpCode.ILSpyX/Analyzers/Builtin/TypeUsedByAnalyzer.cs @@ -16,6 +16,8 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +#nullable disable + using System; using System.Collections.Generic; using System.Collections.Immutable; @@ -28,7 +30,7 @@ using ICSharpCode.Decompiler.Disassembler; using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.TypeSystem; -namespace ICSharpCode.ILSpy.Analyzers.Builtin +namespace ICSharpCode.ILSpyX.Analyzers.Builtin { /// /// Shows entities that use a type. diff --git a/ILSpy/Analyzers/ExportAnalyzerAttribute.cs b/ICSharpCode.ILSpyX/Analyzers/ExportAnalyzerAttribute.cs similarity index 96% rename from ILSpy/Analyzers/ExportAnalyzerAttribute.cs rename to ICSharpCode.ILSpyX/Analyzers/ExportAnalyzerAttribute.cs index e17f6585e..dd8d36f09 100644 --- a/ILSpy/Analyzers/ExportAnalyzerAttribute.cs +++ b/ICSharpCode.ILSpyX/Analyzers/ExportAnalyzerAttribute.cs @@ -16,10 +16,12 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +#nullable disable + using System; using System.ComponentModel.Composition; -namespace ICSharpCode.ILSpy.Analyzers +namespace ICSharpCode.ILSpyX.Analyzers { [MetadataAttribute] [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] diff --git a/ILSpy/Analyzers/IAnalyzer.cs b/ICSharpCode.ILSpyX/Analyzers/IAnalyzer.cs similarity index 97% rename from ILSpy/Analyzers/IAnalyzer.cs rename to ICSharpCode.ILSpyX/Analyzers/IAnalyzer.cs index ca9d41760..d21a87183 100644 --- a/ILSpy/Analyzers/IAnalyzer.cs +++ b/ICSharpCode.ILSpyX/Analyzers/IAnalyzer.cs @@ -20,7 +20,7 @@ using System.Collections.Generic; using ICSharpCode.Decompiler.TypeSystem; -namespace ICSharpCode.ILSpy.Analyzers +namespace ICSharpCode.ILSpyX.Analyzers { /// /// Base interface for all analyzers. You can register an analyzer for any by implementing diff --git a/ICSharpCode.ILSpyX/ICSharpCode.ILSpyX.csproj b/ICSharpCode.ILSpyX/ICSharpCode.ILSpyX.csproj index a788e3659..bde8d593a 100644 --- a/ICSharpCode.ILSpyX/ICSharpCode.ILSpyX.csproj +++ b/ICSharpCode.ILSpyX/ICSharpCode.ILSpyX.csproj @@ -62,6 +62,7 @@ + diff --git a/ILSpy.Tests/Analyzers/AnalyzerScopeTests.cs b/ILSpy.Tests/Analyzers/AnalyzerScopeTests.cs index 54ccbebd0..43c74ce85 100644 --- a/ILSpy.Tests/Analyzers/AnalyzerScopeTests.cs +++ b/ILSpy.Tests/Analyzers/AnalyzerScopeTests.cs @@ -23,7 +23,7 @@ using ICSharpCode.Decompiler; using ICSharpCode.Decompiler.CSharp.Resolver; using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpy.Analyzers; +using ICSharpCode.ILSpyX.Analyzers; using NUnit.Framework; diff --git a/ILSpy.Tests/Analyzers/MemberImplementsInterfaceAnalyzerTests.cs b/ILSpy.Tests/Analyzers/MemberImplementsInterfaceAnalyzerTests.cs index f3d2f3c93..d27b985ee 100644 --- a/ILSpy.Tests/Analyzers/MemberImplementsInterfaceAnalyzerTests.cs +++ b/ILSpy.Tests/Analyzers/MemberImplementsInterfaceAnalyzerTests.cs @@ -25,8 +25,8 @@ using System.Reflection.PortableExecutable; using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.TypeSystem; using ICSharpCode.Decompiler.TypeSystem.Implementation; -using ICSharpCode.ILSpy.Analyzers; -using ICSharpCode.ILSpy.Analyzers.Builtin; +using ICSharpCode.ILSpyX.Analyzers; +using ICSharpCode.ILSpyX.Analyzers.Builtin; using NSubstitute; diff --git a/ILSpy.Tests/Analyzers/MethodUsesAnalyzerTests.cs b/ILSpy.Tests/Analyzers/MethodUsesAnalyzerTests.cs index 9cd7726d6..138868c34 100644 --- a/ILSpy.Tests/Analyzers/MethodUsesAnalyzerTests.cs +++ b/ILSpy.Tests/Analyzers/MethodUsesAnalyzerTests.cs @@ -6,8 +6,8 @@ using System.Threading.Tasks; using System.Windows; using ICSharpCode.Decompiler.TypeSystem; -using ICSharpCode.ILSpy.Analyzers; -using ICSharpCode.ILSpy.Analyzers.Builtin; +using ICSharpCode.ILSpyX.Analyzers; +using ICSharpCode.ILSpyX.Analyzers.Builtin; using ICSharpCode.ILSpyX; using NUnit.Framework; diff --git a/ILSpy.Tests/Analyzers/TypeUsedByAnalyzerTests.cs b/ILSpy.Tests/Analyzers/TypeUsedByAnalyzerTests.cs index b89a02d48..0fa18b023 100644 --- a/ILSpy.Tests/Analyzers/TypeUsedByAnalyzerTests.cs +++ b/ILSpy.Tests/Analyzers/TypeUsedByAnalyzerTests.cs @@ -26,8 +26,8 @@ using System.Windows; using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.TypeSystem; using ICSharpCode.Decompiler.TypeSystem.Implementation; -using ICSharpCode.ILSpy.Analyzers; -using ICSharpCode.ILSpy.Analyzers.Builtin; +using ICSharpCode.ILSpyX.Analyzers; +using ICSharpCode.ILSpyX.Analyzers.Builtin; using ICSharpCode.ILSpyX; using NUnit.Framework; diff --git a/ILSpy/Analyzers/AnalyzerSearchTreeNode.cs b/ILSpy/Analyzers/AnalyzerSearchTreeNode.cs index 6b908d1ff..490bf5ec2 100644 --- a/ILSpy/Analyzers/AnalyzerSearchTreeNode.cs +++ b/ILSpy/Analyzers/AnalyzerSearchTreeNode.cs @@ -25,6 +25,7 @@ using ICSharpCode.Decompiler.TypeSystem; using ICSharpCode.ILSpy.Analyzers.TreeNodes; using ICSharpCode.ILSpy.TreeNodes; using ICSharpCode.ILSpyX; +using ICSharpCode.ILSpyX.Analyzers; namespace ICSharpCode.ILSpy.Analyzers { diff --git a/ILSpy/Analyzers/TreeNodes/AnalyzedEventTreeNode.cs b/ILSpy/Analyzers/TreeNodes/AnalyzedEventTreeNode.cs index 923ba5602..8b6ff6f03 100644 --- a/ILSpy/Analyzers/TreeNodes/AnalyzedEventTreeNode.cs +++ b/ILSpy/Analyzers/TreeNodes/AnalyzedEventTreeNode.cs @@ -24,6 +24,7 @@ using ICSharpCode.ILSpy.TreeNodes; namespace ICSharpCode.ILSpy.Analyzers.TreeNodes { using ICSharpCode.Decompiler.TypeSystem; + using ICSharpCode.ILSpyX.Analyzers; internal sealed class AnalyzedEventTreeNode : AnalyzerEntityTreeNode { diff --git a/ILSpy/Analyzers/TreeNodes/AnalyzedFieldTreeNode.cs b/ILSpy/Analyzers/TreeNodes/AnalyzedFieldTreeNode.cs index a3619b7bf..1f2b9b9a3 100644 --- a/ILSpy/Analyzers/TreeNodes/AnalyzedFieldTreeNode.cs +++ b/ILSpy/Analyzers/TreeNodes/AnalyzedFieldTreeNode.cs @@ -21,6 +21,7 @@ using System.Linq; using ICSharpCode.Decompiler.TypeSystem; using ICSharpCode.ILSpy.TreeNodes; +using ICSharpCode.ILSpyX.Analyzers; namespace ICSharpCode.ILSpy.Analyzers.TreeNodes { diff --git a/ILSpy/Analyzers/TreeNodes/AnalyzedMethodTreeNode.cs b/ILSpy/Analyzers/TreeNodes/AnalyzedMethodTreeNode.cs index 19ce7fa8e..b7cee8ede 100644 --- a/ILSpy/Analyzers/TreeNodes/AnalyzedMethodTreeNode.cs +++ b/ILSpy/Analyzers/TreeNodes/AnalyzedMethodTreeNode.cs @@ -21,6 +21,7 @@ using System.Linq; using ICSharpCode.Decompiler.TypeSystem; using ICSharpCode.ILSpy.TreeNodes; +using ICSharpCode.ILSpyX.Analyzers; namespace ICSharpCode.ILSpy.Analyzers.TreeNodes { diff --git a/ILSpy/Analyzers/TreeNodes/AnalyzedModuleTreeNode.cs b/ILSpy/Analyzers/TreeNodes/AnalyzedModuleTreeNode.cs index 5718a85bc..2c5e7fd53 100644 --- a/ILSpy/Analyzers/TreeNodes/AnalyzedModuleTreeNode.cs +++ b/ILSpy/Analyzers/TreeNodes/AnalyzedModuleTreeNode.cs @@ -21,6 +21,7 @@ using System.Linq; using System.Windows; using ICSharpCode.Decompiler.TypeSystem; +using ICSharpCode.ILSpyX.Analyzers; namespace ICSharpCode.ILSpy.Analyzers.TreeNodes { diff --git a/ILSpy/Analyzers/TreeNodes/AnalyzedPropertyTreeNode.cs b/ILSpy/Analyzers/TreeNodes/AnalyzedPropertyTreeNode.cs index d6504f6b9..d19bc3e73 100644 --- a/ILSpy/Analyzers/TreeNodes/AnalyzedPropertyTreeNode.cs +++ b/ILSpy/Analyzers/TreeNodes/AnalyzedPropertyTreeNode.cs @@ -21,6 +21,7 @@ using System.Linq; using ICSharpCode.Decompiler.TypeSystem; using ICSharpCode.ILSpy.TreeNodes; +using ICSharpCode.ILSpyX.Analyzers; namespace ICSharpCode.ILSpy.Analyzers.TreeNodes { diff --git a/ILSpy/Analyzers/TreeNodes/AnalyzedTypeTreeNode.cs b/ILSpy/Analyzers/TreeNodes/AnalyzedTypeTreeNode.cs index 52757d134..6836944eb 100644 --- a/ILSpy/Analyzers/TreeNodes/AnalyzedTypeTreeNode.cs +++ b/ILSpy/Analyzers/TreeNodes/AnalyzedTypeTreeNode.cs @@ -21,6 +21,7 @@ using System.Linq; using ICSharpCode.Decompiler.TypeSystem; using ICSharpCode.ILSpy.TreeNodes; +using ICSharpCode.ILSpyX.Analyzers; namespace ICSharpCode.ILSpy.Analyzers.TreeNodes { diff --git a/ILSpy/App.xaml.cs b/ILSpy/App.xaml.cs index d04697de4..fe9b1f040 100644 --- a/ILSpy/App.xaml.cs +++ b/ILSpy/App.xaml.cs @@ -31,12 +31,15 @@ using System.Windows.Navigation; using System.Windows.Threading; using ICSharpCode.ILSpy.Options; +using ICSharpCode.ILSpyX.Analyzers; using ICSharpCode.ILSpyX.Settings; using Microsoft.VisualStudio.Composition; using TomsToolbox.Wpf.Styles; +using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window; + namespace ICSharpCode.ILSpy { /// @@ -132,6 +135,8 @@ namespace ICSharpCode.ILSpy } } // Add the built-in parts + var xParts = await discovery.CreatePartsAsync(typeof(IAnalyzer).Assembly); + catalog = catalog.AddParts(xParts); var createdParts = await discovery.CreatePartsAsync(Assembly.GetExecutingAssembly()); catalog = catalog.AddParts(createdParts); // If/When the project switches to .NET Standard/Core, this will be needed to allow metadata interfaces (as opposed