diff --git a/ApprovalTestTool/ApprovalTestTool.csproj b/ApprovalTestTool/ApprovalTestTool.csproj index 73b16b97..6832e907 100644 --- a/ApprovalTestTool/ApprovalTestTool.csproj +++ b/ApprovalTestTool/ApprovalTestTool.csproj @@ -12,8 +12,8 @@ - - + + diff --git a/ApprovalTestTool/Program.cs b/ApprovalTestTool/Program.cs index 9bc65bc8..7f5a206e 100644 --- a/ApprovalTestTool/Program.cs +++ b/ApprovalTestTool/Program.cs @@ -1,6 +1,6 @@ using System.Reflection; -using CodeParser.Parser; -using CodeParser.Parser.Config; +using CSharpCodeAnalyst.CodeParser.Parser; +using CSharpCodeAnalyst.CodeParser.Parser.Config; using LibGit2Sharp; namespace ApprovalTestTool; diff --git a/CLAUDE.md b/CLAUDE.md index 3ddf0a31..aca2456f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -95,4 +95,4 @@ The ~200-element soft limit (`AppSettings.WarningCodeElementLimit`) still applie - `.editorconfig` is authoritative and ReSharper-tuned: braces required on all `if`/`foreach`/`while`, max line length 199, expression-bodied accessors preferred, `internal` first in modifier order. Analyzer severities default to `none` — do not add warning-as-error enforcement without discussion. - Nullable reference types are enabled everywhere; honour the annotations rather than suppressing with `!`. -- Namespaces match folders. `CodeGraph.Graph.CodeGraph` is a class inside the `CodeGraph` assembly — fully-qualify it (`CodeGraph.Graph.CodeGraph`) in places where the namespace/type collision is ambiguous; existing code already does. +- Namespaces match folders, rooted under `CSharpCodeAnalyst.*` for every project (e.g. `CSharpCodeAnalyst.CodeGraph.Graph`, `CSharpCodeAnalyst.CodeParser.Parser`). `CodeGraph` is a class inside `CSharpCodeAnalyst.CodeGraph.Graph` — fully-qualify it (`CSharpCodeAnalyst.CodeGraph.Graph.CodeGraph`) in places where the namespace/type collision is ambiguous; existing code already does. diff --git a/CSharpCodeAnalyst.AnalyzerSdk/CSharpCodeAnalyst.AnalyzerSdk.csproj b/CSharpCodeAnalyst.AnalyzerSdk/CSharpCodeAnalyst.AnalyzerSdk.csproj new file mode 100644 index 00000000..05d5495f --- /dev/null +++ b/CSharpCodeAnalyst.AnalyzerSdk/CSharpCodeAnalyst.AnalyzerSdk.csproj @@ -0,0 +1,26 @@ + + + + net10.0-windows + enable + enable + true + + CSharpCodeAnalyst.AnalyzerSdk + + + + + + + + + + + + + + + + diff --git a/CSharpCodeAnalyst/Shared/Contracts/IAnalyzer.cs b/CSharpCodeAnalyst.AnalyzerSdk/Contracts/IAnalyzer.cs similarity index 90% rename from CSharpCodeAnalyst/Shared/Contracts/IAnalyzer.cs rename to CSharpCodeAnalyst.AnalyzerSdk/Contracts/IAnalyzer.cs index d07bfc55..4da8804b 100644 --- a/CSharpCodeAnalyst/Shared/Contracts/IAnalyzer.cs +++ b/CSharpCodeAnalyst.AnalyzerSdk/Contracts/IAnalyzer.cs @@ -1,4 +1,4 @@ -namespace CSharpCodeAnalyst.Shared.Contracts; +namespace CSharpCodeAnalyst.AnalyzerSdk.Contracts; public interface IAnalyzer { diff --git a/CSharpCodeAnalyst/Shared/Contracts/IPublisher.cs b/CSharpCodeAnalyst.AnalyzerSdk/Contracts/IPublisher.cs similarity index 65% rename from CSharpCodeAnalyst/Shared/Contracts/IPublisher.cs rename to CSharpCodeAnalyst.AnalyzerSdk/Contracts/IPublisher.cs index 6c6f8565..d76e3b40 100644 --- a/CSharpCodeAnalyst/Shared/Contracts/IPublisher.cs +++ b/CSharpCodeAnalyst.AnalyzerSdk/Contracts/IPublisher.cs @@ -1,4 +1,4 @@ -namespace CSharpCodeAnalyst.Shared.Contracts; +namespace CSharpCodeAnalyst.AnalyzerSdk.Contracts; public interface IPublisher { diff --git a/CSharpCodeAnalyst/Shared/DynamicDataGrid/Contracts/TabularData/ColumnType.cs b/CSharpCodeAnalyst.AnalyzerSdk/DynamicDataGrid/Contracts/TabularData/ColumnType.cs similarity index 65% rename from CSharpCodeAnalyst/Shared/DynamicDataGrid/Contracts/TabularData/ColumnType.cs rename to CSharpCodeAnalyst.AnalyzerSdk/DynamicDataGrid/Contracts/TabularData/ColumnType.cs index 6dd9f4d1..b90c269a 100644 --- a/CSharpCodeAnalyst/Shared/DynamicDataGrid/Contracts/TabularData/ColumnType.cs +++ b/CSharpCodeAnalyst.AnalyzerSdk/DynamicDataGrid/Contracts/TabularData/ColumnType.cs @@ -1,4 +1,4 @@ -namespace CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; +namespace CSharpCodeAnalyst.AnalyzerSdk.DynamicDataGrid.Contracts.TabularData; /// /// Available column types for the dynamic data grid diff --git a/CSharpCodeAnalyst/Shared/DynamicDataGrid/Contracts/TabularData/Table.cs b/CSharpCodeAnalyst.AnalyzerSdk/DynamicDataGrid/Contracts/TabularData/Table.cs similarity index 96% rename from CSharpCodeAnalyst/Shared/DynamicDataGrid/Contracts/TabularData/Table.cs rename to CSharpCodeAnalyst.AnalyzerSdk/DynamicDataGrid/Contracts/TabularData/Table.cs index bad068dc..46df2f21 100644 --- a/CSharpCodeAnalyst/Shared/DynamicDataGrid/Contracts/TabularData/Table.cs +++ b/CSharpCodeAnalyst.AnalyzerSdk/DynamicDataGrid/Contracts/TabularData/Table.cs @@ -6,7 +6,7 @@ using System.Windows.Input; using System.Windows.Markup; -namespace CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; +namespace CSharpCodeAnalyst.AnalyzerSdk.DynamicDataGrid.Contracts.TabularData; /// /// Main interface for table data. diff --git a/CSharpCodeAnalyst/Shared/DynamicDataGrid/Contracts/TabularData/TableColumnDefinition.cs b/CSharpCodeAnalyst.AnalyzerSdk/DynamicDataGrid/Contracts/TabularData/TableColumnDefinition.cs similarity index 80% rename from CSharpCodeAnalyst/Shared/DynamicDataGrid/Contracts/TabularData/TableColumnDefinition.cs rename to CSharpCodeAnalyst.AnalyzerSdk/DynamicDataGrid/Contracts/TabularData/TableColumnDefinition.cs index 68af3871..a1a06626 100644 --- a/CSharpCodeAnalyst/Shared/DynamicDataGrid/Contracts/TabularData/TableColumnDefinition.cs +++ b/CSharpCodeAnalyst.AnalyzerSdk/DynamicDataGrid/Contracts/TabularData/TableColumnDefinition.cs @@ -1,7 +1,6 @@ -using System.Collections; -using System.Windows.Input; +using System.Windows.Input; -namespace CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; +namespace CSharpCodeAnalyst.AnalyzerSdk.DynamicDataGrid.Contracts.TabularData; public class TableColumnDefinition { diff --git a/CSharpCodeAnalyst/Shared/DynamicDataGrid/Contracts/TabularData/TableRow.cs b/CSharpCodeAnalyst.AnalyzerSdk/DynamicDataGrid/Contracts/TabularData/TableRow.cs similarity index 88% rename from CSharpCodeAnalyst/Shared/DynamicDataGrid/Contracts/TabularData/TableRow.cs rename to CSharpCodeAnalyst.AnalyzerSdk/DynamicDataGrid/Contracts/TabularData/TableRow.cs index ff9833fe..f2702439 100644 --- a/CSharpCodeAnalyst/Shared/DynamicDataGrid/Contracts/TabularData/TableRow.cs +++ b/CSharpCodeAnalyst.AnalyzerSdk/DynamicDataGrid/Contracts/TabularData/TableRow.cs @@ -1,7 +1,7 @@ using System.ComponentModel; using System.Runtime.CompilerServices; -namespace CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; +namespace CSharpCodeAnalyst.AnalyzerSdk.DynamicDataGrid.Contracts.TabularData; public abstract class TableRow : INotifyPropertyChanged { diff --git a/CSharpCodeAnalyst/Shared/Messages/AddNodeToGraphRequest.cs b/CSharpCodeAnalyst.AnalyzerSdk/Messages/AddNodeToGraphRequest.cs similarity index 80% rename from CSharpCodeAnalyst/Shared/Messages/AddNodeToGraphRequest.cs rename to CSharpCodeAnalyst.AnalyzerSdk/Messages/AddNodeToGraphRequest.cs index fe49c704..8d91cd63 100644 --- a/CSharpCodeAnalyst/Shared/Messages/AddNodeToGraphRequest.cs +++ b/CSharpCodeAnalyst.AnalyzerSdk/Messages/AddNodeToGraphRequest.cs @@ -1,6 +1,7 @@ -using CodeGraph.Graph; + +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CSharpCodeAnalyst.Shared.Messages; +namespace CSharpCodeAnalyst.AnalyzerSdk.Messages; public class AddNodeToGraphRequest { diff --git a/CSharpCodeAnalyst.AnalyzerSdk/Messages/OpenSourceLocationRequest.cs b/CSharpCodeAnalyst.AnalyzerSdk/Messages/OpenSourceLocationRequest.cs new file mode 100644 index 00000000..c916fff8 --- /dev/null +++ b/CSharpCodeAnalyst.AnalyzerSdk/Messages/OpenSourceLocationRequest.cs @@ -0,0 +1,8 @@ +using CSharpCodeAnalyst.CodeGraph.Graph; + +namespace CSharpCodeAnalyst.AnalyzerSdk.Messages; + +public class OpenSourceLocationRequest(SourceLocation location) +{ + public SourceLocation Location { get; } = location; +} diff --git a/CSharpCodeAnalyst/Shared/Messages/ShowPartitionsRequest.cs b/CSharpCodeAnalyst.AnalyzerSdk/Messages/ShowPartitionsRequest.cs similarity index 76% rename from CSharpCodeAnalyst/Shared/Messages/ShowPartitionsRequest.cs rename to CSharpCodeAnalyst.AnalyzerSdk/Messages/ShowPartitionsRequest.cs index 8f1971ec..564a76b7 100644 --- a/CSharpCodeAnalyst/Shared/Messages/ShowPartitionsRequest.cs +++ b/CSharpCodeAnalyst.AnalyzerSdk/Messages/ShowPartitionsRequest.cs @@ -1,6 +1,6 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CSharpCodeAnalyst.Shared.Messages; +namespace CSharpCodeAnalyst.AnalyzerSdk.Messages; public class ShowPartitionsRequest { diff --git a/CSharpCodeAnalyst/Shared/Messages/ShowTabularDataRequest.cs b/CSharpCodeAnalyst.AnalyzerSdk/Messages/ShowTabularDataRequest.cs similarity index 79% rename from CSharpCodeAnalyst/Shared/Messages/ShowTabularDataRequest.cs rename to CSharpCodeAnalyst.AnalyzerSdk/Messages/ShowTabularDataRequest.cs index 3d56592b..01db22b3 100644 --- a/CSharpCodeAnalyst/Shared/Messages/ShowTabularDataRequest.cs +++ b/CSharpCodeAnalyst.AnalyzerSdk/Messages/ShowTabularDataRequest.cs @@ -1,6 +1,6 @@ -using CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; +using CSharpCodeAnalyst.AnalyzerSdk.DynamicDataGrid.Contracts.TabularData; -namespace CSharpCodeAnalyst.Shared.Messages; +namespace CSharpCodeAnalyst.AnalyzerSdk.Messages; /// /// Requests a dynamic result tab. keys the tab: publishing again under the diff --git a/CSharpCodeAnalyst/Shared/Notifications/IUserNotification.cs b/CSharpCodeAnalyst.AnalyzerSdk/Notifications/IUserNotification.cs similarity index 88% rename from CSharpCodeAnalyst/Shared/Notifications/IUserNotification.cs rename to CSharpCodeAnalyst.AnalyzerSdk/Notifications/IUserNotification.cs index 75a7ac9a..96cd6f6e 100644 --- a/CSharpCodeAnalyst/Shared/Notifications/IUserNotification.cs +++ b/CSharpCodeAnalyst.AnalyzerSdk/Notifications/IUserNotification.cs @@ -1,4 +1,4 @@ -namespace CSharpCodeAnalyst.Shared.Notifications; +namespace CSharpCodeAnalyst.AnalyzerSdk.Notifications; public interface IUserNotification { diff --git a/CSharpCodeAnalyst/Resources/blue-info_16.png b/CSharpCodeAnalyst.AnalyzerSdk/Resources/blue-info_16.png similarity index 100% rename from CSharpCodeAnalyst/Resources/blue-info_16.png rename to CSharpCodeAnalyst.AnalyzerSdk/Resources/blue-info_16.png diff --git a/CSharpCodeAnalyst/Resources/error.png b/CSharpCodeAnalyst.AnalyzerSdk/Resources/error.png similarity index 100% rename from CSharpCodeAnalyst/Resources/error.png rename to CSharpCodeAnalyst.AnalyzerSdk/Resources/error.png diff --git a/CSharpCodeAnalyst/Shared/Search/PascalCaseSearch.cs b/CSharpCodeAnalyst.AnalyzerSdk/Search/PascalCaseSearch.cs similarity index 96% rename from CSharpCodeAnalyst/Shared/Search/PascalCaseSearch.cs rename to CSharpCodeAnalyst.AnalyzerSdk/Search/PascalCaseSearch.cs index e1309626..633303bb 100644 --- a/CSharpCodeAnalyst/Shared/Search/PascalCaseSearch.cs +++ b/CSharpCodeAnalyst.AnalyzerSdk/Search/PascalCaseSearch.cs @@ -1,7 +1,7 @@ using System.Text; using System.Text.RegularExpressions; -namespace CSharpCodeAnalyst.Shared.Search; +namespace CSharpCodeAnalyst.AnalyzerSdk.Search; public static class PascalCaseSearch { diff --git a/CSharpCodeAnalyst/Shared/Search/SearchExpression.cs b/CSharpCodeAnalyst.AnalyzerSdk/Search/SearchExpression.cs similarity index 97% rename from CSharpCodeAnalyst/Shared/Search/SearchExpression.cs rename to CSharpCodeAnalyst.AnalyzerSdk/Search/SearchExpression.cs index 3ee5fcf5..72ba1c79 100644 --- a/CSharpCodeAnalyst/Shared/Search/SearchExpression.cs +++ b/CSharpCodeAnalyst.AnalyzerSdk/Search/SearchExpression.cs @@ -1,12 +1,12 @@ using System.Text.RegularExpressions; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CSharpCodeAnalyst.Shared.Search; +namespace CSharpCodeAnalyst.AnalyzerSdk.Search; /// /// Helper to build (very) simple search expressions with AND/OR/TERM /// -internal interface IExpression +public interface IExpression { bool Evaluate(CodeElement? item); } diff --git a/CSharpCodeAnalyst/Shared/Search/SearchExpressionFactory.cs b/CSharpCodeAnalyst.AnalyzerSdk/Search/SearchExpressionFactory.cs similarity index 90% rename from CSharpCodeAnalyst/Shared/Search/SearchExpressionFactory.cs rename to CSharpCodeAnalyst.AnalyzerSdk/Search/SearchExpressionFactory.cs index b7301795..21d57a83 100644 --- a/CSharpCodeAnalyst/Shared/Search/SearchExpressionFactory.cs +++ b/CSharpCodeAnalyst.AnalyzerSdk/Search/SearchExpressionFactory.cs @@ -1,6 +1,6 @@ -namespace CSharpCodeAnalyst.Shared.Search; +namespace CSharpCodeAnalyst.AnalyzerSdk.Search; -internal static class SearchExpressionFactory +public static class SearchExpressionFactory { private static Term CreateTerm(string search, TextSearchField searchField) { @@ -39,7 +39,7 @@ public static IExpression CreateSearchExpression(string searchText, TextSearchFi return root; } - internal enum TextSearchField + public enum TextSearchField { FullName, Name diff --git a/CSharpCodeAnalyst/Styles/ImageStyles.xaml b/CSharpCodeAnalyst.AnalyzerSdk/Styles/ImageStyles.xaml similarity index 82% rename from CSharpCodeAnalyst/Styles/ImageStyles.xaml rename to CSharpCodeAnalyst.AnalyzerSdk/Styles/ImageStyles.xaml index 0fee93aa..9444ba69 100644 --- a/CSharpCodeAnalyst/Styles/ImageStyles.xaml +++ b/CSharpCodeAnalyst.AnalyzerSdk/Styles/ImageStyles.xaml @@ -4,7 +4,7 @@ - + diff --git a/CSharpCodeAnalyst.AnalyzerSdk/Wpf/IconLoader.cs b/CSharpCodeAnalyst.AnalyzerSdk/Wpf/IconLoader.cs new file mode 100644 index 00000000..341cccbf --- /dev/null +++ b/CSharpCodeAnalyst.AnalyzerSdk/Wpf/IconLoader.cs @@ -0,0 +1,60 @@ +using System.Reflection; +using System.Windows.Media; +using System.Windows.Media.Imaging; + +namespace CSharpCodeAnalyst.AnalyzerSdk.Wpf; + +public static class IconLoader +{ + private static readonly Dictionary IconCache = new(); + + /// + /// Loads an icon embedded as a WPF "Resource" in the calling assembly (e.g. the host or an + /// analyzer plugin), not necessarily the entry assembly - so each assembly can ship its own + /// icons without depending on another assembly's resources. + /// + public static ImageSource? LoadIcon(string iconPath) + { + var assemblyName = Assembly.GetCallingAssembly().GetName().Name; + return LoadIcon(assemblyName, iconPath); + } + + /// + /// Loads an icon embedded as a WPF "Resource" in the given assembly - use this for icons + /// shared across assemblies (e.g. SDK icons referenced by an analyzer plugin). + /// + public static ImageSource? LoadIcon(string? assemblyName, string iconPath) + { + try + { + var cacheKey = $"{assemblyName}|{iconPath}"; + + if (IconCache.TryGetValue(cacheKey, out var icon)) + { + return icon; + } + + var bitmap = Load(assemblyName, iconPath); + + IconCache[cacheKey] = bitmap; + return bitmap; + } + catch + { + return null; + } + } + + private static BitmapImage Load(string? assemblyName, string iconPath) + { + var bitmap = new BitmapImage(); + bitmap.BeginInit(); + bitmap.UriSource = new Uri($"pack://application:,,,/{assemblyName};component/{iconPath}"); + bitmap.DecodePixelWidth = 16; + bitmap.DecodePixelHeight = 16; + bitmap.CacheOption = BitmapCacheOption.OnLoad; + bitmap.EndInit(); + bitmap.Freeze(); + return bitmap; + } +} \ No newline at end of file diff --git a/CSharpCodeAnalyst/Shared/Wpf/WpfCommand.cs b/CSharpCodeAnalyst.AnalyzerSdk/Wpf/WpfCommand.cs similarity index 97% rename from CSharpCodeAnalyst/Shared/Wpf/WpfCommand.cs rename to CSharpCodeAnalyst.AnalyzerSdk/Wpf/WpfCommand.cs index 78795673..4a6c68de 100644 --- a/CSharpCodeAnalyst/Shared/Wpf/WpfCommand.cs +++ b/CSharpCodeAnalyst.AnalyzerSdk/Wpf/WpfCommand.cs @@ -1,6 +1,6 @@ using System.Windows.Input; -namespace CSharpCodeAnalyst.Shared.Wpf; +namespace CSharpCodeAnalyst.AnalyzerSdk.Wpf; public class WpfCommand : ICommand { diff --git a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Analyzer.cs b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Analyzer.cs similarity index 91% rename from CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Analyzer.cs rename to CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Analyzer.cs index 59e9c6a7..588e0e89 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Analyzer.cs +++ b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Analyzer.cs @@ -2,15 +2,15 @@ using System.IO; using System.Text.Json; using System.Windows; -using CodeGraph.Graph; -using CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Presentation; -using CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Rules; -using CSharpCodeAnalyst.Resources; -using CSharpCodeAnalyst.Shared.Contracts; -using CSharpCodeAnalyst.Shared.Messages; -using CSharpCodeAnalyst.Shared.Notifications; +using CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Presentation; +using CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Rules; +using CSharpCodeAnalyst.Analyzers.Resources; +using CSharpCodeAnalyst.AnalyzerSdk.Contracts; +using CSharpCodeAnalyst.AnalyzerSdk.Messages; +using CSharpCodeAnalyst.AnalyzerSdk.Notifications; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules; +namespace CSharpCodeAnalyst.Analyzers.ArchitecturalRules; public class Analyzer : IAnalyzer { @@ -115,8 +115,10 @@ public void SetPersistentData(string? data) var persistentData = JsonSerializer.Deserialize(data); if (persistentData != null) { - var rulesText = persistentData.RulesText ?? string.Empty; - ParseAndStoreRules(rulesText); + // Set directly instead of going through ParseAndStoreRules: loading a saved + // project is not a user edit and must not mark the analyzer dirty. + _rulesText = persistentData.RulesText ?? string.Empty; + _rules = RuleParser.ParseRules(_rulesText); } } catch (Exception ex) @@ -127,6 +129,8 @@ public void SetPersistentData(string? data) _rulesText = string.Empty; _rules.Clear(); } + + SetDirty(false); } public bool IsDirty() @@ -163,7 +167,7 @@ private void OnValidateRules(string rulesText) else { // Show violations in tabular format - var violationsViewModel = new RuleViolationsViewModel(violations, _currentGraph); + var violationsViewModel = new RuleViolationsViewModel(violations, _currentGraph, _messaging); _messaging.Publish(new ShowTabularDataRequest(Id, Name, violationsViewModel)); } } diff --git a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/PatternMatcher.cs b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/PatternMatcher.cs similarity index 96% rename from CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/PatternMatcher.cs rename to CSharpCodeAnalyst.Analyzers/ArchitecturalRules/PatternMatcher.cs index 2a236a89..8afc495d 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/PatternMatcher.cs +++ b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/PatternMatcher.cs @@ -1,6 +1,6 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules; +namespace CSharpCodeAnalyst.Analyzers.ArchitecturalRules; public static class PatternMatcher { diff --git a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/PersistenceData.cs b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/PersistenceData.cs similarity index 57% rename from CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/PersistenceData.cs rename to CSharpCodeAnalyst.Analyzers/ArchitecturalRules/PersistenceData.cs index 8591395c..89dda29c 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/PersistenceData.cs +++ b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/PersistenceData.cs @@ -1,4 +1,4 @@ -namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules; +namespace CSharpCodeAnalyst.Analyzers.ArchitecturalRules; public class PersistenceData { diff --git a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Presentation/ArchitecturalRulesDialog.xaml b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Presentation/ArchitecturalRulesDialog.xaml similarity index 93% rename from CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Presentation/ArchitecturalRulesDialog.xaml rename to CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Presentation/ArchitecturalRulesDialog.xaml index e325fe7a..ba5b03e2 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Presentation/ArchitecturalRulesDialog.xaml +++ b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Presentation/ArchitecturalRulesDialog.xaml @@ -1,9 +1,9 @@ - - + diff --git a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Presentation/ArchitecturalRulesDialog.xaml.cs b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Presentation/ArchitecturalRulesDialog.xaml.cs similarity index 96% rename from CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Presentation/ArchitecturalRulesDialog.xaml.cs rename to CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Presentation/ArchitecturalRulesDialog.xaml.cs index 2224e29d..1d87ed2a 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Presentation/ArchitecturalRulesDialog.xaml.cs +++ b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Presentation/ArchitecturalRulesDialog.xaml.cs @@ -2,10 +2,10 @@ using System.IO; using System.Runtime.CompilerServices; using System.Windows; -using CSharpCodeAnalyst.Resources; +using CSharpCodeAnalyst.Analyzers.Resources; using Microsoft.Win32; -namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Presentation; +namespace CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Presentation; public partial class ArchitecturalRulesDialog : INotifyPropertyChanged { diff --git a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Presentation/RelationshipViewModel.cs b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Presentation/RelationshipViewModel.cs similarity index 86% rename from CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Presentation/RelationshipViewModel.cs rename to CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Presentation/RelationshipViewModel.cs index 15b0e7f2..60fc7a24 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Presentation/RelationshipViewModel.cs +++ b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Presentation/RelationshipViewModel.cs @@ -1,6 +1,6 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Presentation; +namespace CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Presentation; /// /// A line in the detail view. Note a view model is created for each source location in a relationship. diff --git a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Presentation/RelationshipViewModelTemplate.xaml b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Presentation/RelationshipViewModelTemplate.xaml similarity index 97% rename from CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Presentation/RelationshipViewModelTemplate.xaml rename to CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Presentation/RelationshipViewModelTemplate.xaml index b6f6b0d8..e418238d 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Presentation/RelationshipViewModelTemplate.xaml +++ b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Presentation/RelationshipViewModelTemplate.xaml @@ -2,7 +2,7 @@ xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:presentation="clr-namespace:CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Presentation" + xmlns:presentation="clr-namespace:CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Presentation" mc:Ignorable="d"> CreateRelationshipDetails() return details; } - private static void OnOpenSourceLocation(RelationshipViewModel? detailViewModel) + private void OnOpenSourceLocation(RelationshipViewModel? detailViewModel) { if (detailViewModel?.SourceLocation is null) { return; } - try - { - SourceLocationNavigator.Open(detailViewModel.SourceLocation.File, - detailViewModel.SourceLocation.Line, - detailViewModel.SourceLocation.Column); - } - catch (Exception ex) - { - var message = string.Format(Strings.OperationFailed_Message, ex.Message); - MessageBox.Show(message, Strings.Error_Title, MessageBoxButton.OK, - MessageBoxImage.Error); - } + _messaging.Publish(new OpenSourceLocationRequest(detailViewModel.SourceLocation)); } } \ No newline at end of file diff --git a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Presentation/RuleViolationsViewModel.cs b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Presentation/RuleViolationsViewModel.cs similarity index 80% rename from CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Presentation/RuleViolationsViewModel.cs rename to CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Presentation/RuleViolationsViewModel.cs index 9d6fea64..a7c94366 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Presentation/RuleViolationsViewModel.cs +++ b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Presentation/RuleViolationsViewModel.cs @@ -1,17 +1,18 @@ using System.Collections.ObjectModel; using System.Windows; -using CSharpCodeAnalyst.Resources; -using CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; +using CSharpCodeAnalyst.Analyzers.Resources; +using CSharpCodeAnalyst.AnalyzerSdk.Contracts; +using CSharpCodeAnalyst.AnalyzerSdk.DynamicDataGrid.Contracts.TabularData; -namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Presentation; +namespace CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Presentation; public class RuleViolationsViewModel : Table { private readonly ObservableCollection _violations; - public RuleViolationsViewModel(List violations, CodeGraph.Graph.CodeGraph codeGraph) + public RuleViolationsViewModel(List violations, CodeGraph.Graph.CodeGraph codeGraph, IPublisher messaging) { - var violationViewModels = violations.Select(v => new RuleViolationViewModel(v, codeGraph)); + var violationViewModels = violations.Select(v => new RuleViolationViewModel(v, codeGraph, messaging)); _violations = new ObservableCollection(violationViewModels); } @@ -61,7 +62,7 @@ public override ObservableCollection GetData() public override DataTemplate GetRowDetailsTemplate() { var uri = new Uri( - "/CSharpCodeAnalyst;component/Features/Analyzers/ArchitecturalRules/Presentation/RelationshipViewModelTemplate.xaml", + "/CSharpCodeAnalyst.Analyzers;component/ArchitecturalRules/Presentation/RelationshipViewModelTemplate.xaml", UriKind.Relative); return (DataTemplate)Application.LoadComponent(uri); } diff --git a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/RuleParser.cs b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/RuleParser.cs similarity index 95% rename from CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/RuleParser.cs rename to CSharpCodeAnalyst.Analyzers/ArchitecturalRules/RuleParser.cs index d95d0cfe..2ab9b687 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/RuleParser.cs +++ b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/RuleParser.cs @@ -1,8 +1,8 @@ using System.Text.RegularExpressions; -using CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Rules; -using CSharpCodeAnalyst.Resources; +using CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Rules; +using CSharpCodeAnalyst.Analyzers.Resources; -namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules; +namespace CSharpCodeAnalyst.Analyzers.ArchitecturalRules; public static class RuleParser { diff --git a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/DenyRule.cs b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Rules/DenyRule.cs similarity index 88% rename from CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/DenyRule.cs rename to CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Rules/DenyRule.cs index 2ea429fa..b98a0de3 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/DenyRule.cs +++ b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Rules/DenyRule.cs @@ -1,6 +1,6 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Rules; +namespace CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Rules; /// /// Denies dependencies from source to target patterns diff --git a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/IsolateRule.cs b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Rules/IsolateRule.cs similarity index 87% rename from CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/IsolateRule.cs rename to CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Rules/IsolateRule.cs index fbf55da7..806085c7 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/IsolateRule.cs +++ b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Rules/IsolateRule.cs @@ -1,6 +1,6 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Rules; +namespace CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Rules; /// /// Isolates source pattern from any external dependencies diff --git a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/RestrictRule.cs b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Rules/RestrictRule.cs similarity index 87% rename from CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/RestrictRule.cs rename to CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Rules/RestrictRule.cs index b584936c..16eee9a5 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/RestrictRule.cs +++ b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Rules/RestrictRule.cs @@ -1,6 +1,6 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Rules; +namespace CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Rules; /// /// Restricts source to only depend on target patterns (all others are denied) diff --git a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/RestrictRuleGroup.cs b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Rules/RestrictRuleGroup.cs similarity index 92% rename from CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/RestrictRuleGroup.cs rename to CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Rules/RestrictRuleGroup.cs index dfae1898..e4e1c832 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/RestrictRuleGroup.cs +++ b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Rules/RestrictRuleGroup.cs @@ -1,6 +1,6 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Rules; +namespace CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Rules; /// /// Groups multiple RESTRICT rules with the same source pattern diff --git a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/RuleBase.cs b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Rules/RuleBase.cs similarity index 84% rename from CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/RuleBase.cs rename to CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Rules/RuleBase.cs index ebf04f14..93cb6b32 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Rules/RuleBase.cs +++ b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Rules/RuleBase.cs @@ -1,6 +1,6 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Rules; +namespace CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Rules; public abstract class RuleBase { diff --git a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Violation.cs b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Violation.cs similarity index 81% rename from CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Violation.cs rename to CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Violation.cs index 5fc7f118..7f2ab026 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/Violation.cs +++ b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/Violation.cs @@ -1,7 +1,7 @@ -using CodeGraph.Graph; -using CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Rules; +using CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Rules; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules; +namespace CSharpCodeAnalyst.Analyzers.ArchitecturalRules; public class Violation { diff --git a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/ViolationFormatter.cs b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/ViolationFormatter.cs similarity index 93% rename from CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/ViolationFormatter.cs rename to CSharpCodeAnalyst.Analyzers/ArchitecturalRules/ViolationFormatter.cs index a9eaa387..5e597d4a 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/ArchitecturalRules/ViolationFormatter.cs +++ b/CSharpCodeAnalyst.Analyzers/ArchitecturalRules/ViolationFormatter.cs @@ -1,7 +1,7 @@ using System.Text; -using CSharpCodeAnalyst.Resources; +using CSharpCodeAnalyst.Analyzers.Resources; -namespace CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules; +namespace CSharpCodeAnalyst.Analyzers.ArchitecturalRules; public static class ViolationsFormatter { diff --git a/CSharpCodeAnalyst.Analyzers/CSharpCodeAnalyst.Analyzers.csproj b/CSharpCodeAnalyst.Analyzers/CSharpCodeAnalyst.Analyzers.csproj new file mode 100644 index 00000000..60b44539 --- /dev/null +++ b/CSharpCodeAnalyst.Analyzers/CSharpCodeAnalyst.Analyzers.csproj @@ -0,0 +1,53 @@ + + + + net10.0-windows + enable + enable + true + CSharpCodeAnalyst.Analyzers + + + + + + + + + + MSBuild:Compile + Wpf + Designer + + + MSBuild:Compile + Wpf + Designer + + + MSBuild:Compile + Wpf + Designer + + + + + + True + True + Strings.resx + + + + + + PublicResXFileCodeGenerator + Strings.Designer.cs + + + + + + + + diff --git a/CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Analyzer.cs b/CSharpCodeAnalyst.Analyzers/EventRegistration/Analyzer.cs similarity index 75% rename from CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Analyzer.cs rename to CSharpCodeAnalyst.Analyzers/EventRegistration/Analyzer.cs index e895a77b..52083da3 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Analyzer.cs +++ b/CSharpCodeAnalyst.Analyzers/EventRegistration/Analyzer.cs @@ -1,11 +1,11 @@ -using CodeGraph.Graph; -using CSharpCodeAnalyst.Features.Analyzers.EventRegistration.Presentation; -using CSharpCodeAnalyst.Resources; -using CSharpCodeAnalyst.Shared.Contracts; -using CSharpCodeAnalyst.Shared.Messages; -using CSharpCodeAnalyst.Shared.UI; +using CSharpCodeAnalyst.Analyzers.EventRegistration.Presentation; +using CSharpCodeAnalyst.Analyzers.Resources; +using CSharpCodeAnalyst.AnalyzerSdk.Contracts; +using CSharpCodeAnalyst.AnalyzerSdk.Messages; +using CSharpCodeAnalyst.AnalyzerSdk.Notifications; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CSharpCodeAnalyst.Features.Analyzers.EventRegistration; +namespace CSharpCodeAnalyst.Analyzers.EventRegistration; /// /// Finds imbalances between event registrations and un-registrations. @@ -13,10 +13,12 @@ namespace CSharpCodeAnalyst.Features.Analyzers.EventRegistration; public class Analyzer : IAnalyzer { private readonly IPublisher _messaging; + private readonly IUserNotification _userNotification; - public Analyzer(IPublisher messaging) + public Analyzer(IPublisher messaging, IUserNotification userNotification) { _messaging = messaging; + _userNotification = userNotification; } public void Analyze(CodeGraph.Graph.CodeGraph graph) @@ -25,11 +27,11 @@ public void Analyze(CodeGraph.Graph.CodeGraph graph) if (imbalances.Count == 0) { - ToastManager.ShowSuccess(Strings.Analyzer_EventRegistration_NoData); + _userNotification.ShowSuccess(Strings.Analyzer_EventRegistration_NoData); return; } - var vm = new EventImbalancesViewModel(imbalances); + var vm = new EventImbalancesViewModel(imbalances, _messaging); _messaging.Publish(new ShowTabularDataRequest(Id, Name, vm)); } diff --git a/CSharpCodeAnalyst.Analyzers/EventRegistration/Presentation/EventImbalanceViewModel.cs b/CSharpCodeAnalyst.Analyzers/EventRegistration/Presentation/EventImbalanceViewModel.cs new file mode 100644 index 00000000..205d0e48 --- /dev/null +++ b/CSharpCodeAnalyst.Analyzers/EventRegistration/Presentation/EventImbalanceViewModel.cs @@ -0,0 +1,39 @@ +using System.Collections.ObjectModel; +using System.Windows.Input; +using CSharpCodeAnalyst.AnalyzerSdk.Contracts; +using CSharpCodeAnalyst.AnalyzerSdk.DynamicDataGrid.Contracts.TabularData; +using CSharpCodeAnalyst.AnalyzerSdk.Messages; +using CSharpCodeAnalyst.AnalyzerSdk.Wpf; +using CSharpCodeAnalyst.CodeGraph.Graph; + +namespace CSharpCodeAnalyst.Analyzers.EventRegistration.Presentation; + +public class EventImbalanceViewModel : TableRow +{ + private readonly IPublisher _messaging; + + internal EventImbalanceViewModel(Result imbalance, IPublisher messaging) + { + _messaging = messaging; + Description = imbalance.Handler.FullName; + Locations = new ObservableCollection(imbalance.Locations); + OpenSourceLocationCommand = new WpfCommand(OnOpenSourceLocation); + } + + public ICommand OpenSourceLocationCommand { get; set; } + + public ObservableCollection Locations { get; set; } + + public string Description { get; } + + + private void OnOpenSourceLocation(SourceLocation? location) + { + if (location is null) + { + return; + } + + _messaging.Publish(new OpenSourceLocationRequest(location)); + } +} \ No newline at end of file diff --git a/CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Presentation/EventImbalancesViewModel.cs b/CSharpCodeAnalyst.Analyzers/EventRegistration/Presentation/EventImbalancesViewModel.cs similarity index 69% rename from CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Presentation/EventImbalancesViewModel.cs rename to CSharpCodeAnalyst.Analyzers/EventRegistration/Presentation/EventImbalancesViewModel.cs index f643cbe7..64b9c306 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Presentation/EventImbalancesViewModel.cs +++ b/CSharpCodeAnalyst.Analyzers/EventRegistration/Presentation/EventImbalancesViewModel.cs @@ -1,17 +1,18 @@ using System.Collections.ObjectModel; using System.Windows; -using CSharpCodeAnalyst.Resources; -using CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; +using CSharpCodeAnalyst.Analyzers.Resources; +using CSharpCodeAnalyst.AnalyzerSdk.Contracts; +using CSharpCodeAnalyst.AnalyzerSdk.DynamicDataGrid.Contracts.TabularData; -namespace CSharpCodeAnalyst.Features.Analyzers.EventRegistration.Presentation; +namespace CSharpCodeAnalyst.Analyzers.EventRegistration.Presentation; internal class EventImbalancesViewModel : Table { private readonly ObservableCollection _imbalances; - internal EventImbalancesViewModel(List imbalances) + internal EventImbalancesViewModel(List imbalances, IPublisher messaging) { - var tmp = imbalances.Select(i => new EventImbalanceViewModel(i)); + var tmp = imbalances.Select(i => new EventImbalanceViewModel(i, messaging)); _imbalances = new ObservableCollection(tmp); } @@ -37,7 +38,7 @@ public override ObservableCollection GetData() public override DataTemplate GetRowDetailsTemplate() { var uri = new Uri( - "/CSharpCodeAnalyst;component/Features/Analyzers/EventRegistration/Presentation/SourceLocationTemplate.xaml", + "/CSharpCodeAnalyst.Analyzers;component/EventRegistration/Presentation/SourceLocationTemplate.xaml", UriKind.Relative); return (DataTemplate)Application.LoadComponent(uri); } diff --git a/CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Presentation/SourceLocationTemplate.xaml b/CSharpCodeAnalyst.Analyzers/EventRegistration/Presentation/SourceLocationTemplate.xaml similarity index 91% rename from CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Presentation/SourceLocationTemplate.xaml rename to CSharpCodeAnalyst.Analyzers/EventRegistration/Presentation/SourceLocationTemplate.xaml index d8662ab5..8eca0b49 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Presentation/SourceLocationTemplate.xaml +++ b/CSharpCodeAnalyst.Analyzers/EventRegistration/Presentation/SourceLocationTemplate.xaml @@ -2,12 +2,12 @@ xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:graph="clr-namespace:CodeGraph.Graph;assembly=CodeGraph" + xmlns:graph1="clr-namespace:CSharpCodeAnalyst.CodeGraph.Graph;assembly=CSharpCodeAnalyst.CodeGraph" mc:Ignorable="d"> - + diff --git a/CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Result.cs b/CSharpCodeAnalyst.Analyzers/EventRegistration/Result.cs similarity index 76% rename from CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Result.cs rename to CSharpCodeAnalyst.Analyzers/EventRegistration/Result.cs index 58ab04f9..0de66807 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Result.cs +++ b/CSharpCodeAnalyst.Analyzers/EventRegistration/Result.cs @@ -1,6 +1,6 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CSharpCodeAnalyst.Features.Analyzers.EventRegistration; +namespace CSharpCodeAnalyst.Analyzers.EventRegistration; public class Result { diff --git a/CSharpCodeAnalyst/Features/Analyzers/MethodComplexity/Analyzer.cs b/CSharpCodeAnalyst.Analyzers/MethodComplexity/Analyzer.cs similarity index 70% rename from CSharpCodeAnalyst/Features/Analyzers/MethodComplexity/Analyzer.cs rename to CSharpCodeAnalyst.Analyzers/MethodComplexity/Analyzer.cs index 404cc411..0aa6bf41 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/MethodComplexity/Analyzer.cs +++ b/CSharpCodeAnalyst.Analyzers/MethodComplexity/Analyzer.cs @@ -1,11 +1,11 @@ -using CodeGraph.Metrics; -using CSharpCodeAnalyst.Features.Analyzers.MethodComplexity.Presentation; -using CSharpCodeAnalyst.Resources; -using CSharpCodeAnalyst.Shared.Contracts; -using CSharpCodeAnalyst.Shared.Messages; -using CSharpCodeAnalyst.Shared.UI; +using CSharpCodeAnalyst.Analyzers.MethodComplexity.Presentation; +using CSharpCodeAnalyst.Analyzers.Resources; +using CSharpCodeAnalyst.AnalyzerSdk.Contracts; +using CSharpCodeAnalyst.AnalyzerSdk.Messages; +using CSharpCodeAnalyst.AnalyzerSdk.Notifications; +using CSharpCodeAnalyst.CodeGraph.Metrics; -namespace CSharpCodeAnalyst.Features.Analyzers.MethodComplexity; +namespace CSharpCodeAnalyst.Analyzers.MethodComplexity; /// /// Lists per-method source metrics (lines of code, cyclomatic complexity) collected during @@ -16,10 +16,12 @@ public class Analyzer : IAnalyzer { private readonly MetricStore _metricStore; private readonly IPublisher _messaging; + private readonly IUserNotification _userNotification; - public Analyzer(IPublisher messaging, MetricStore metricStore) + public Analyzer(IPublisher messaging, IUserNotification userNotification, MetricStore metricStore) { _messaging = messaging; + _userNotification = userNotification; _metricStore = metricStore; } @@ -31,7 +33,7 @@ public void Analyze(CodeGraph.Graph.CodeGraph graph) { if (_metricStore.IsEmpty) { - ToastManager.ShowInfo(Strings.Analyzer_MethodComplexity_NoData); + _userNotification.ShowSuccess(Strings.Analyzer_MethodComplexity_NoData); return; } @@ -45,7 +47,7 @@ public void Analyze(CodeGraph.Graph.CodeGraph graph) if (rows.Count == 0) { - ToastManager.ShowInfo(Strings.Analyzer_MethodComplexity_NoData); + _userNotification.ShowSuccess(Strings.Analyzer_MethodComplexity_NoData); return; } diff --git a/CSharpCodeAnalyst/Features/Analyzers/MethodComplexity/Presentation/MethodComplexityRowViewModel.cs b/CSharpCodeAnalyst.Analyzers/MethodComplexity/Presentation/MethodComplexityRowViewModel.cs similarity index 82% rename from CSharpCodeAnalyst/Features/Analyzers/MethodComplexity/Presentation/MethodComplexityRowViewModel.cs rename to CSharpCodeAnalyst.Analyzers/MethodComplexity/Presentation/MethodComplexityRowViewModel.cs index 305b7221..44ae3f80 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/MethodComplexity/Presentation/MethodComplexityRowViewModel.cs +++ b/CSharpCodeAnalyst.Analyzers/MethodComplexity/Presentation/MethodComplexityRowViewModel.cs @@ -1,9 +1,9 @@ using System.Globalization; -using CodeGraph.Graph; -using CodeGraph.Metrics; -using CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; +using CSharpCodeAnalyst.AnalyzerSdk.DynamicDataGrid.Contracts.TabularData; +using CSharpCodeAnalyst.CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Metrics; -namespace CSharpCodeAnalyst.Features.Analyzers.MethodComplexity.Presentation; +namespace CSharpCodeAnalyst.Analyzers.MethodComplexity.Presentation; public class MethodComplexityRowViewModel : TableRow { diff --git a/CSharpCodeAnalyst/Features/Analyzers/MethodComplexity/Presentation/MethodComplexityViewModel.cs b/CSharpCodeAnalyst.Analyzers/MethodComplexity/Presentation/MethodComplexityViewModel.cs similarity index 87% rename from CSharpCodeAnalyst/Features/Analyzers/MethodComplexity/Presentation/MethodComplexityViewModel.cs rename to CSharpCodeAnalyst.Analyzers/MethodComplexity/Presentation/MethodComplexityViewModel.cs index 05b3e304..8ed444bc 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/MethodComplexity/Presentation/MethodComplexityViewModel.cs +++ b/CSharpCodeAnalyst.Analyzers/MethodComplexity/Presentation/MethodComplexityViewModel.cs @@ -1,14 +1,13 @@ using System.Collections.ObjectModel; using System.Windows; -using CSharpCodeAnalyst.Resources; -using CSharpCodeAnalyst.Shared.Contracts; -using CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; -using CSharpCodeAnalyst.Shared.Messages; -using CSharpCodeAnalyst.Shared.Search; -using CSharpCodeAnalyst.Shared.Services; -using CSharpCodeAnalyst.Shared.Wpf; +using CSharpCodeAnalyst.Analyzers.Resources; +using CSharpCodeAnalyst.AnalyzerSdk.Contracts; +using CSharpCodeAnalyst.AnalyzerSdk.DynamicDataGrid.Contracts.TabularData; +using CSharpCodeAnalyst.AnalyzerSdk.Messages; +using CSharpCodeAnalyst.AnalyzerSdk.Search; +using CSharpCodeAnalyst.AnalyzerSdk.Wpf; -namespace CSharpCodeAnalyst.Features.Analyzers.MethodComplexity.Presentation; +namespace CSharpCodeAnalyst.Analyzers.MethodComplexity.Presentation; internal class MethodComplexityViewModel : Table { @@ -119,8 +118,8 @@ private static bool CanJumpToCode(MethodComplexityRowViewModel row) return row.Element.SourceLocations.Count > 0; } - private static void JumpToCode(MethodComplexityRowViewModel row) + private void JumpToCode(MethodComplexityRowViewModel row) { - SourceLocationNavigator.Open(row.Element.SourceLocations[0]); + _messaging.Publish(new OpenSourceLocationRequest(row.Element.SourceLocations[0])); } } diff --git a/CSharpCodeAnalyst.Analyzers/Resources/Strings.Designer.cs b/CSharpCodeAnalyst.Analyzers/Resources/Strings.Designer.cs new file mode 100644 index 00000000..45bcbaaa --- /dev/null +++ b/CSharpCodeAnalyst.Analyzers/Resources/Strings.Designer.cs @@ -0,0 +1,653 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CSharpCodeAnalyst.Analyzers.Resources { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "18.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Strings { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Strings() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CSharpCodeAnalyst.Analyzers.Resources.Strings", typeof(Strings).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Architectural rules. + /// + public static string Analyzer_ArchitecturalRules_Label { + get { + return ResourceManager.GetString("Analyzer_ArchitecturalRules_Label", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No rule violations found!. + /// + public static string Analyzer_ArchitecturalRules_NoData { + get { + return ResourceManager.GetString("Analyzer_ArchitecturalRules_NoData", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error parsing rules: {0}. + /// + public static string Analyzer_ArchitecturalRules_ParseError { + get { + return ResourceManager.GetString("Analyzer_ArchitecturalRules_ParseError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Validates your architectural constraints based on user-defined rules. + /// + public static string Analyzer_ArchitecturalRules_Tooltip { + get { + return ResourceManager.GetString("Analyzer_ArchitecturalRules_Tooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Rule text cannot be empty. + /// + public static string Analyzer_Empty_Rule { + get { + return ResourceManager.GetString("Analyzer_Empty_Rule", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Event registrations. + /// + public static string Analyzer_EventRegistration_Label { + get { + return ResourceManager.GetString("Analyzer_EventRegistration_Label", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No event handler registration / un-registration imbalances found. + /// + public static string Analyzer_EventRegistration_NoData { + get { + return ResourceManager.GetString("Analyzer_EventRegistration_NoData", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Finds imbalances between number of event registrations / un-registrations. + /// + public static string Analyzer_EventRegistration_Tooltip { + get { + return ResourceManager.GetString("Analyzer_EventRegistration_Tooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Method Complexity. + /// + public static string Analyzer_MethodComplexity_Label { + get { + return ResourceManager.GetString("Analyzer_MethodComplexity_Label", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No source metrics available. Enable 'Collect source metrics on import' in the settings and re-import the solution.. + /// + public static string Analyzer_MethodComplexity_NoData { + get { + return ResourceManager.GetString("Analyzer_MethodComplexity_NoData", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Lines of code and cyclomatic complexity per method. Requires 'Collect source metrics on import' to be enabled before importing.. + /// + public static string Analyzer_MethodComplexity_Tooltip { + get { + return ResourceManager.GetString("Analyzer_MethodComplexity_Tooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type Cohesion. + /// + public static string Analyzer_TypeCohesion_Label { + get { + return ResourceManager.GetString("Analyzer_TypeCohesion_Label", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No classes with separable partitions found. + /// + public static string Analyzer_TypeCohesion_NoData { + get { + return ResourceManager.GetString("Analyzer_TypeCohesion_NoData", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Finds classes whose members split into independent groups (partitions) — candidates for splitting. Double-click a row to view its partitions.. + /// + public static string Analyzer_TypeCohesion_Tooltip { + get { + return ResourceManager.GetString("Analyzer_TypeCohesion_Tooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type Dependencies. + /// + public static string Analyzer_TypeDependencies_Label { + get { + return ResourceManager.GetString("Analyzer_TypeDependencies_Label", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No types found to rank. + /// + public static string Analyzer_TypeDependencies_NoData { + get { + return ResourceManager.GetString("Analyzer_TypeDependencies_NoData", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ranks types by their role in the dependency structure (fan-in, fan-out, importance). Helps you find the types to understand first.. + /// + public static string Analyzer_TypeDependencies_Tooltip { + get { + return ResourceManager.GetString("Analyzer_TypeDependencies_Tooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to clear all rules?. + /// + public static string ArchitecturalRules_ClearConfirm_Message { + get { + return ResourceManager.GetString("ArchitecturalRules_ClearConfirm_Message", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Confirm Clear. + /// + public static string ArchitecturalRules_ClearConfirm_Title { + get { + return ResourceManager.GetString("ArchitecturalRules_ClearConfirm_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Load rules. + /// + public static string ArchitecturalRules_LoadDialog_Title { + get { + return ResourceManager.GetString("ArchitecturalRules_LoadDialog_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error loading file: {0}. + /// + public static string ArchitecturalRules_LoadFileError_Message { + get { + return ResourceManager.GetString("ArchitecturalRules_LoadFileError_Message", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Save rules. + /// + public static string ArchitecturalRules_SaveDialog_Title { + get { + return ResourceManager.GetString("ArchitecturalRules_SaveDialog_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error saving file: {0}. + /// + public static string ArchitecturalRules_SaveFileError_Message { + get { + return ResourceManager.GetString("ArchitecturalRules_SaveFileError_Message", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Rules saved successfully!. + /// + public static string ArchitecturalRules_SaveFileSuccess_Message { + get { + return ResourceManager.GetString("ArchitecturalRules_SaveFileSuccess_Message", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Architectural rules configuration. + /// + public static string ArchitecturalRules_Title { + get { + return ResourceManager.GetString("ArchitecturalRules_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Three rules are supported: + /// + ///DENY: Forbids dependencies from source to target + ///RESTRICT: Allows only specified dependencies + ///ISOLATE: Completely isolates the source from external dependencies + /// + ///Patterns: + ///MyApp.Business → exact match + ///MyApp.Business.* → element + direct children + ///MyApp.Business.** → element + all descendants + /// + ///Examples: + ///DENY: MyApp.Business.** -> MyApp.Data.** + ///RESTRICT: MyApp.Controllers.** -> MyApp.Services.** + ///ISOLATE: MyApp.Domain.**. + /// + public static string ArchitectureRules_Info { + get { + return ResourceManager.GetString("ArchitectureRules_Info", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to _Close. + /// + public static string Close_Button { + get { + return ResourceManager.GetString("Close_Button", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to (!) Invalid relationship with missing elements.. + /// + public static string Cmd_InvalidRelationship { + get { + return ResourceManager.GetString("Cmd_InvalidRelationship", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No rule violations found.. + /// + public static string Cmd_NoRuleViolations { + get { + return ResourceManager.GetString("Cmd_NoRuleViolations", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to - Rule Type: {0}. + /// + public static string Cmd_RuleTypeLine { + get { + return ResourceManager.GetString("Cmd_RuleTypeLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Violations. + /// + public static string Cmd_ViolationsHeader { + get { + return ResourceManager.GetString("Cmd_ViolationsHeader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Rule Type. + /// + public static string Column_ArchitecturalRules_RuleType { + get { + return ResourceManager.GetString("Column_ArchitecturalRules_RuleType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Source. + /// + public static string Column_ArchitecturalRules_Source { + get { + return ResourceManager.GetString("Column_ArchitecturalRules_Source", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Target. + /// + public static string Column_ArchitecturalRules_Target { + get { + return ResourceManager.GetString("Column_ArchitecturalRules_Target", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Violations. + /// + public static string Column_ArchitecturalRules_Violations { + get { + return ResourceManager.GetString("Column_ArchitecturalRules_Violations", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Event handler (possible errors). + /// + public static string Column_EventRegistration_Header { + get { + return ResourceManager.GetString("Column_EventRegistration_Header", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Code. + /// + public static string Column_MethodComplexity_Code { + get { + return ResourceManager.GetString("Column_MethodComplexity_Code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Comment %. + /// + public static string Column_MethodComplexity_CommentRatio { + get { + return ResourceManager.GetString("Column_MethodComplexity_CommentRatio", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Comments. + /// + public static string Column_MethodComplexity_Comments { + get { + return ResourceManager.GetString("Column_MethodComplexity_Comments", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Complexity. + /// + public static string Column_MethodComplexity_Complexity { + get { + return ResourceManager.GetString("Column_MethodComplexity_Complexity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Method. + /// + public static string Column_MethodComplexity_Method { + get { + return ResourceManager.GetString("Column_MethodComplexity_Method", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Statements. + /// + public static string Column_MethodComplexity_Statements { + get { + return ResourceManager.GetString("Column_MethodComplexity_Statements", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Class. + /// + public static string Column_TypeCohesion_Class { + get { + return ResourceManager.GetString("Column_TypeCohesion_Class", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Largest %. + /// + public static string Column_TypeCohesion_LargestPartition { + get { + return ResourceManager.GetString("Column_TypeCohesion_LargestPartition", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Members. + /// + public static string Column_TypeCohesion_Members { + get { + return ResourceManager.GetString("Column_TypeCohesion_Members", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Partitions. + /// + public static string Column_TypeCohesion_Partitions { + get { + return ResourceManager.GetString("Column_TypeCohesion_Partitions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Blast radius. + /// + public static string Column_TypeDependencies_BlastRadius { + get { + return ResourceManager.GetString("Column_TypeDependencies_BlastRadius", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type. + /// + public static string Column_TypeDependencies_Element { + get { + return ResourceManager.GetString("Column_TypeDependencies_Element", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Fan-in. + /// + public static string Column_TypeDependencies_FanIn { + get { + return ResourceManager.GetString("Column_TypeDependencies_FanIn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Fan-out. + /// + public static string Column_TypeDependencies_FanOut { + get { + return ResourceManager.GetString("Column_TypeDependencies_FanOut", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to #. + /// + public static string Column_TypeDependencies_Rank { + get { + return ResourceManager.GetString("Column_TypeDependencies_Rank", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Score. + /// + public static string Column_TypeDependencies_Score { + get { + return ResourceManager.GetString("Column_TypeDependencies_Score", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show in Code Explorer. + /// + public static string CopyToExplorerGraph_MenuItem { + get { + return ResourceManager.GetString("CopyToExplorerGraph_MenuItem", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error. + /// + public static string Error_Title { + get { + return ResourceManager.GetString("Error_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Jump to code. + /// + public static string JumpToCode { + get { + return ResourceManager.GetString("JumpToCode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Operation failed: {0}. + /// + public static string OperationFailed_Message { + get { + return ResourceManager.GetString("OperationFailed_Message", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to _Clear. + /// + public static string Rules_Clear { + get { + return ResourceManager.GetString("Rules_Clear", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Define the architectural rules for your solution:. + /// + public static string Rules_Header { + get { + return ResourceManager.GetString("Rules_Header", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to _Load from file.... + /// + public static string Rules_LoadFromFile { + get { + return ResourceManager.GetString("Rules_LoadFromFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Rules definition. + /// + public static string Rules_RuleDefinition { + get { + return ResourceManager.GetString("Rules_RuleDefinition", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to _Save to file.... + /// + public static string Rules_SaveToFile { + get { + return ResourceManager.GetString("Rules_SaveToFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show partitions. + /// + public static string ShowPartitions { + get { + return ResourceManager.GetString("ShowPartitions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Success. + /// + public static string Success_Title { + get { + return ResourceManager.GetString("Success_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Save/_Validate. + /// + public static string Validate { + get { + return ResourceManager.GetString("Validate", resourceCulture); + } + } + } +} diff --git a/CSharpCodeAnalyst.Analyzers/Resources/Strings.resx b/CSharpCodeAnalyst.Analyzers/Resources/Strings.resx new file mode 100644 index 00000000..b2608a19 --- /dev/null +++ b/CSharpCodeAnalyst.Analyzers/Resources/Strings.resx @@ -0,0 +1,334 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + Error + + + Operation failed: {0} + + + _Close + + + Show in Code Explorer + + + Jump to code + + + + Architectural rules + + + Validates your architectural constraints based on user-defined rules + + + No rule violations found! + + + Error parsing rules: {0} + + + Event registrations + + + Finds imbalances between number of event registrations / un-registrations + + + No event handler registration / un-registration imbalances found + + + Type Dependencies + + + Ranks types by their role in the dependency structure (fan-in, fan-out, importance). Helps you find the types to understand first. + + + No types found to rank + + + Type Cohesion + + + Finds classes whose members split into independent groups (partitions) — candidates for splitting. Double-click a row to view its partitions. + + + No classes with separable partitions found + + + Method Complexity + + + Lines of code and cyclomatic complexity per method. Requires 'Collect source metrics on import' to be enabled before importing. + + + No source metrics available. Enable 'Collect source metrics on import' in the settings and re-import the solution. + + + Rule text cannot be empty + + + + Rule Type + + + Source + + + Target + + + Violations + + + Class + + + Partitions + + + Members + + + Largest % + + + Method + + + Code + + + Statements + + + Comments + + + Comment % + + + Complexity + + + # + + + Type + + + Fan-in + + + Fan-out + + + Blast radius + + + Score + + + Event handler (possible errors) + + + + Show partitions + + + Success + + + Save/_Validate + + + + No rule violations found. + + + Violations + + + - Rule Type: {0} + + + (!) Invalid relationship with missing elements. + + + + Architectural rules configuration + + + Define the architectural rules for your solution: + + + Rules definition + + + _Load from file... + + + _Save to file... + + + _Clear + + + Three rules are supported: + +DENY: Forbids dependencies from source to target +RESTRICT: Allows only specified dependencies +ISOLATE: Completely isolates the source from external dependencies + +Patterns: +MyApp.Business → exact match +MyApp.Business.* → element + direct children +MyApp.Business.** → element + all descendants + +Examples: +DENY: MyApp.Business.** -> MyApp.Data.** +RESTRICT: MyApp.Controllers.** -> MyApp.Services.** +ISOLATE: MyApp.Domain.** + + + Load rules + + + Save rules + + + Error loading file: {0} + + + Error saving file: {0} + + + Rules saved successfully! + + + Are you sure you want to clear all rules? + + + Confirm Clear + + diff --git a/CSharpCodeAnalyst/Features/Analyzers/TypeCohesion/Analyzer.cs b/CSharpCodeAnalyst.Analyzers/TypeCohesion/Analyzer.cs similarity index 68% rename from CSharpCodeAnalyst/Features/Analyzers/TypeCohesion/Analyzer.cs rename to CSharpCodeAnalyst.Analyzers/TypeCohesion/Analyzer.cs index 701471cc..ccf4c3ce 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/TypeCohesion/Analyzer.cs +++ b/CSharpCodeAnalyst.Analyzers/TypeCohesion/Analyzer.cs @@ -1,11 +1,11 @@ -using CodeGraph.Algorithms.Partitioning; -using CSharpCodeAnalyst.Features.Analyzers.TypeCohesion.Presentation; -using CSharpCodeAnalyst.Resources; -using CSharpCodeAnalyst.Shared.Contracts; -using CSharpCodeAnalyst.Shared.Messages; -using CSharpCodeAnalyst.Shared.UI; +using CSharpCodeAnalyst.Analyzers.TypeCohesion.Presentation; +using CSharpCodeAnalyst.Analyzers.Resources; +using CSharpCodeAnalyst.AnalyzerSdk.Contracts; +using CSharpCodeAnalyst.AnalyzerSdk.Messages; +using CSharpCodeAnalyst.AnalyzerSdk.Notifications; +using CSharpCodeAnalyst.CodeGraph.Algorithms.Partitioning; -namespace CSharpCodeAnalyst.Features.Analyzers.TypeCohesion; +namespace CSharpCodeAnalyst.Analyzers.TypeCohesion; /// /// Flags classes whose members fall into several independent groups (partitions) and are @@ -14,10 +14,12 @@ namespace CSharpCodeAnalyst.Features.Analyzers.TypeCohesion; public class Analyzer : IAnalyzer { private readonly IPublisher _messaging; + private readonly IUserNotification _userNotification; - public Analyzer(IPublisher messaging) + public Analyzer(IPublisher messaging, IUserNotification userNotification) { _messaging = messaging; + _userNotification = userNotification; } public string Id { get; } = "TypeCohesion"; @@ -30,7 +32,7 @@ public void Analyze(CodeGraph.Graph.CodeGraph graph) if (results.Count == 0) { - ToastManager.ShowInfo(Strings.Analyzer_TypeCohesion_NoData); + _userNotification.ShowSuccess(Strings.Analyzer_TypeCohesion_NoData); return; } diff --git a/CSharpCodeAnalyst/Features/Analyzers/TypeCohesion/Presentation/TypeCohesionRowViewModel.cs b/CSharpCodeAnalyst.Analyzers/TypeCohesion/Presentation/TypeCohesionRowViewModel.cs similarity index 78% rename from CSharpCodeAnalyst/Features/Analyzers/TypeCohesion/Presentation/TypeCohesionRowViewModel.cs rename to CSharpCodeAnalyst.Analyzers/TypeCohesion/Presentation/TypeCohesionRowViewModel.cs index d11365c6..b33134f6 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/TypeCohesion/Presentation/TypeCohesionRowViewModel.cs +++ b/CSharpCodeAnalyst.Analyzers/TypeCohesion/Presentation/TypeCohesionRowViewModel.cs @@ -1,9 +1,9 @@ using System.Globalization; -using CodeGraph.Algorithms.Partitioning; -using CodeGraph.Graph; -using CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; +using CSharpCodeAnalyst.AnalyzerSdk.DynamicDataGrid.Contracts.TabularData; +using CSharpCodeAnalyst.CodeGraph.Algorithms.Partitioning; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CSharpCodeAnalyst.Features.Analyzers.TypeCohesion.Presentation; +namespace CSharpCodeAnalyst.Analyzers.TypeCohesion.Presentation; public class TypeCohesionRowViewModel : TableRow { diff --git a/CSharpCodeAnalyst/Features/Analyzers/TypeCohesion/Presentation/TypeCohesionViewModel.cs b/CSharpCodeAnalyst.Analyzers/TypeCohesion/Presentation/TypeCohesionViewModel.cs similarity index 85% rename from CSharpCodeAnalyst/Features/Analyzers/TypeCohesion/Presentation/TypeCohesionViewModel.cs rename to CSharpCodeAnalyst.Analyzers/TypeCohesion/Presentation/TypeCohesionViewModel.cs index e351fc9e..15637991 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/TypeCohesion/Presentation/TypeCohesionViewModel.cs +++ b/CSharpCodeAnalyst.Analyzers/TypeCohesion/Presentation/TypeCohesionViewModel.cs @@ -1,15 +1,14 @@ using System.Collections.ObjectModel; using System.Windows; -using CodeGraph.Algorithms.Partitioning; -using CSharpCodeAnalyst.Resources; -using CSharpCodeAnalyst.Shared.Contracts; -using CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; -using CSharpCodeAnalyst.Shared.Messages; -using CSharpCodeAnalyst.Shared.Search; -using CSharpCodeAnalyst.Shared.Services; -using CSharpCodeAnalyst.Shared.Wpf; +using CSharpCodeAnalyst.Analyzers.Resources; +using CSharpCodeAnalyst.AnalyzerSdk.Contracts; +using CSharpCodeAnalyst.AnalyzerSdk.DynamicDataGrid.Contracts.TabularData; +using CSharpCodeAnalyst.AnalyzerSdk.Messages; +using CSharpCodeAnalyst.AnalyzerSdk.Search; +using CSharpCodeAnalyst.AnalyzerSdk.Wpf; +using CSharpCodeAnalyst.CodeGraph.Algorithms.Partitioning; -namespace CSharpCodeAnalyst.Features.Analyzers.TypeCohesion.Presentation; +namespace CSharpCodeAnalyst.Analyzers.TypeCohesion.Presentation; internal class TypeCohesionViewModel : Table { @@ -112,8 +111,8 @@ private static bool CanJumpToCode(TypeCohesionRowViewModel row) return row.Element.SourceLocations.Count > 0; } - private static void JumpToCode(TypeCohesionRowViewModel row) + private void JumpToCode(TypeCohesionRowViewModel row) { - SourceLocationNavigator.Open(row.Element.SourceLocations[0]); + _messaging.Publish(new OpenSourceLocationRequest(row.Element.SourceLocations[0])); } } diff --git a/CSharpCodeAnalyst/Features/Analyzers/TypeDependencies/Analyzer.cs b/CSharpCodeAnalyst.Analyzers/TypeDependencies/Analyzer.cs similarity index 68% rename from CSharpCodeAnalyst/Features/Analyzers/TypeDependencies/Analyzer.cs rename to CSharpCodeAnalyst.Analyzers/TypeDependencies/Analyzer.cs index bf924fa1..a9ca6fa5 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/TypeDependencies/Analyzer.cs +++ b/CSharpCodeAnalyst.Analyzers/TypeDependencies/Analyzer.cs @@ -1,11 +1,11 @@ -using CodeGraph.Algorithms.Metrics; -using CSharpCodeAnalyst.Features.Analyzers.TypeDependencies.Presentation; -using CSharpCodeAnalyst.Resources; -using CSharpCodeAnalyst.Shared.Contracts; -using CSharpCodeAnalyst.Shared.Messages; -using CSharpCodeAnalyst.Shared.UI; +using CSharpCodeAnalyst.Analyzers.TypeDependencies.Presentation; +using CSharpCodeAnalyst.Analyzers.Resources; +using CSharpCodeAnalyst.AnalyzerSdk.Contracts; +using CSharpCodeAnalyst.AnalyzerSdk.Messages; +using CSharpCodeAnalyst.AnalyzerSdk.Notifications; +using CSharpCodeAnalyst.CodeGraph.Algorithms.Metrics; -namespace CSharpCodeAnalyst.Features.Analyzers.TypeDependencies; +namespace CSharpCodeAnalyst.Analyzers.TypeDependencies; /// /// Describes how each type sits in the dependency structure (fan-in, fan-out, blast radius and @@ -14,10 +14,12 @@ namespace CSharpCodeAnalyst.Features.Analyzers.TypeDependencies; public class Analyzer : IAnalyzer { private readonly IPublisher _messaging; + private readonly IUserNotification _userNotification; - public Analyzer(IPublisher messaging) + public Analyzer(IPublisher messaging, IUserNotification userNotification) { _messaging = messaging; + _userNotification = userNotification; } public string Id { get; } = "TypeDependencies"; @@ -30,7 +32,7 @@ public void Analyze(CodeGraph.Graph.CodeGraph graph) if (results.Count == 0) { - ToastManager.ShowInfo(Strings.Analyzer_TypeDependencies_NoData); + _userNotification.ShowSuccess(Strings.Analyzer_TypeDependencies_NoData); return; } diff --git a/CSharpCodeAnalyst/Features/Analyzers/TypeDependencies/Presentation/TypeDependenciesViewModel.cs b/CSharpCodeAnalyst.Analyzers/TypeDependencies/Presentation/TypeDependenciesViewModel.cs similarity index 87% rename from CSharpCodeAnalyst/Features/Analyzers/TypeDependencies/Presentation/TypeDependenciesViewModel.cs rename to CSharpCodeAnalyst.Analyzers/TypeDependencies/Presentation/TypeDependenciesViewModel.cs index 9000e89d..a33e4232 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/TypeDependencies/Presentation/TypeDependenciesViewModel.cs +++ b/CSharpCodeAnalyst.Analyzers/TypeDependencies/Presentation/TypeDependenciesViewModel.cs @@ -1,15 +1,14 @@ using System.Collections.ObjectModel; using System.Windows; -using CodeGraph.Algorithms.Metrics; -using CSharpCodeAnalyst.Resources; -using CSharpCodeAnalyst.Shared.Contracts; -using CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; -using CSharpCodeAnalyst.Shared.Messages; -using CSharpCodeAnalyst.Shared.Search; -using CSharpCodeAnalyst.Shared.Services; -using CSharpCodeAnalyst.Shared.Wpf; +using CSharpCodeAnalyst.Analyzers.Resources; +using CSharpCodeAnalyst.AnalyzerSdk.Contracts; +using CSharpCodeAnalyst.AnalyzerSdk.DynamicDataGrid.Contracts.TabularData; +using CSharpCodeAnalyst.AnalyzerSdk.Messages; +using CSharpCodeAnalyst.AnalyzerSdk.Search; +using CSharpCodeAnalyst.AnalyzerSdk.Wpf; +using CSharpCodeAnalyst.CodeGraph.Algorithms.Metrics; -namespace CSharpCodeAnalyst.Features.Analyzers.TypeDependencies.Presentation; +namespace CSharpCodeAnalyst.Analyzers.TypeDependencies.Presentation; internal class TypeDependenciesViewModel : Table { @@ -130,8 +129,8 @@ private static bool CanJumpToCode(TypeDependencyViewModel row) return row.Element.SourceLocations.Count > 0; } - private static void JumpToCode(TypeDependencyViewModel row) + private void JumpToCode(TypeDependencyViewModel row) { - SourceLocationNavigator.Open(row.Element.SourceLocations[0]); + _messaging.Publish(new OpenSourceLocationRequest(row.Element.SourceLocations[0])); } } diff --git a/CSharpCodeAnalyst/Features/Analyzers/TypeDependencies/Presentation/TypeDependencyViewModel.cs b/CSharpCodeAnalyst.Analyzers/TypeDependencies/Presentation/TypeDependencyViewModel.cs similarity index 79% rename from CSharpCodeAnalyst/Features/Analyzers/TypeDependencies/Presentation/TypeDependencyViewModel.cs rename to CSharpCodeAnalyst.Analyzers/TypeDependencies/Presentation/TypeDependencyViewModel.cs index 3a69bd55..76219e63 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/TypeDependencies/Presentation/TypeDependencyViewModel.cs +++ b/CSharpCodeAnalyst.Analyzers/TypeDependencies/Presentation/TypeDependencyViewModel.cs @@ -1,9 +1,9 @@ using System.Globalization; -using CodeGraph.Algorithms.Metrics; -using CodeGraph.Graph; -using CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; +using CSharpCodeAnalyst.AnalyzerSdk.DynamicDataGrid.Contracts.TabularData; +using CSharpCodeAnalyst.CodeGraph.Algorithms.Metrics; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CSharpCodeAnalyst.Features.Analyzers.TypeDependencies.Presentation; +namespace CSharpCodeAnalyst.Analyzers.TypeDependencies.Presentation; public class TypeDependencyViewModel : TableRow { diff --git a/CodeGraph/Algorithms/Cycles/CodeElementClassifier.cs b/CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/CodeElementClassifier.cs similarity index 86% rename from CodeGraph/Algorithms/Cycles/CodeElementClassifier.cs rename to CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/CodeElementClassifier.cs index cda1d137..df19a8fd 100644 --- a/CodeGraph/Algorithms/Cycles/CodeElementClassifier.cs +++ b/CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/CodeElementClassifier.cs @@ -1,6 +1,6 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CodeGraph.Algorithms.Cycles; +namespace CSharpCodeAnalyst.CodeGraph.Algorithms.Cycles; public static class CodeElementClassifier { diff --git a/CodeGraph/Algorithms/Cycles/CodeGraphBuilder.cs b/CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/CodeGraphBuilder.cs similarity index 98% rename from CodeGraph/Algorithms/Cycles/CodeGraphBuilder.cs rename to CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/CodeGraphBuilder.cs index 5e2e5f37..bc6632f1 100644 --- a/CodeGraph/Algorithms/Cycles/CodeGraphBuilder.cs +++ b/CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/CodeGraphBuilder.cs @@ -1,6 +1,6 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CodeGraph.Algorithms.Cycles; +namespace CSharpCodeAnalyst.CodeGraph.Algorithms.Cycles; public static class CodeGraphBuilder { diff --git a/CodeGraph/Algorithms/Cycles/CycleFinder.cs b/CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/CycleFinder.cs similarity index 95% rename from CodeGraph/Algorithms/Cycles/CycleFinder.cs rename to CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/CycleFinder.cs index 3b213d58..271471f3 100644 --- a/CodeGraph/Algorithms/Cycles/CycleFinder.cs +++ b/CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/CycleFinder.cs @@ -1,4 +1,4 @@ -namespace CodeGraph.Algorithms.Cycles; +namespace CSharpCodeAnalyst.CodeGraph.Algorithms.Cycles; public static class CycleFinder { diff --git a/CodeGraph/Algorithms/Cycles/CycleGroup.cs b/CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/CycleGroup.cs similarity index 73% rename from CodeGraph/Algorithms/Cycles/CycleGroup.cs rename to CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/CycleGroup.cs index 99e60c96..68277fea 100644 --- a/CodeGraph/Algorithms/Cycles/CycleGroup.cs +++ b/CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/CycleGroup.cs @@ -1,4 +1,4 @@ -namespace CodeGraph.Algorithms.Cycles; +namespace CSharpCodeAnalyst.CodeGraph.Algorithms.Cycles; public class CycleGroup(Graph.CodeGraph codeGraph) { diff --git a/CodeGraph/Algorithms/Cycles/IncompleteLogicException.cs b/CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/IncompleteLogicException.cs similarity index 84% rename from CodeGraph/Algorithms/Cycles/IncompleteLogicException.cs rename to CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/IncompleteLogicException.cs index 081241c0..d56b24a4 100644 --- a/CodeGraph/Algorithms/Cycles/IncompleteLogicException.cs +++ b/CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/IncompleteLogicException.cs @@ -1,4 +1,4 @@ -namespace CodeGraph.Algorithms.Cycles; +namespace CSharpCodeAnalyst.CodeGraph.Algorithms.Cycles; [Serializable] internal class IncompleteLogicException : Exception diff --git a/CodeGraph/Algorithms/Cycles/RelationshipClassifier.cs b/CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/RelationshipClassifier.cs similarity index 95% rename from CodeGraph/Algorithms/Cycles/RelationshipClassifier.cs rename to CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/RelationshipClassifier.cs index da92ff02..4ee7796d 100644 --- a/CodeGraph/Algorithms/Cycles/RelationshipClassifier.cs +++ b/CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/RelationshipClassifier.cs @@ -1,6 +1,6 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CodeGraph.Algorithms.Cycles; +namespace CSharpCodeAnalyst.CodeGraph.Algorithms.Cycles; public static class RelationshipClassifier { diff --git a/CodeGraph/Algorithms/Cycles/SearchGraph.cs b/CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/SearchGraph.cs similarity index 87% rename from CodeGraph/Algorithms/Cycles/SearchGraph.cs rename to CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/SearchGraph.cs index 02f374fd..76ad9657 100644 --- a/CodeGraph/Algorithms/Cycles/SearchGraph.cs +++ b/CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/SearchGraph.cs @@ -1,6 +1,6 @@ -using CodeGraph.Contracts; +using CSharpCodeAnalyst.CodeGraph.Contracts; -namespace CodeGraph.Algorithms.Cycles; +namespace CSharpCodeAnalyst.CodeGraph.Algorithms.Cycles; public class SearchGraph : IGraphRepresentation { diff --git a/CodeGraph/Algorithms/Cycles/SearchGraphBuilder.cs b/CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/SearchGraphBuilder.cs similarity index 98% rename from CodeGraph/Algorithms/Cycles/SearchGraphBuilder.cs rename to CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/SearchGraphBuilder.cs index a123335b..2ec596b1 100644 --- a/CodeGraph/Algorithms/Cycles/SearchGraphBuilder.cs +++ b/CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/SearchGraphBuilder.cs @@ -1,6 +1,6 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CodeGraph.Algorithms.Cycles; +namespace CSharpCodeAnalyst.CodeGraph.Algorithms.Cycles; public static class SearchGraphBuilder { diff --git a/CodeGraph/Algorithms/Cycles/SearchNode.cs b/CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/SearchNode.cs similarity index 80% rename from CodeGraph/Algorithms/Cycles/SearchNode.cs rename to CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/SearchNode.cs index 1285d2a2..61e44324 100644 --- a/CodeGraph/Algorithms/Cycles/SearchNode.cs +++ b/CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/SearchNode.cs @@ -1,9 +1,9 @@ using System.Diagnostics; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; // ReSharper disable NotResolvedInText -namespace CodeGraph.Algorithms.Cycles; +namespace CSharpCodeAnalyst.CodeGraph.Algorithms.Cycles; [DebuggerDisplay("{OriginalElement.ElementType}: {OriginalElement.Name}")] public class SearchNode(string id, CodeElement originalElement) diff --git a/CodeGraph/Algorithms/Cycles/SearchNodeComparer.cs b/CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/SearchNodeComparer.cs similarity index 87% rename from CodeGraph/Algorithms/Cycles/SearchNodeComparer.cs rename to CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/SearchNodeComparer.cs index a84f1578..6dc4674b 100644 --- a/CodeGraph/Algorithms/Cycles/SearchNodeComparer.cs +++ b/CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/SearchNodeComparer.cs @@ -1,6 +1,6 @@ using System.Runtime.CompilerServices; -namespace CodeGraph.Algorithms.Cycles; +namespace CSharpCodeAnalyst.CodeGraph.Algorithms.Cycles; public class SearchNodeComparer : IEqualityComparer { diff --git a/CodeGraph/Algorithms/Cycles/Tarjan.cs b/CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/Tarjan.cs similarity index 95% rename from CodeGraph/Algorithms/Cycles/Tarjan.cs rename to CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/Tarjan.cs index 8413097a..3a3840de 100644 --- a/CodeGraph/Algorithms/Cycles/Tarjan.cs +++ b/CSharpCodeAnalyst.CodeGraph/Algorithms/Cycles/Tarjan.cs @@ -1,6 +1,6 @@ -using CodeGraph.Contracts; +using CSharpCodeAnalyst.CodeGraph.Contracts; -namespace CodeGraph.Algorithms.Cycles; +namespace CSharpCodeAnalyst.CodeGraph.Algorithms.Cycles; /// /// Returns the strongly connected components. diff --git a/CodeGraph/Algorithms/Metrics/DependencyMetrics.cs b/CSharpCodeAnalyst.CodeGraph/Algorithms/Metrics/DependencyMetrics.cs similarity index 89% rename from CodeGraph/Algorithms/Metrics/DependencyMetrics.cs rename to CSharpCodeAnalyst.CodeGraph/Algorithms/Metrics/DependencyMetrics.cs index 4ccd61ff..75e781c3 100644 --- a/CodeGraph/Algorithms/Metrics/DependencyMetrics.cs +++ b/CSharpCodeAnalyst.CodeGraph/Algorithms/Metrics/DependencyMetrics.cs @@ -1,6 +1,6 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CodeGraph.Algorithms.Metrics; +namespace CSharpCodeAnalyst.CodeGraph.Algorithms.Metrics; public class InOutDegree(CodeElement element) { diff --git a/CodeGraph/Algorithms/Metrics/TypeDependencyAnalysis.cs b/CSharpCodeAnalyst.CodeGraph/Algorithms/Metrics/TypeDependencyAnalysis.cs similarity index 98% rename from CodeGraph/Algorithms/Metrics/TypeDependencyAnalysis.cs rename to CSharpCodeAnalyst.CodeGraph/Algorithms/Metrics/TypeDependencyAnalysis.cs index 8c4ad391..e73af1ed 100644 --- a/CodeGraph/Algorithms/Metrics/TypeDependencyAnalysis.cs +++ b/CSharpCodeAnalyst.CodeGraph/Algorithms/Metrics/TypeDependencyAnalysis.cs @@ -1,6 +1,6 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CodeGraph.Algorithms.Metrics; +namespace CSharpCodeAnalyst.CodeGraph.Algorithms.Metrics; /// /// One row of the type-dependency result: a type with its coupling degrees, its change impact diff --git a/CodeGraph/Algorithms/Partitioning/CodeElementPartitioner.cs b/CSharpCodeAnalyst.CodeGraph/Algorithms/Partitioning/CodeElementPartitioner.cs similarity index 98% rename from CodeGraph/Algorithms/Partitioning/CodeElementPartitioner.cs rename to CSharpCodeAnalyst.CodeGraph/Algorithms/Partitioning/CodeElementPartitioner.cs index 113367e4..54463390 100644 --- a/CodeGraph/Algorithms/Partitioning/CodeElementPartitioner.cs +++ b/CSharpCodeAnalyst.CodeGraph/Algorithms/Partitioning/CodeElementPartitioner.cs @@ -1,6 +1,6 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CodeGraph.Algorithms.Partitioning; +namespace CSharpCodeAnalyst.CodeGraph.Algorithms.Partitioning; /// /// Finds disjunct partitions of code elements that are related to each other. diff --git a/CodeGraph/Algorithms/Partitioning/TypeCohesionAnalysis.cs b/CSharpCodeAnalyst.CodeGraph/Algorithms/Partitioning/TypeCohesionAnalysis.cs similarity index 97% rename from CodeGraph/Algorithms/Partitioning/TypeCohesionAnalysis.cs rename to CSharpCodeAnalyst.CodeGraph/Algorithms/Partitioning/TypeCohesionAnalysis.cs index 33e6b093..c5bc529d 100644 --- a/CodeGraph/Algorithms/Partitioning/TypeCohesionAnalysis.cs +++ b/CSharpCodeAnalyst.CodeGraph/Algorithms/Partitioning/TypeCohesionAnalysis.cs @@ -1,6 +1,6 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CodeGraph.Algorithms.Partitioning; +namespace CSharpCodeAnalyst.CodeGraph.Algorithms.Partitioning; /// /// One row of the cohesion result: a class that decomposes into several independent member diff --git a/CodeGraph/CodeGraph.csproj b/CSharpCodeAnalyst.CodeGraph/CSharpCodeAnalyst.CodeGraph.csproj similarity index 83% rename from CodeGraph/CodeGraph.csproj rename to CSharpCodeAnalyst.CodeGraph/CSharpCodeAnalyst.CodeGraph.csproj index 8c076cd6..dee8658c 100644 --- a/CodeGraph/CodeGraph.csproj +++ b/CSharpCodeAnalyst.CodeGraph/CSharpCodeAnalyst.CodeGraph.csproj @@ -4,7 +4,7 @@ net10.0.0 enable enable - CodeGraph + CSharpCodeAnalyst.CodeGraph diff --git a/CodeGraph/Colors/ColorDefinitions.cs b/CSharpCodeAnalyst.CodeGraph/Colors/ColorDefinitions.cs similarity index 95% rename from CodeGraph/Colors/ColorDefinitions.cs rename to CSharpCodeAnalyst.CodeGraph/Colors/ColorDefinitions.cs index 8f1ee85f..9c1281d7 100644 --- a/CodeGraph/Colors/ColorDefinitions.cs +++ b/CSharpCodeAnalyst.CodeGraph/Colors/ColorDefinitions.cs @@ -1,6 +1,6 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CodeGraph.Colors; +namespace CSharpCodeAnalyst.CodeGraph.Colors; public static class ColorDefinitions { diff --git a/CodeGraph/Contracts/ICodeGraphExplorer.cs b/CSharpCodeAnalyst.CodeGraph/Contracts/ICodeGraphExplorer.cs similarity index 95% rename from CodeGraph/Contracts/ICodeGraphExplorer.cs rename to CSharpCodeAnalyst.CodeGraph/Contracts/ICodeGraphExplorer.cs index 7ca34a7d..79819d0e 100644 --- a/CodeGraph/Contracts/ICodeGraphExplorer.cs +++ b/CSharpCodeAnalyst.CodeGraph/Contracts/ICodeGraphExplorer.cs @@ -1,7 +1,7 @@ -using CodeGraph.Exploration; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Exploration; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CodeGraph.Contracts; +namespace CSharpCodeAnalyst.CodeGraph.Contracts; public interface ICodeGraphExplorer { diff --git a/CodeGraph/Contracts/IGraphRepresentation.cs b/CSharpCodeAnalyst.CodeGraph/Contracts/IGraphRepresentation.cs similarity index 84% rename from CodeGraph/Contracts/IGraphRepresentation.cs rename to CSharpCodeAnalyst.CodeGraph/Contracts/IGraphRepresentation.cs index 28d85ac2..7fa1e05b 100644 --- a/CodeGraph/Contracts/IGraphRepresentation.cs +++ b/CSharpCodeAnalyst.CodeGraph/Contracts/IGraphRepresentation.cs @@ -1,4 +1,4 @@ -namespace CodeGraph.Contracts; +namespace CSharpCodeAnalyst.CodeGraph.Contracts; public interface IGraphRepresentation { diff --git a/CodeGraph/Contracts/IParserDiagnostics.cs b/CSharpCodeAnalyst.CodeGraph/Contracts/IParserDiagnostics.cs similarity index 79% rename from CodeGraph/Contracts/IParserDiagnostics.cs rename to CSharpCodeAnalyst.CodeGraph/Contracts/IParserDiagnostics.cs index a2ec5200..96028eac 100644 --- a/CodeGraph/Contracts/IParserDiagnostics.cs +++ b/CSharpCodeAnalyst.CodeGraph/Contracts/IParserDiagnostics.cs @@ -1,4 +1,4 @@ -namespace CodeGraph.Contracts; +namespace CSharpCodeAnalyst.CodeGraph.Contracts; public interface IParserDiagnostics { diff --git a/CodeGraph/Contracts/IProgress.cs b/CSharpCodeAnalyst.CodeGraph/Contracts/IProgress.cs similarity index 63% rename from CodeGraph/Contracts/IProgress.cs rename to CSharpCodeAnalyst.CodeGraph/Contracts/IProgress.cs index d8e08471..a4f4a419 100644 --- a/CodeGraph/Contracts/IProgress.cs +++ b/CSharpCodeAnalyst.CodeGraph/Contracts/IProgress.cs @@ -1,4 +1,4 @@ -namespace CodeGraph.Contracts; +namespace CSharpCodeAnalyst.CodeGraph.Contracts; public interface IProgress { diff --git a/CodeGraph/Contracts/ParserProgressArg.cs b/CSharpCodeAnalyst.CodeGraph/Contracts/ParserProgressArg.cs similarity index 67% rename from CodeGraph/Contracts/ParserProgressArg.cs rename to CSharpCodeAnalyst.CodeGraph/Contracts/ParserProgressArg.cs index f27639d1..676a634c 100644 --- a/CodeGraph/Contracts/ParserProgressArg.cs +++ b/CSharpCodeAnalyst.CodeGraph/Contracts/ParserProgressArg.cs @@ -1,4 +1,4 @@ -namespace CodeGraph.Contracts; +namespace CSharpCodeAnalyst.CodeGraph.Contracts; public class ParserProgressArg(string message) : EventArgs { diff --git a/CodeGraph/Exploration/CodeGraphExplorer.cs b/CSharpCodeAnalyst.CodeGraph/Exploration/CodeGraphExplorer.cs similarity index 99% rename from CodeGraph/Exploration/CodeGraphExplorer.cs rename to CSharpCodeAnalyst.CodeGraph/Exploration/CodeGraphExplorer.cs index 400bff38..c6451814 100644 --- a/CodeGraph/Exploration/CodeGraphExplorer.cs +++ b/CSharpCodeAnalyst.CodeGraph/Exploration/CodeGraphExplorer.cs @@ -1,9 +1,9 @@ -using CodeGraph.Algorithms.Cycles; -using CodeGraph.Contracts; -using CodeGraph.Graph; -using System.Diagnostics; +using System.Diagnostics; +using CSharpCodeAnalyst.CodeGraph.Algorithms.Cycles; +using CSharpCodeAnalyst.CodeGraph.Contracts; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CodeGraph.Exploration; +namespace CSharpCodeAnalyst.CodeGraph.Exploration; public class CodeGraphExplorer : ICodeGraphExplorer { diff --git a/CodeGraph/Exploration/Context.cs b/CSharpCodeAnalyst.CodeGraph/Exploration/Context.cs similarity index 93% rename from CodeGraph/Exploration/Context.cs rename to CSharpCodeAnalyst.CodeGraph/Exploration/Context.cs index 35f0f002..ded7bab7 100644 --- a/CodeGraph/Exploration/Context.cs +++ b/CSharpCodeAnalyst.CodeGraph/Exploration/Context.cs @@ -1,6 +1,6 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CodeGraph.Exploration; +namespace CSharpCodeAnalyst.CodeGraph.Exploration; internal class Context(Graph.CodeGraph codeGraph) { diff --git a/CodeGraph/Export/CodeGraphSerializer.cs b/CSharpCodeAnalyst.CodeGraph/Export/CodeGraphSerializer.cs similarity index 99% rename from CodeGraph/Export/CodeGraphSerializer.cs rename to CSharpCodeAnalyst.CodeGraph/Export/CodeGraphSerializer.cs index b8dd431c..30053320 100644 --- a/CodeGraph/Export/CodeGraphSerializer.cs +++ b/CSharpCodeAnalyst.CodeGraph/Export/CodeGraphSerializer.cs @@ -1,7 +1,7 @@ using System.Text; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CodeGraph.Export; +namespace CSharpCodeAnalyst.CodeGraph.Export; /// /// Serializes and deserializes CodeGraph to/from a human-readable text format. diff --git a/CodeGraph/Export/DgmlExport.cs b/CSharpCodeAnalyst.CodeGraph/Export/DgmlExport.cs similarity index 95% rename from CodeGraph/Export/DgmlExport.cs rename to CSharpCodeAnalyst.CodeGraph/Export/DgmlExport.cs index 18d495c6..2b824b53 100644 --- a/CodeGraph/Export/DgmlExport.cs +++ b/CSharpCodeAnalyst.CodeGraph/Export/DgmlExport.cs @@ -1,7 +1,7 @@ -using CodeGraph.Colors; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Colors; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CodeGraph.Export; +namespace CSharpCodeAnalyst.CodeGraph.Export; public static class DgmlExport { diff --git a/CodeGraph/Export/DgmlFileBuilder.cs b/CSharpCodeAnalyst.CodeGraph/Export/DgmlFileBuilder.cs similarity index 99% rename from CodeGraph/Export/DgmlFileBuilder.cs rename to CSharpCodeAnalyst.CodeGraph/Export/DgmlFileBuilder.cs index b097edec..ee2faa5b 100644 --- a/CodeGraph/Export/DgmlFileBuilder.cs +++ b/CSharpCodeAnalyst.CodeGraph/Export/DgmlFileBuilder.cs @@ -1,6 +1,6 @@ using System.Xml; -namespace CodeGraph.Export; +namespace CSharpCodeAnalyst.CodeGraph.Export; /// /// Builder class to create a directed graph file to be processed with Visual Studio's diff --git a/CodeGraph/Export/DgmlHierarchyExport.cs b/CSharpCodeAnalyst.CodeGraph/Export/DgmlHierarchyExport.cs similarity index 92% rename from CodeGraph/Export/DgmlHierarchyExport.cs rename to CSharpCodeAnalyst.CodeGraph/Export/DgmlHierarchyExport.cs index c095ca48..56953246 100644 --- a/CodeGraph/Export/DgmlHierarchyExport.cs +++ b/CSharpCodeAnalyst.CodeGraph/Export/DgmlHierarchyExport.cs @@ -1,7 +1,7 @@ -using CodeGraph.Colors; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Colors; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CodeGraph.Export; +namespace CSharpCodeAnalyst.CodeGraph.Export; /// /// Debug class to export the hierarchy of a code graph to a dgml file. diff --git a/CodeGraph/Export/DgmlRelationshipExport.cs b/CSharpCodeAnalyst.CodeGraph/Export/DgmlRelationshipExport.cs similarity index 94% rename from CodeGraph/Export/DgmlRelationshipExport.cs rename to CSharpCodeAnalyst.CodeGraph/Export/DgmlRelationshipExport.cs index 101cc2f9..dafa9900 100644 --- a/CodeGraph/Export/DgmlRelationshipExport.cs +++ b/CSharpCodeAnalyst.CodeGraph/Export/DgmlRelationshipExport.cs @@ -1,7 +1,7 @@ -using CodeGraph.Colors; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Colors; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CodeGraph.Export; +namespace CSharpCodeAnalyst.CodeGraph.Export; /// /// Debug class to export the relationship information of a code graph to a dgml file. diff --git a/CodeGraph/Export/DsiExport.cs b/CSharpCodeAnalyst.CodeGraph/Export/DsiExport.cs similarity index 97% rename from CodeGraph/Export/DsiExport.cs rename to CSharpCodeAnalyst.CodeGraph/Export/DsiExport.cs index 8c4bb2ea..c756b292 100644 --- a/CodeGraph/Export/DsiExport.cs +++ b/CSharpCodeAnalyst.CodeGraph/Export/DsiExport.cs @@ -1,6 +1,6 @@ using System.Xml.Linq; -namespace CodeGraph.Export; +namespace CSharpCodeAnalyst.CodeGraph.Export; public static class DsiExport { diff --git a/CodeGraph/Export/PlantUmlExport.cs b/CSharpCodeAnalyst.CodeGraph/Export/PlantUmlExport.cs similarity index 99% rename from CodeGraph/Export/PlantUmlExport.cs rename to CSharpCodeAnalyst.CodeGraph/Export/PlantUmlExport.cs index f44ca257..c38f9567 100644 --- a/CodeGraph/Export/PlantUmlExport.cs +++ b/CSharpCodeAnalyst.CodeGraph/Export/PlantUmlExport.cs @@ -1,7 +1,7 @@ using System.Text; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; -namespace CodeGraph.Export; +namespace CSharpCodeAnalyst.CodeGraph.Export; /// /// Exports a CodeGraph to PlantUML syntax. diff --git a/CodeGraph/Graph/CodeElement.cs b/CSharpCodeAnalyst.CodeGraph/Graph/CodeElement.cs similarity index 99% rename from CodeGraph/Graph/CodeElement.cs rename to CSharpCodeAnalyst.CodeGraph/Graph/CodeElement.cs index d1e73171..b16709ed 100644 --- a/CodeGraph/Graph/CodeElement.cs +++ b/CSharpCodeAnalyst.CodeGraph/Graph/CodeElement.cs @@ -1,6 +1,6 @@ using System.Diagnostics; -namespace CodeGraph.Graph; +namespace CSharpCodeAnalyst.CodeGraph.Graph; [DebuggerDisplay("{ElementType}: {Name} {(IsExternal ? \"(External)\" : \"\")}")] public class CodeElement(string id, CodeElementType elementType, string name, string fullName, CodeElement? parent) diff --git a/CodeGraph/Graph/CodeElementType.cs b/CSharpCodeAnalyst.CodeGraph/Graph/CodeElementType.cs similarity index 90% rename from CodeGraph/Graph/CodeElementType.cs rename to CSharpCodeAnalyst.CodeGraph/Graph/CodeElementType.cs index 4dfa67d6..81144a7b 100644 --- a/CodeGraph/Graph/CodeElementType.cs +++ b/CSharpCodeAnalyst.CodeGraph/Graph/CodeElementType.cs @@ -1,4 +1,4 @@ -namespace CodeGraph.Graph; +namespace CSharpCodeAnalyst.CodeGraph.Graph; public enum CodeElementType { diff --git a/CodeGraph/Graph/CodeGraph.cs b/CSharpCodeAnalyst.CodeGraph/Graph/CodeGraph.cs similarity index 98% rename from CodeGraph/Graph/CodeGraph.cs rename to CSharpCodeAnalyst.CodeGraph/Graph/CodeGraph.cs index a355cc45..1b3e7671 100644 --- a/CodeGraph/Graph/CodeGraph.cs +++ b/CSharpCodeAnalyst.CodeGraph/Graph/CodeGraph.cs @@ -1,6 +1,6 @@ -using CodeGraph.Contracts; +using CSharpCodeAnalyst.CodeGraph.Contracts; -namespace CodeGraph.Graph; +namespace CSharpCodeAnalyst.CodeGraph.Graph; public record IntegrationResult(CodeElement CodeElement, bool IsAdded); diff --git a/CodeGraph/Graph/CodeGraphExtensions.cs b/CSharpCodeAnalyst.CodeGraph/Graph/CodeGraphExtensions.cs similarity index 98% rename from CodeGraph/Graph/CodeGraphExtensions.cs rename to CSharpCodeAnalyst.CodeGraph/Graph/CodeGraphExtensions.cs index 91bb6ce0..8edf5112 100644 --- a/CodeGraph/Graph/CodeGraphExtensions.cs +++ b/CSharpCodeAnalyst.CodeGraph/Graph/CodeGraphExtensions.cs @@ -1,4 +1,4 @@ -namespace CodeGraph.Graph; +namespace CSharpCodeAnalyst.CodeGraph.Graph; /// /// Set of basic algorithms to build for higher algorithms diff --git a/CodeGraph/Graph/Relationship.cs b/CSharpCodeAnalyst.CodeGraph/Graph/Relationship.cs similarity index 98% rename from CodeGraph/Graph/Relationship.cs rename to CSharpCodeAnalyst.CodeGraph/Graph/Relationship.cs index c9a8ef8b..5069d9f9 100644 --- a/CodeGraph/Graph/Relationship.cs +++ b/CSharpCodeAnalyst.CodeGraph/Graph/Relationship.cs @@ -1,7 +1,7 @@ using System.Diagnostics; using System.Text.Json.Serialization; -namespace CodeGraph.Graph; +namespace CSharpCodeAnalyst.CodeGraph.Graph; [DebuggerDisplay("{Type}")] public class Relationship diff --git a/CodeGraph/Graph/RelationshipAttribute.cs b/CSharpCodeAnalyst.CodeGraph/Graph/RelationshipAttribute.cs similarity index 95% rename from CodeGraph/Graph/RelationshipAttribute.cs rename to CSharpCodeAnalyst.CodeGraph/Graph/RelationshipAttribute.cs index 5b4cf3e7..93a9fc5e 100644 --- a/CodeGraph/Graph/RelationshipAttribute.cs +++ b/CSharpCodeAnalyst.CodeGraph/Graph/RelationshipAttribute.cs @@ -1,4 +1,4 @@ -namespace CodeGraph.Graph; +namespace CSharpCodeAnalyst.CodeGraph.Graph; [Flags] public enum RelationshipAttribute : uint diff --git a/CodeGraph/Graph/RelationshipType.cs b/CSharpCodeAnalyst.CodeGraph/Graph/RelationshipType.cs similarity index 92% rename from CodeGraph/Graph/RelationshipType.cs rename to CSharpCodeAnalyst.CodeGraph/Graph/RelationshipType.cs index 9433f89f..8d81238f 100644 --- a/CodeGraph/Graph/RelationshipType.cs +++ b/CSharpCodeAnalyst.CodeGraph/Graph/RelationshipType.cs @@ -1,4 +1,4 @@ -namespace CodeGraph.Graph; +namespace CSharpCodeAnalyst.CodeGraph.Graph; public enum RelationshipType { diff --git a/CodeGraph/Graph/RelationshipTypeExtensions.cs b/CSharpCodeAnalyst.CodeGraph/Graph/RelationshipTypeExtensions.cs similarity index 96% rename from CodeGraph/Graph/RelationshipTypeExtensions.cs rename to CSharpCodeAnalyst.CodeGraph/Graph/RelationshipTypeExtensions.cs index c186a4e2..40a41f82 100644 --- a/CodeGraph/Graph/RelationshipTypeExtensions.cs +++ b/CSharpCodeAnalyst.CodeGraph/Graph/RelationshipTypeExtensions.cs @@ -1,4 +1,4 @@ -namespace CodeGraph.Graph; +namespace CSharpCodeAnalyst.CodeGraph.Graph; public static class RelationshipTypeExtensions { diff --git a/CodeGraph/Graph/SourceLocation.cs b/CSharpCodeAnalyst.CodeGraph/Graph/SourceLocation.cs similarity index 94% rename from CodeGraph/Graph/SourceLocation.cs rename to CSharpCodeAnalyst.CodeGraph/Graph/SourceLocation.cs index aa50bd91..76c28f2c 100644 --- a/CodeGraph/Graph/SourceLocation.cs +++ b/CSharpCodeAnalyst.CodeGraph/Graph/SourceLocation.cs @@ -1,4 +1,4 @@ -namespace CodeGraph.Graph; +namespace CSharpCodeAnalyst.CodeGraph.Graph; public class SourceLocation { diff --git a/CodeGraph/Metrics/MemberMetrics.cs b/CSharpCodeAnalyst.CodeGraph/Metrics/MemberMetrics.cs similarity index 95% rename from CodeGraph/Metrics/MemberMetrics.cs rename to CSharpCodeAnalyst.CodeGraph/Metrics/MemberMetrics.cs index 869afbc7..05ca461a 100644 --- a/CodeGraph/Metrics/MemberMetrics.cs +++ b/CSharpCodeAnalyst.CodeGraph/Metrics/MemberMetrics.cs @@ -1,4 +1,4 @@ -namespace CodeGraph.Metrics; +namespace CSharpCodeAnalyst.CodeGraph.Metrics; /// /// Source-level metrics for a single member (method, ...), collected optionally during parsing diff --git a/CodeGraph/Metrics/MetricStore.cs b/CSharpCodeAnalyst.CodeGraph/Metrics/MetricStore.cs similarity index 96% rename from CodeGraph/Metrics/MetricStore.cs rename to CSharpCodeAnalyst.CodeGraph/Metrics/MetricStore.cs index fe840dad..68830d0b 100644 --- a/CodeGraph/Metrics/MetricStore.cs +++ b/CSharpCodeAnalyst.CodeGraph/Metrics/MetricStore.cs @@ -1,4 +1,4 @@ -namespace CodeGraph.Metrics; +namespace CSharpCodeAnalyst.CodeGraph.Metrics; /// /// Holds the optional per-member source metrics, keyed by . diff --git a/CodeParser/CodeParser.csproj b/CSharpCodeAnalyst.CodeParser/CSharpCodeAnalyst.CodeParser.csproj similarity index 92% rename from CodeParser/CodeParser.csproj rename to CSharpCodeAnalyst.CodeParser/CSharpCodeAnalyst.CodeParser.csproj index 1f574074..bf3b64a7 100644 --- a/CodeParser/CodeParser.csproj +++ b/CSharpCodeAnalyst.CodeParser/CSharpCodeAnalyst.CodeParser.csproj @@ -20,7 +20,7 @@ - + diff --git a/CodeParser/Parser/Artifacts.cs b/CSharpCodeAnalyst.CodeParser/Parser/Artifacts.cs similarity index 95% rename from CodeParser/Parser/Artifacts.cs rename to CSharpCodeAnalyst.CodeParser/Parser/Artifacts.cs index 37856bc4..364e5767 100644 --- a/CodeParser/Parser/Artifacts.cs +++ b/CSharpCodeAnalyst.CodeParser/Parser/Artifacts.cs @@ -1,9 +1,9 @@ using System.Collections.ObjectModel; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; -namespace CodeParser.Parser; +namespace CSharpCodeAnalyst.CodeParser.Parser; /// /// Artifacts from the first phase of the parser. diff --git a/CodeParser/Parser/CodeGraphPlausibilityChecks.cs b/CSharpCodeAnalyst.CodeParser/Parser/CodeGraphPlausibilityChecks.cs similarity index 97% rename from CodeParser/Parser/CodeGraphPlausibilityChecks.cs rename to CSharpCodeAnalyst.CodeParser/Parser/CodeGraphPlausibilityChecks.cs index 436b391b..b57d51da 100644 --- a/CodeParser/Parser/CodeGraphPlausibilityChecks.cs +++ b/CSharpCodeAnalyst.CodeParser/Parser/CodeGraphPlausibilityChecks.cs @@ -1,6 +1,6 @@ using System.Diagnostics; -namespace CodeParser.Parser; +namespace CSharpCodeAnalyst.CodeParser.Parser; internal static class CodeGraphPlausibilityChecks { diff --git a/CodeParser/Parser/Config/ParserConfig.cs b/CSharpCodeAnalyst.CodeParser/Parser/Config/ParserConfig.cs similarity index 97% rename from CodeParser/Parser/Config/ParserConfig.cs rename to CSharpCodeAnalyst.CodeParser/Parser/Config/ParserConfig.cs index ee811a76..aedd915e 100644 --- a/CodeParser/Parser/Config/ParserConfig.cs +++ b/CSharpCodeAnalyst.CodeParser/Parser/Config/ParserConfig.cs @@ -1,4 +1,4 @@ -namespace CodeParser.Parser.Config; +namespace CSharpCodeAnalyst.CodeParser.Parser.Config; public class ParserConfig { diff --git a/CodeParser/Parser/Config/ProjectExclusionRegExCollection.cs b/CSharpCodeAnalyst.CodeParser/Parser/Config/ProjectExclusionRegExCollection.cs similarity index 95% rename from CodeParser/Parser/Config/ProjectExclusionRegExCollection.cs rename to CSharpCodeAnalyst.CodeParser/Parser/Config/ProjectExclusionRegExCollection.cs index 51a1006c..c4a4c158 100644 --- a/CodeParser/Parser/Config/ProjectExclusionRegExCollection.cs +++ b/CSharpCodeAnalyst.CodeParser/Parser/Config/ProjectExclusionRegExCollection.cs @@ -1,6 +1,6 @@ using System.Text.RegularExpressions; -namespace CodeParser.Parser.Config; +namespace CSharpCodeAnalyst.CodeParser.Parser.Config; public class ProjectExclusionRegExCollection { diff --git a/CodeParser/Parser/ExternalCodeElementCache.cs b/CSharpCodeAnalyst.CodeParser/Parser/ExternalCodeElementCache.cs similarity index 98% rename from CodeParser/Parser/ExternalCodeElementCache.cs rename to CSharpCodeAnalyst.CodeParser/Parser/ExternalCodeElementCache.cs index 0d37f32e..e1887a41 100644 --- a/CodeParser/Parser/ExternalCodeElementCache.cs +++ b/CSharpCodeAnalyst.CodeParser/Parser/ExternalCodeElementCache.cs @@ -1,7 +1,7 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; using Microsoft.CodeAnalysis; -namespace CodeParser.Parser; +namespace CSharpCodeAnalyst.CodeParser.Parser; /// /// In pass 1 only internal code elements are created. diff --git a/CodeParser/Parser/HierarchyAnalyzer.cs b/CSharpCodeAnalyst.CodeParser/Parser/HierarchyAnalyzer.cs similarity index 99% rename from CodeParser/Parser/HierarchyAnalyzer.cs rename to CSharpCodeAnalyst.CodeParser/Parser/HierarchyAnalyzer.cs index 7004cdf4..0e961fb6 100644 --- a/CodeParser/Parser/HierarchyAnalyzer.cs +++ b/CSharpCodeAnalyst.CodeParser/Parser/HierarchyAnalyzer.cs @@ -1,10 +1,10 @@ using System.Diagnostics; -using CodeGraph.Graph; -using CodeParser.Parser.Config; +using CSharpCodeAnalyst.CodeGraph.Graph; +using CSharpCodeAnalyst.CodeParser.Parser.Config; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; -namespace CodeParser.Parser; +namespace CSharpCodeAnalyst.CodeParser.Parser; /// /// Extracts all code elements found in the solution together with other artifacts needed for phase 2. diff --git a/CodeParser/Parser/ISyntaxNodeHandler.cs b/CSharpCodeAnalyst.CodeParser/Parser/ISyntaxNodeHandler.cs similarity index 98% rename from CodeParser/Parser/ISyntaxNodeHandler.cs rename to CSharpCodeAnalyst.CodeParser/Parser/ISyntaxNodeHandler.cs index 7d896ddd..9d06d67f 100644 --- a/CodeParser/Parser/ISyntaxNodeHandler.cs +++ b/CSharpCodeAnalyst.CodeParser/Parser/ISyntaxNodeHandler.cs @@ -1,8 +1,8 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; -namespace CodeParser.Parser; +namespace CSharpCodeAnalyst.CodeParser.Parser; /// /// Methods the syntax walkers call to report findings. diff --git a/CodeParser/Parser/Initializer.cs b/CSharpCodeAnalyst.CodeParser/Parser/Initializer.cs similarity index 96% rename from CodeParser/Parser/Initializer.cs rename to CSharpCodeAnalyst.CodeParser/Parser/Initializer.cs index c408fe40..9a9e365c 100644 --- a/CodeParser/Parser/Initializer.cs +++ b/CSharpCodeAnalyst.CodeParser/Parser/Initializer.cs @@ -1,7 +1,7 @@ using System.Diagnostics; using Microsoft.Build.Locator; -namespace CodeParser.Parser; +namespace CSharpCodeAnalyst.CodeParser.Parser; public static class Initializer { diff --git a/CodeParser/Parser/LambdaBodyWalker.cs b/CSharpCodeAnalyst.CodeParser/Parser/LambdaBodyWalker.cs similarity index 98% rename from CodeParser/Parser/LambdaBodyWalker.cs rename to CSharpCodeAnalyst.CodeParser/Parser/LambdaBodyWalker.cs index f99eae74..f4b6f293 100644 --- a/CodeParser/Parser/LambdaBodyWalker.cs +++ b/CSharpCodeAnalyst.CodeParser/Parser/LambdaBodyWalker.cs @@ -1,9 +1,9 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -namespace CodeParser.Parser; +namespace CSharpCodeAnalyst.CodeParser.Parser; /// /// Specialized walker for lambda/anonymous method bodies. diff --git a/CodeParser/Parser/MethodBodyWalker.cs b/CSharpCodeAnalyst.CodeParser/Parser/MethodBodyWalker.cs similarity index 98% rename from CodeParser/Parser/MethodBodyWalker.cs rename to CSharpCodeAnalyst.CodeParser/Parser/MethodBodyWalker.cs index fac6bbaa..e37bd938 100644 --- a/CodeParser/Parser/MethodBodyWalker.cs +++ b/CSharpCodeAnalyst.CodeParser/Parser/MethodBodyWalker.cs @@ -1,8 +1,8 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; -namespace CodeParser.Parser; +namespace CSharpCodeAnalyst.CodeParser.Parser; /// /// Syntax walker for analyzing method and property bodies. diff --git a/CodeParser/Parser/ParseResult.cs b/CSharpCodeAnalyst.CodeParser/Parser/ParseResult.cs similarity index 82% rename from CodeParser/Parser/ParseResult.cs rename to CSharpCodeAnalyst.CodeParser/Parser/ParseResult.cs index c8fce04c..e523ad47 100644 --- a/CodeParser/Parser/ParseResult.cs +++ b/CSharpCodeAnalyst.CodeParser/Parser/ParseResult.cs @@ -1,6 +1,6 @@ -using CodeGraph.Metrics; +using CSharpCodeAnalyst.CodeGraph.Metrics; -namespace CodeParser.Parser; +namespace CSharpCodeAnalyst.CodeParser.Parser; /// /// The complete output of a parse: the code graph together with the (optional) per-member source diff --git a/CodeParser/Parser/Parser.cs b/CSharpCodeAnalyst.CodeParser/Parser/Parser.cs similarity index 97% rename from CodeParser/Parser/Parser.cs rename to CSharpCodeAnalyst.CodeParser/Parser/Parser.cs index c59f8e94..7fcecc46 100644 --- a/CodeParser/Parser/Parser.cs +++ b/CSharpCodeAnalyst.CodeParser/Parser/Parser.cs @@ -1,14 +1,14 @@ using System.Diagnostics; -using CodeGraph.Contracts; -using CodeGraph.Graph; -using CodeGraph.Metrics; -using CodeParser.Parser.Config; +using CSharpCodeAnalyst.CodeGraph.Contracts; +using CSharpCodeAnalyst.CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Metrics; +using CSharpCodeAnalyst.CodeParser.Parser.Config; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.MSBuild; using Microsoft.CodeAnalysis.Text; -namespace CodeParser.Parser; +namespace CSharpCodeAnalyst.CodeParser.Parser; /// /// Parses a solution and builds a code graph. @@ -112,7 +112,7 @@ private async Task ParseSolution(string solutionPath) /// Parses in-memory C# source through the full parser pipeline using a Roslyn /// - no MSBuild, no /// and no disk access. Intended for unit tests and small tooling that want a real - /// from a code snippet. + /// from a code snippet. /// The synthetic project/document file names are pure identifiers; none of them needs to exist on /// disk. The only files read are the framework reference assemblies in the runtime directory. /// diff --git a/CodeParser/Parser/ParserDiagnostics.cs b/CSharpCodeAnalyst.CodeParser/Parser/ParserDiagnostics.cs similarity index 94% rename from CodeParser/Parser/ParserDiagnostics.cs rename to CSharpCodeAnalyst.CodeParser/Parser/ParserDiagnostics.cs index add48936..2fc43282 100644 --- a/CodeParser/Parser/ParserDiagnostics.cs +++ b/CSharpCodeAnalyst.CodeParser/Parser/ParserDiagnostics.cs @@ -1,7 +1,7 @@ -using CodeGraph.Contracts; +using CSharpCodeAnalyst.CodeGraph.Contracts; using Microsoft.CodeAnalysis; -namespace CodeParser.Parser; +namespace CSharpCodeAnalyst.CodeParser.Parser; internal class ParserDiagnostics : IParserDiagnostics { diff --git a/CodeParser/Parser/Progress.cs b/CSharpCodeAnalyst.CodeParser/Parser/Progress.cs similarity index 71% rename from CodeParser/Parser/Progress.cs rename to CSharpCodeAnalyst.CodeParser/Parser/Progress.cs index 852c13ce..6988cad3 100644 --- a/CodeParser/Parser/Progress.cs +++ b/CSharpCodeAnalyst.CodeParser/Parser/Progress.cs @@ -1,6 +1,6 @@ -using CodeGraph.Contracts; +using CSharpCodeAnalyst.CodeGraph.Contracts; -namespace CodeParser.Parser; +namespace CSharpCodeAnalyst.CodeParser.Parser; public class Progress : IProgress { diff --git a/CodeParser/Parser/ProjectSelector.cs b/CSharpCodeAnalyst.CodeParser/Parser/ProjectSelector.cs similarity index 99% rename from CodeParser/Parser/ProjectSelector.cs rename to CSharpCodeAnalyst.CodeParser/Parser/ProjectSelector.cs index 03dddd51..e48015e8 100644 --- a/CodeParser/Parser/ProjectSelector.cs +++ b/CSharpCodeAnalyst.CodeParser/Parser/ProjectSelector.cs @@ -1,6 +1,6 @@ using System.Text.RegularExpressions; -namespace CodeParser.Parser; +namespace CSharpCodeAnalyst.CodeParser.Parser; /// /// A project reduced to the bits needed to decide which one to keep when several projects share the diff --git a/CodeParser/Parser/PropertyAccessClassifier.cs b/CSharpCodeAnalyst.CodeParser/Parser/PropertyAccessClassifier.cs similarity index 98% rename from CodeParser/Parser/PropertyAccessClassifier.cs rename to CSharpCodeAnalyst.CodeParser/Parser/PropertyAccessClassifier.cs index e8586f2e..f6b4269a 100644 --- a/CodeParser/Parser/PropertyAccessClassifier.cs +++ b/CSharpCodeAnalyst.CodeParser/Parser/PropertyAccessClassifier.cs @@ -2,7 +2,7 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -namespace CodeParser.Parser; +namespace CSharpCodeAnalyst.CodeParser.Parser; /// /// Whether a property reference reads (getter), writes (setter) or does both. diff --git a/CodeParser/Parser/RelationshipAnalyzer.cs b/CSharpCodeAnalyst.CodeParser/Parser/RelationshipAnalyzer.cs similarity index 99% rename from CodeParser/Parser/RelationshipAnalyzer.cs rename to CSharpCodeAnalyst.CodeParser/Parser/RelationshipAnalyzer.cs index efd91d19..bb454cbd 100644 --- a/CodeParser/Parser/RelationshipAnalyzer.cs +++ b/CSharpCodeAnalyst.CodeParser/Parser/RelationshipAnalyzer.cs @@ -1,11 +1,11 @@ using System.Diagnostics; -using CodeGraph.Graph; -using CodeParser.Parser.Config; +using CSharpCodeAnalyst.CodeGraph.Graph; +using CSharpCodeAnalyst.CodeParser.Parser.Config; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -namespace CodeParser.Parser; +namespace CSharpCodeAnalyst.CodeParser.Parser; /// /// Phase 2/2 of the parser: Analyzing relationships between code elements. diff --git a/CodeParser/Parser/SourceMetricsCollector.cs b/CSharpCodeAnalyst.CodeParser/Parser/SourceMetricsCollector.cs similarity index 98% rename from CodeParser/Parser/SourceMetricsCollector.cs rename to CSharpCodeAnalyst.CodeParser/Parser/SourceMetricsCollector.cs index 619d4730..8d2ef92f 100644 --- a/CodeParser/Parser/SourceMetricsCollector.cs +++ b/CSharpCodeAnalyst.CodeParser/Parser/SourceMetricsCollector.cs @@ -1,9 +1,9 @@ -using CodeGraph.Metrics; +using CSharpCodeAnalyst.CodeGraph.Metrics; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -namespace CodeParser.Parser; +namespace CSharpCodeAnalyst.CodeParser.Parser; /// /// Computes source-level metrics for a member from its declaration syntax. Deliberately diff --git a/CodeParser/Parser/SymbolExtensions.cs b/CSharpCodeAnalyst.CodeParser/Parser/SymbolExtensions.cs similarity index 99% rename from CodeParser/Parser/SymbolExtensions.cs rename to CSharpCodeAnalyst.CodeParser/Parser/SymbolExtensions.cs index 0cbfae74..1f830b62 100644 --- a/CodeParser/Parser/SymbolExtensions.cs +++ b/CSharpCodeAnalyst.CodeParser/Parser/SymbolExtensions.cs @@ -1,9 +1,9 @@ using System.Diagnostics; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; -namespace CodeParser.Parser; +namespace CSharpCodeAnalyst.CodeParser.Parser; /// /// Symbol identification across compilations. diff --git a/CodeParser/Parser/SyntaxExtensions.cs b/CSharpCodeAnalyst.CodeParser/Parser/SyntaxExtensions.cs similarity index 96% rename from CodeParser/Parser/SyntaxExtensions.cs rename to CSharpCodeAnalyst.CodeParser/Parser/SyntaxExtensions.cs index f231bb24..821bb7f8 100644 --- a/CodeParser/Parser/SyntaxExtensions.cs +++ b/CSharpCodeAnalyst.CodeParser/Parser/SyntaxExtensions.cs @@ -1,8 +1,8 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; -namespace CodeParser.Parser; +namespace CSharpCodeAnalyst.CodeParser.Parser; internal static class SyntaxExtensions { diff --git a/CodeParser/Parser/SyntaxWalkerBase.cs b/CSharpCodeAnalyst.CodeParser/Parser/SyntaxWalkerBase.cs similarity index 98% rename from CodeParser/Parser/SyntaxWalkerBase.cs rename to CSharpCodeAnalyst.CodeParser/Parser/SyntaxWalkerBase.cs index d2db7f25..5b98853d 100644 --- a/CodeParser/Parser/SyntaxWalkerBase.cs +++ b/CSharpCodeAnalyst.CodeParser/Parser/SyntaxWalkerBase.cs @@ -1,9 +1,9 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -namespace CodeParser.Parser; +namespace CSharpCodeAnalyst.CodeParser.Parser; /// /// diff --git a/CSharpCodeAnalyst.sln b/CSharpCodeAnalyst.sln index 757ac4da..bf530fca 100644 --- a/CSharpCodeAnalyst.sln +++ b/CSharpCodeAnalyst.sln @@ -8,7 +8,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharpCodeAnalyst", "CSharp {7D5EA751-84A3-43F1-BCCE-C9D10536AB1B} = {7D5EA751-84A3-43F1-BCCE-C9D10536AB1B} EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeParser", "CodeParser\CodeParser.csproj", "{8D89C41C-F2EB-4E54-8297-1A552BEE2396}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharpCodeAnalyst.CodeParser", "CSharpCodeAnalyst.CodeParser\CSharpCodeAnalyst.CodeParser.csproj", "{8D89C41C-F2EB-4E54-8297-1A552BEE2396}" ProjectSection(ProjectDependencies) = postProject {7D5EA751-84A3-43F1-BCCE-C9D10536AB1B} = {7D5EA751-84A3-43F1-BCCE-C9D10536AB1B} EndProjectSection @@ -24,10 +24,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .editorconfig = .editorconfig EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeGraph", "CodeGraph\CodeGraph.csproj", "{7D5EA751-84A3-43F1-BCCE-C9D10536AB1B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharpCodeAnalyst.CodeGraph", "CSharpCodeAnalyst.CodeGraph\CSharpCodeAnalyst.CodeGraph.csproj", "{7D5EA751-84A3-43F1-BCCE-C9D10536AB1B}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApprovalTestTool", "ApprovalTestTool\ApprovalTestTool.csproj", "{767539BE-FBE3-4B46-9A5E-21D60E1B278B}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpCodeAnalyst.AnalyzerSdk", "CSharpCodeAnalyst.AnalyzerSdk\CSharpCodeAnalyst.AnalyzerSdk.csproj", "{98DF020B-7487-4E52-8BF9-DEC19BB83668}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpCodeAnalyst.Analyzers", "CSharpCodeAnalyst.Analyzers\CSharpCodeAnalyst.Analyzers.csproj", "{6D1C8D81-45A7-476E-9C06-6920B2739862}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -98,18 +102,30 @@ Global {767539BE-FBE3-4B46-9A5E-21D60E1B278B}.Release|x64.Build.0 = Release|Any CPU {767539BE-FBE3-4B46-9A5E-21D60E1B278B}.Release|x86.ActiveCfg = Release|Any CPU {767539BE-FBE3-4B46-9A5E-21D60E1B278B}.Release|x86.Build.0 = Release|Any CPU - {391D7263-AFC7-4FC7-BED1-105930871AC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {391D7263-AFC7-4FC7-BED1-105930871AC9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {391D7263-AFC7-4FC7-BED1-105930871AC9}.Debug|x64.ActiveCfg = Debug|Any CPU - {391D7263-AFC7-4FC7-BED1-105930871AC9}.Debug|x64.Build.0 = Debug|Any CPU - {391D7263-AFC7-4FC7-BED1-105930871AC9}.Debug|x86.ActiveCfg = Debug|Any CPU - {391D7263-AFC7-4FC7-BED1-105930871AC9}.Debug|x86.Build.0 = Debug|Any CPU - {391D7263-AFC7-4FC7-BED1-105930871AC9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {391D7263-AFC7-4FC7-BED1-105930871AC9}.Release|Any CPU.Build.0 = Release|Any CPU - {391D7263-AFC7-4FC7-BED1-105930871AC9}.Release|x64.ActiveCfg = Release|Any CPU - {391D7263-AFC7-4FC7-BED1-105930871AC9}.Release|x64.Build.0 = Release|Any CPU - {391D7263-AFC7-4FC7-BED1-105930871AC9}.Release|x86.ActiveCfg = Release|Any CPU - {391D7263-AFC7-4FC7-BED1-105930871AC9}.Release|x86.Build.0 = Release|Any CPU + {98DF020B-7487-4E52-8BF9-DEC19BB83668}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {98DF020B-7487-4E52-8BF9-DEC19BB83668}.Debug|Any CPU.Build.0 = Debug|Any CPU + {98DF020B-7487-4E52-8BF9-DEC19BB83668}.Debug|x64.ActiveCfg = Debug|Any CPU + {98DF020B-7487-4E52-8BF9-DEC19BB83668}.Debug|x64.Build.0 = Debug|Any CPU + {98DF020B-7487-4E52-8BF9-DEC19BB83668}.Debug|x86.ActiveCfg = Debug|Any CPU + {98DF020B-7487-4E52-8BF9-DEC19BB83668}.Debug|x86.Build.0 = Debug|Any CPU + {98DF020B-7487-4E52-8BF9-DEC19BB83668}.Release|Any CPU.ActiveCfg = Release|Any CPU + {98DF020B-7487-4E52-8BF9-DEC19BB83668}.Release|Any CPU.Build.0 = Release|Any CPU + {98DF020B-7487-4E52-8BF9-DEC19BB83668}.Release|x64.ActiveCfg = Release|Any CPU + {98DF020B-7487-4E52-8BF9-DEC19BB83668}.Release|x64.Build.0 = Release|Any CPU + {98DF020B-7487-4E52-8BF9-DEC19BB83668}.Release|x86.ActiveCfg = Release|Any CPU + {98DF020B-7487-4E52-8BF9-DEC19BB83668}.Release|x86.Build.0 = Release|Any CPU + {6D1C8D81-45A7-476E-9C06-6920B2739862}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6D1C8D81-45A7-476E-9C06-6920B2739862}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6D1C8D81-45A7-476E-9C06-6920B2739862}.Debug|x64.ActiveCfg = Debug|Any CPU + {6D1C8D81-45A7-476E-9C06-6920B2739862}.Debug|x64.Build.0 = Debug|Any CPU + {6D1C8D81-45A7-476E-9C06-6920B2739862}.Debug|x86.ActiveCfg = Debug|Any CPU + {6D1C8D81-45A7-476E-9C06-6920B2739862}.Debug|x86.Build.0 = Debug|Any CPU + {6D1C8D81-45A7-476E-9C06-6920B2739862}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6D1C8D81-45A7-476E-9C06-6920B2739862}.Release|Any CPU.Build.0 = Release|Any CPU + {6D1C8D81-45A7-476E-9C06-6920B2739862}.Release|x64.ActiveCfg = Release|Any CPU + {6D1C8D81-45A7-476E-9C06-6920B2739862}.Release|x64.Build.0 = Release|Any CPU + {6D1C8D81-45A7-476E-9C06-6920B2739862}.Release|x86.ActiveCfg = Release|Any CPU + {6D1C8D81-45A7-476E-9C06-6920B2739862}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/CSharpCodeAnalyst/App.xaml.cs b/CSharpCodeAnalyst/App.xaml.cs index 4a303a92..c3ac446f 100644 --- a/CSharpCodeAnalyst/App.xaml.cs +++ b/CSharpCodeAnalyst/App.xaml.cs @@ -1,7 +1,8 @@ using System.IO; using System.Windows; -using CodeGraph.Exploration; -using CodeParser.Parser; +using CSharpCodeAnalyst.AnalyzerSdk.Messages; +using CSharpCodeAnalyst.CodeGraph.Exploration; +using CSharpCodeAnalyst.CodeParser.Parser; using CSharpCodeAnalyst.CommandLine; using CSharpCodeAnalyst.Configuration; using CSharpCodeAnalyst.Features.AdvancedSearch; @@ -13,6 +14,7 @@ using CSharpCodeAnalyst.Features.Tree; using CSharpCodeAnalyst.Shared.Messages; using CSharpCodeAnalyst.Shared.Notifications; +using CSharpCodeAnalyst.Shared.Services; using Microsoft.Extensions.Configuration; namespace CSharpCodeAnalyst; @@ -143,6 +145,7 @@ private void StartUi() messaging.Subscribe(viewModel.HandleCycleCalculationComplete); messaging.Subscribe(viewModel.HandleShowPartitionsRequest); messaging.Subscribe(viewModel.HandleShowCycleGroupRequest); + messaging.Subscribe(r => SourceLocationNavigator.Open(r.Location)); // Refactorings are forwarded to all other view models diff --git a/CSharpCodeAnalyst/CSharpCodeAnalyst.csproj b/CSharpCodeAnalyst/CSharpCodeAnalyst.csproj index d6b53c4c..85cb4d4c 100644 --- a/CSharpCodeAnalyst/CSharpCodeAnalyst.csproj +++ b/CSharpCodeAnalyst/CSharpCodeAnalyst.csproj @@ -19,29 +19,9 @@ - - MSBuild:Compile - Wpf - Designer - - - MSBuild:Compile - Wpf - Designer - - - MSBuild:Compile - Wpf - Designer - MSBuild:Compile - - MSBuild:Compile - Wpf - Designer - @@ -67,7 +47,6 @@ - @@ -126,7 +105,6 @@ - @@ -157,8 +135,10 @@ - - + + + + diff --git a/CSharpCodeAnalyst/CommandLine/ConsoleValidationCommand.cs b/CSharpCodeAnalyst/CommandLine/ConsoleValidationCommand.cs index f935b196..7328b74e 100644 --- a/CSharpCodeAnalyst/CommandLine/ConsoleValidationCommand.cs +++ b/CSharpCodeAnalyst/CommandLine/ConsoleValidationCommand.cs @@ -1,15 +1,17 @@ using System.Diagnostics; using System.IO; using System.Text; -using CodeParser.Parser; -using CodeParser.Parser.Config; using CSharpCodeAnalyst.Configuration; -using CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules; +using CSharpCodeAnalyst.Analyzers.ArchitecturalRules; +using CSharpCodeAnalyst.AnalyzerSdk.Contracts; using CSharpCodeAnalyst.Resources; using CSharpCodeAnalyst.Shared.Contracts; using CSharpCodeAnalyst.Shared.Messages; using CSharpCodeAnalyst.Shared.Notifications; using Microsoft.Extensions.Configuration; +using CSharpCodeAnalyst.CodeGraph.Graph; +using CSharpCodeAnalyst.CodeParser.Parser; +using CSharpCodeAnalyst.CodeParser.Parser.Config; namespace CSharpCodeAnalyst.CommandLine; diff --git a/CSharpCodeAnalyst/Configuration/SettingsDialog.xaml.cs b/CSharpCodeAnalyst/Configuration/SettingsDialog.xaml.cs index 9dc32529..1133570d 100644 --- a/CSharpCodeAnalyst/Configuration/SettingsDialog.xaml.cs +++ b/CSharpCodeAnalyst/Configuration/SettingsDialog.xaml.cs @@ -1,6 +1,6 @@ using System.Text.RegularExpressions; using System.Windows; -using CodeParser.Parser.Config; +using CSharpCodeAnalyst.CodeParser.Parser.Config; using CSharpCodeAnalyst.Resources; namespace CSharpCodeAnalyst.Configuration; diff --git a/CSharpCodeAnalyst/Features/AdvancedSearch/AdvancedSearchControl.xaml b/CSharpCodeAnalyst/Features/AdvancedSearch/AdvancedSearchControl.xaml index fbd823a6..75812c30 100644 --- a/CSharpCodeAnalyst/Features/AdvancedSearch/AdvancedSearchControl.xaml +++ b/CSharpCodeAnalyst/Features/AdvancedSearch/AdvancedSearchControl.xaml @@ -14,7 +14,7 @@ - + diff --git a/CSharpCodeAnalyst/Features/AdvancedSearch/AdvancedSearchViewModel.cs b/CSharpCodeAnalyst/Features/AdvancedSearch/AdvancedSearchViewModel.cs index 56070d84..c249c16b 100644 --- a/CSharpCodeAnalyst/Features/AdvancedSearch/AdvancedSearchViewModel.cs +++ b/CSharpCodeAnalyst/Features/AdvancedSearch/AdvancedSearchViewModel.cs @@ -3,10 +3,12 @@ using System.Windows; using System.Windows.Input; using System.Windows.Threading; -using CodeGraph.Graph; +using CSharpCodeAnalyst.AnalyzerSdk.Messages; +using CSharpCodeAnalyst.AnalyzerSdk.Search; +using CSharpCodeAnalyst.AnalyzerSdk.Wpf; +using CSharpCodeAnalyst.CodeGraph.Graph; using CSharpCodeAnalyst.Features.Refactoring; using CSharpCodeAnalyst.Shared.Messages; -using CSharpCodeAnalyst.Shared.Search; using CSharpCodeAnalyst.Shared.Services; using CSharpCodeAnalyst.Shared.Wpf; diff --git a/CSharpCodeAnalyst/Features/AdvancedSearch/SearchItemViewModel.cs b/CSharpCodeAnalyst/Features/AdvancedSearch/SearchItemViewModel.cs index 76e8ad63..318db254 100644 --- a/CSharpCodeAnalyst/Features/AdvancedSearch/SearchItemViewModel.cs +++ b/CSharpCodeAnalyst/Features/AdvancedSearch/SearchItemViewModel.cs @@ -1,7 +1,7 @@ using System.ComponentModel; using System.Diagnostics; using System.Windows.Media.Imaging; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; using CSharpCodeAnalyst.Shared.Messages; namespace CSharpCodeAnalyst.Features.AdvancedSearch; diff --git a/CSharpCodeAnalyst/Features/Ai/AiAdvisorService.cs b/CSharpCodeAnalyst/Features/Ai/AiAdvisorService.cs index cc0080dc..8fce51ea 100644 --- a/CSharpCodeAnalyst/Features/Ai/AiAdvisorService.cs +++ b/CSharpCodeAnalyst/Features/Ai/AiAdvisorService.cs @@ -1,6 +1,6 @@ -using CodeGraph.Algorithms.Cycles; -using CodeGraph.Export; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Algorithms.Cycles; +using CSharpCodeAnalyst.CodeGraph.Export; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CSharpCodeAnalyst.Features.Ai; diff --git a/CSharpCodeAnalyst/Features/Analyzers/AnalyzerManager.cs b/CSharpCodeAnalyst/Features/Analyzers/AnalyzerManager.cs index 1ed071d9..84f3c1d6 100644 --- a/CSharpCodeAnalyst/Features/Analyzers/AnalyzerManager.cs +++ b/CSharpCodeAnalyst/Features/Analyzers/AnalyzerManager.cs @@ -1,7 +1,13 @@ -using CodeGraph.Metrics; -using CSharpCodeAnalyst.Features.Analyzers.EventRegistration; +using CSharpCodeAnalyst.Analyzers.EventRegistration; +using CSharpCodeAnalyst.AnalyzerSdk.Contracts; +using CSharpCodeAnalyst.AnalyzerSdk.Notifications; +using CSharpCodeAnalyst.CodeGraph.Metrics; using CSharpCodeAnalyst.Shared.Contracts; using CSharpCodeAnalyst.Shared.Notifications; +using ArchitecturalRules = CSharpCodeAnalyst.Analyzers.ArchitecturalRules; +using MethodComplexity = CSharpCodeAnalyst.Analyzers.MethodComplexity; +using TypeCohesion = CSharpCodeAnalyst.Analyzers.TypeCohesion; +using TypeDependencies = CSharpCodeAnalyst.Analyzers.TypeDependencies; namespace CSharpCodeAnalyst.Features.Analyzers; @@ -63,7 +69,7 @@ public void LoadAnalyzers(IPublisher messaging, IUserNotification userNotificati { _analyzers.Clear(); - IAnalyzer analyzer = new Analyzer(messaging); + IAnalyzer analyzer = new Analyzer(messaging, userNotification); analyzer.DataChanged += (_, _) => RaiseAnalyzerDataChanged(); _analyzers.Add(analyzer.Id, analyzer); @@ -71,15 +77,15 @@ public void LoadAnalyzers(IPublisher messaging, IUserNotification userNotificati analyzer.DataChanged += (_, _) => RaiseAnalyzerDataChanged(); _analyzers.Add(analyzer.Id, analyzer); - analyzer = new TypeDependencies.Analyzer(messaging); + analyzer = new TypeDependencies.Analyzer(messaging, userNotification); analyzer.DataChanged += (_, _) => RaiseAnalyzerDataChanged(); _analyzers.Add(analyzer.Id, analyzer); - analyzer = new TypeCohesion.Analyzer(messaging); + analyzer = new TypeCohesion.Analyzer(messaging, userNotification); analyzer.DataChanged += (_, _) => RaiseAnalyzerDataChanged(); _analyzers.Add(analyzer.Id, analyzer); - analyzer = new MethodComplexity.Analyzer(messaging, metricStore); + analyzer = new MethodComplexity.Analyzer(messaging, userNotification, metricStore); analyzer.DataChanged += (_, _) => RaiseAnalyzerDataChanged(); _analyzers.Add(analyzer.Id, analyzer); } diff --git a/CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Presentation/EventImbalanceViewModel.cs b/CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Presentation/EventImbalanceViewModel.cs deleted file mode 100644 index 85c6bce6..00000000 --- a/CSharpCodeAnalyst/Features/Analyzers/EventRegistration/Presentation/EventImbalanceViewModel.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.Collections.ObjectModel; -using System.Windows; -using System.Windows.Input; -using CodeGraph.Graph; -using CSharpCodeAnalyst.Resources; -using CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; -using CSharpCodeAnalyst.Shared.Services; -using CSharpCodeAnalyst.Shared.Wpf; - -namespace CSharpCodeAnalyst.Features.Analyzers.EventRegistration.Presentation; - -public class EventImbalanceViewModel : TableRow -{ - internal EventImbalanceViewModel(Result imbalance) - { - Description = imbalance.Handler.FullName; - Locations = new ObservableCollection(imbalance.Locations); - OpenSourceLocationCommand = new WpfCommand(OnOpenSourceLocation); - } - - public ICommand OpenSourceLocationCommand { get; set; } - - public ObservableCollection Locations { get; set; } - - public string Description { get; } - - - private static void OnOpenSourceLocation(SourceLocation? location) - { - if (location is null) - { - return; - } - - try - { - // Create a new instance to find newly open studio instance. - SourceLocationNavigator.Open(location.File, location.Line, location.Column); - } - catch (Exception ex) - { - var message = string.Format(Strings.OperationFailed_Message, ex.Message); - MessageBox.Show(message, Strings.Error_Title, MessageBoxButton.OK, - MessageBoxImage.Error); - } - } -} \ No newline at end of file diff --git a/CSharpCodeAnalyst/Features/CycleGroups/CycleGroupViewModel.cs b/CSharpCodeAnalyst/Features/CycleGroups/CycleGroupViewModel.cs index 017116ab..ed6e36b1 100644 --- a/CSharpCodeAnalyst/Features/CycleGroups/CycleGroupViewModel.cs +++ b/CSharpCodeAnalyst/Features/CycleGroups/CycleGroupViewModel.cs @@ -1,8 +1,8 @@ using System.Collections.ObjectModel; -using CodeGraph.Algorithms.Cycles; -using CodeGraph.Graph; +using CSharpCodeAnalyst.AnalyzerSdk.DynamicDataGrid.Contracts.TabularData; +using CSharpCodeAnalyst.CodeGraph.Algorithms.Cycles; +using CSharpCodeAnalyst.CodeGraph.Graph; using CSharpCodeAnalyst.Resources; -using CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; using CSharpCodeAnalyst.Shared.UI; namespace CSharpCodeAnalyst.Features.CycleGroups; diff --git a/CSharpCodeAnalyst/Features/CycleGroups/CycleGroupsViewModel.cs b/CSharpCodeAnalyst/Features/CycleGroups/CycleGroupsViewModel.cs index 144c25f7..8d4cfc7f 100644 --- a/CSharpCodeAnalyst/Features/CycleGroups/CycleGroupsViewModel.cs +++ b/CSharpCodeAnalyst/Features/CycleGroups/CycleGroupsViewModel.cs @@ -1,8 +1,9 @@ using System.Collections.ObjectModel; using System.Windows; -using CodeGraph.Algorithms.Cycles; +using CSharpCodeAnalyst.AnalyzerSdk.DynamicDataGrid.Contracts.TabularData; +using CSharpCodeAnalyst.AnalyzerSdk.Wpf; +using CSharpCodeAnalyst.CodeGraph.Algorithms.Cycles; using CSharpCodeAnalyst.Resources; -using CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; using CSharpCodeAnalyst.Shared.Messages; using CSharpCodeAnalyst.Shared.Wpf; diff --git a/CSharpCodeAnalyst/Features/Export/Exporter.cs b/CSharpCodeAnalyst/Features/Export/Exporter.cs index 7afe4b05..cc91a254 100644 --- a/CSharpCodeAnalyst/Features/Export/Exporter.cs +++ b/CSharpCodeAnalyst/Features/Export/Exporter.cs @@ -1,7 +1,8 @@ using System.Diagnostics; using System.IO; using System.Windows; -using CodeGraph.Export; +using CSharpCodeAnalyst.AnalyzerSdk.Notifications; +using CSharpCodeAnalyst.CodeGraph.Export; using CSharpCodeAnalyst.Resources; using CSharpCodeAnalyst.Shared.Notifications; diff --git a/CSharpCodeAnalyst/Features/Gallery/GalleryEditorViewModel.cs b/CSharpCodeAnalyst/Features/Gallery/GalleryEditorViewModel.cs index 55d97228..df7dccbc 100644 --- a/CSharpCodeAnalyst/Features/Gallery/GalleryEditorViewModel.cs +++ b/CSharpCodeAnalyst/Features/Gallery/GalleryEditorViewModel.cs @@ -1,6 +1,7 @@ using System.Collections.ObjectModel; using System.ComponentModel; using System.Windows.Input; +using CSharpCodeAnalyst.AnalyzerSdk.Wpf; using CSharpCodeAnalyst.Features.Graph; using CSharpCodeAnalyst.Shared.Wpf; diff --git a/CSharpCodeAnalyst/Features/Graph/CodeElementContextCommand.cs b/CSharpCodeAnalyst/Features/Graph/CodeElementContextCommand.cs index 4fd76ac8..7820f820 100644 --- a/CSharpCodeAnalyst/Features/Graph/CodeElementContextCommand.cs +++ b/CSharpCodeAnalyst/Features/Graph/CodeElementContextCommand.cs @@ -1,5 +1,5 @@ using System.Windows.Media; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CSharpCodeAnalyst.Features.Graph; diff --git a/CSharpCodeAnalyst/Features/Graph/Filtering/GraphHideDialogViewModel.cs b/CSharpCodeAnalyst/Features/Graph/Filtering/GraphHideDialogViewModel.cs index 726da97d..25d7186e 100644 --- a/CSharpCodeAnalyst/Features/Graph/Filtering/GraphHideDialogViewModel.cs +++ b/CSharpCodeAnalyst/Features/Graph/Filtering/GraphHideDialogViewModel.cs @@ -2,7 +2,8 @@ using System.ComponentModel; using System.Runtime.CompilerServices; using System.Windows.Input; -using CodeGraph.Graph; +using CSharpCodeAnalyst.AnalyzerSdk.Wpf; +using CSharpCodeAnalyst.CodeGraph.Graph; using CSharpCodeAnalyst.Shared.Wpf; namespace CSharpCodeAnalyst.Features.Graph.Filtering; diff --git a/CSharpCodeAnalyst/Features/Graph/Filtering/GraphHideFilter.cs b/CSharpCodeAnalyst/Features/Graph/Filtering/GraphHideFilter.cs index 4b0e1d4b..727ca4b6 100644 --- a/CSharpCodeAnalyst/Features/Graph/Filtering/GraphHideFilter.cs +++ b/CSharpCodeAnalyst/Features/Graph/Filtering/GraphHideFilter.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CSharpCodeAnalyst.Features.Graph.Filtering; diff --git a/CSharpCodeAnalyst/Features/Graph/GlobalCommand.cs b/CSharpCodeAnalyst/Features/Graph/GlobalCommand.cs index 22108b6e..a8aef9f9 100644 --- a/CSharpCodeAnalyst/Features/Graph/GlobalCommand.cs +++ b/CSharpCodeAnalyst/Features/Graph/GlobalCommand.cs @@ -1,6 +1,6 @@ using System.Windows.Input; using System.Windows.Media; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CSharpCodeAnalyst.Features.Graph; diff --git a/CSharpCodeAnalyst/Features/Graph/GraphDropHandler.cs b/CSharpCodeAnalyst/Features/Graph/GraphDropHandler.cs index 437214ea..42825d68 100644 --- a/CSharpCodeAnalyst/Features/Graph/GraphDropHandler.cs +++ b/CSharpCodeAnalyst/Features/Graph/GraphDropHandler.cs @@ -1,4 +1,6 @@ using System.Windows; +using CSharpCodeAnalyst.AnalyzerSdk.Contracts; +using CSharpCodeAnalyst.AnalyzerSdk.Messages; using CSharpCodeAnalyst.Features.AdvancedSearch; using CSharpCodeAnalyst.Features.Tree; using CSharpCodeAnalyst.Shared.Contracts; diff --git a/CSharpCodeAnalyst/Features/Graph/GraphSearchViewModel.cs b/CSharpCodeAnalyst/Features/Graph/GraphSearchViewModel.cs index e9a1a270..6feca74e 100644 --- a/CSharpCodeAnalyst/Features/Graph/GraphSearchViewModel.cs +++ b/CSharpCodeAnalyst/Features/Graph/GraphSearchViewModel.cs @@ -1,7 +1,8 @@ using System.ComponentModel; using System.Windows.Input; using System.Windows.Threading; -using CSharpCodeAnalyst.Shared.Search; +using CSharpCodeAnalyst.AnalyzerSdk.Search; +using CSharpCodeAnalyst.AnalyzerSdk.Wpf; using CSharpCodeAnalyst.Shared.Wpf; namespace CSharpCodeAnalyst.Features.Graph; diff --git a/CSharpCodeAnalyst/Features/Graph/GraphSession.cs b/CSharpCodeAnalyst/Features/Graph/GraphSession.cs index 555ee4f7..bf032293 100644 --- a/CSharpCodeAnalyst/Features/Graph/GraphSession.cs +++ b/CSharpCodeAnalyst/Features/Graph/GraphSession.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CSharpCodeAnalyst.Features.Graph; diff --git a/CSharpCodeAnalyst/Features/Graph/GraphToolbarControl.xaml b/CSharpCodeAnalyst/Features/Graph/GraphToolbarControl.xaml index 4ef93f8a..28ed6934 100644 --- a/CSharpCodeAnalyst/Features/Graph/GraphToolbarControl.xaml +++ b/CSharpCodeAnalyst/Features/Graph/GraphToolbarControl.xaml @@ -16,7 +16,7 @@ - + diff --git a/CSharpCodeAnalyst/Features/Graph/GraphViewModel.cs b/CSharpCodeAnalyst/Features/Graph/GraphViewModel.cs index 0465f5c3..6c3004a2 100644 --- a/CSharpCodeAnalyst/Features/Graph/GraphViewModel.cs +++ b/CSharpCodeAnalyst/Features/Graph/GraphViewModel.cs @@ -2,9 +2,12 @@ using System.ComponentModel; using System.Windows; using System.Windows.Input; -using CodeGraph.Contracts; -using CodeGraph.Exploration; -using CodeGraph.Graph; +using CSharpCodeAnalyst.AnalyzerSdk.Contracts; +using CSharpCodeAnalyst.AnalyzerSdk.Messages; +using CSharpCodeAnalyst.AnalyzerSdk.Wpf; +using CSharpCodeAnalyst.CodeGraph.Contracts; +using CSharpCodeAnalyst.CodeGraph.Exploration; +using CSharpCodeAnalyst.CodeGraph.Graph; using CSharpCodeAnalyst.Configuration; using CSharpCodeAnalyst.Features.Graph.Filtering; using CSharpCodeAnalyst.Features.Graph.RenderOptions; diff --git a/CSharpCodeAnalyst/Features/Graph/GraphViewState.cs b/CSharpCodeAnalyst/Features/Graph/GraphViewState.cs index 0342d054..de7eeb41 100644 --- a/CSharpCodeAnalyst/Features/Graph/GraphViewState.cs +++ b/CSharpCodeAnalyst/Features/Graph/GraphViewState.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; using CSharpCodeAnalyst.Features.Graph.Filtering; using CSharpCodeAnalyst.Features.Graph.RenderOptions; diff --git a/CSharpCodeAnalyst/Features/Graph/ICodeElementContextCommand.cs b/CSharpCodeAnalyst/Features/Graph/ICodeElementContextCommand.cs index d4d2fd1c..efe2f201 100644 --- a/CSharpCodeAnalyst/Features/Graph/ICodeElementContextCommand.cs +++ b/CSharpCodeAnalyst/Features/Graph/ICodeElementContextCommand.cs @@ -1,5 +1,5 @@ using System.Windows.Media; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CSharpCodeAnalyst.Features.Graph; diff --git a/CSharpCodeAnalyst/Features/Graph/IGlobalCommand.cs b/CSharpCodeAnalyst/Features/Graph/IGlobalCommand.cs index 16798bec..e011b55c 100644 --- a/CSharpCodeAnalyst/Features/Graph/IGlobalCommand.cs +++ b/CSharpCodeAnalyst/Features/Graph/IGlobalCommand.cs @@ -1,6 +1,6 @@ using System.Windows.Input; using System.Windows.Media; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CSharpCodeAnalyst.Features.Graph; diff --git a/CSharpCodeAnalyst/Features/Graph/IRelationshipContextCommand.cs b/CSharpCodeAnalyst/Features/Graph/IRelationshipContextCommand.cs index 0aa6705b..1f2303b7 100644 --- a/CSharpCodeAnalyst/Features/Graph/IRelationshipContextCommand.cs +++ b/CSharpCodeAnalyst/Features/Graph/IRelationshipContextCommand.cs @@ -1,5 +1,5 @@ using System.Windows.Media; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CSharpCodeAnalyst.Features.Graph; diff --git a/CSharpCodeAnalyst/Features/Graph/RelationshipContextCommand.cs b/CSharpCodeAnalyst/Features/Graph/RelationshipContextCommand.cs index c2b4fd15..e07bdfce 100644 --- a/CSharpCodeAnalyst/Features/Graph/RelationshipContextCommand.cs +++ b/CSharpCodeAnalyst/Features/Graph/RelationshipContextCommand.cs @@ -1,5 +1,5 @@ using System.Windows.Media; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CSharpCodeAnalyst.Features.Graph; diff --git a/CSharpCodeAnalyst/Features/Graph/SeparatorCommand.cs b/CSharpCodeAnalyst/Features/Graph/SeparatorCommand.cs index 2b797659..6c4d3721 100644 --- a/CSharpCodeAnalyst/Features/Graph/SeparatorCommand.cs +++ b/CSharpCodeAnalyst/Features/Graph/SeparatorCommand.cs @@ -1,5 +1,5 @@ using System.Windows.Media; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CSharpCodeAnalyst.Features.Graph; diff --git a/CSharpCodeAnalyst/Features/Help/LegendDialog.xaml.cs b/CSharpCodeAnalyst/Features/Help/LegendDialog.xaml.cs index 82a3e0d8..62345e16 100644 --- a/CSharpCodeAnalyst/Features/Help/LegendDialog.xaml.cs +++ b/CSharpCodeAnalyst/Features/Help/LegendDialog.xaml.cs @@ -1,7 +1,7 @@ using System.Windows; using System.Windows.Media; -using CodeGraph.Colors; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Colors; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CSharpCodeAnalyst.Features.Help; diff --git a/CSharpCodeAnalyst/Features/Help/QuickInfoFactory.cs b/CSharpCodeAnalyst/Features/Help/QuickInfoFactory.cs index 1f9d6886..19b3e621 100644 --- a/CSharpCodeAnalyst/Features/Help/QuickInfoFactory.cs +++ b/CSharpCodeAnalyst/Features/Help/QuickInfoFactory.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; using CSharpCodeAnalyst.Resources; using CSharpCodeAnalyst.Shared; diff --git a/CSharpCodeAnalyst/Features/Import/Importer.cs b/CSharpCodeAnalyst/Features/Import/Importer.cs index 072a62c4..96160ac6 100644 --- a/CSharpCodeAnalyst/Features/Import/Importer.cs +++ b/CSharpCodeAnalyst/Features/Import/Importer.cs @@ -1,8 +1,9 @@ -using CodeGraph.Contracts; -using CodeGraph.Export; -using CodeGraph.Metrics; -using CodeParser.Parser; -using CodeParser.Parser.Config; +using CSharpCodeAnalyst.AnalyzerSdk.Notifications; +using CSharpCodeAnalyst.CodeGraph.Contracts; +using CSharpCodeAnalyst.CodeGraph.Export; +using CSharpCodeAnalyst.CodeGraph.Metrics; +using CSharpCodeAnalyst.CodeParser.Parser; +using CSharpCodeAnalyst.CodeParser.Parser.Config; using CSharpCodeAnalyst.Resources; using CSharpCodeAnalyst.Shared; using CSharpCodeAnalyst.Shared.Notifications; diff --git a/CSharpCodeAnalyst/Features/Import/JdepsReader.cs b/CSharpCodeAnalyst/Features/Import/JdepsReader.cs index d9965a2c..93225459 100644 --- a/CSharpCodeAnalyst/Features/Import/JdepsReader.cs +++ b/CSharpCodeAnalyst/Features/Import/JdepsReader.cs @@ -1,5 +1,5 @@ using System.IO; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CSharpCodeAnalyst.Features.Import; diff --git a/CSharpCodeAnalyst/Features/Info/InfoPanelViewModel.cs b/CSharpCodeAnalyst/Features/Info/InfoPanelViewModel.cs index c7f77d2c..49691464 100644 --- a/CSharpCodeAnalyst/Features/Info/InfoPanelViewModel.cs +++ b/CSharpCodeAnalyst/Features/Info/InfoPanelViewModel.cs @@ -2,7 +2,8 @@ using System.Runtime.CompilerServices; using System.Windows; using System.Windows.Input; -using CodeGraph.Graph; +using CSharpCodeAnalyst.AnalyzerSdk.Wpf; +using CSharpCodeAnalyst.CodeGraph.Graph; using CSharpCodeAnalyst.Features.Help; using CSharpCodeAnalyst.Resources; using CSharpCodeAnalyst.Shared; diff --git a/CSharpCodeAnalyst/Features/Partitions/PartitionViewModel.cs b/CSharpCodeAnalyst/Features/Partitions/PartitionViewModel.cs index 6b7ca1d4..24d1f6c3 100644 --- a/CSharpCodeAnalyst/Features/Partitions/PartitionViewModel.cs +++ b/CSharpCodeAnalyst/Features/Partitions/PartitionViewModel.cs @@ -1,6 +1,6 @@ using System.Collections.ObjectModel; +using CSharpCodeAnalyst.AnalyzerSdk.DynamicDataGrid.Contracts.TabularData; using CSharpCodeAnalyst.Resources; -using CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; using CSharpCodeAnalyst.Shared.UI; namespace CSharpCodeAnalyst.Features.Partitions; diff --git a/CSharpCodeAnalyst/Features/Partitions/PartitionsViewModel.cs b/CSharpCodeAnalyst/Features/Partitions/PartitionsViewModel.cs index 1619a565..cf967793 100644 --- a/CSharpCodeAnalyst/Features/Partitions/PartitionsViewModel.cs +++ b/CSharpCodeAnalyst/Features/Partitions/PartitionsViewModel.cs @@ -1,7 +1,7 @@ using System.Collections.ObjectModel; using System.Windows; +using CSharpCodeAnalyst.AnalyzerSdk.DynamicDataGrid.Contracts.TabularData; using CSharpCodeAnalyst.Resources; -using CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; namespace CSharpCodeAnalyst.Features.Partitions; diff --git a/CSharpCodeAnalyst/Features/Refactoring/CodeElementNaming.cs b/CSharpCodeAnalyst/Features/Refactoring/CodeElementNaming.cs index 531b5258..d7eb18f8 100644 --- a/CSharpCodeAnalyst/Features/Refactoring/CodeElementNaming.cs +++ b/CSharpCodeAnalyst/Features/Refactoring/CodeElementNaming.cs @@ -1,5 +1,5 @@ using System.Diagnostics; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CSharpCodeAnalyst.Features.Refactoring; diff --git a/CSharpCodeAnalyst/Features/Refactoring/CodeElementSpecs.cs b/CSharpCodeAnalyst/Features/Refactoring/CodeElementSpecs.cs index 39c707cf..22e21b3c 100644 --- a/CSharpCodeAnalyst/Features/Refactoring/CodeElementSpecs.cs +++ b/CSharpCodeAnalyst/Features/Refactoring/CodeElementSpecs.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CSharpCodeAnalyst.Features.Refactoring; diff --git a/CSharpCodeAnalyst/Features/Refactoring/CreateCodeElementDialogViewModel.cs b/CSharpCodeAnalyst/Features/Refactoring/CreateCodeElementDialogViewModel.cs index 4a398c55..ad646195 100644 --- a/CSharpCodeAnalyst/Features/Refactoring/CreateCodeElementDialogViewModel.cs +++ b/CSharpCodeAnalyst/Features/Refactoring/CreateCodeElementDialogViewModel.cs @@ -2,7 +2,7 @@ using System.ComponentModel; using System.Diagnostics; using System.Runtime.CompilerServices; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CSharpCodeAnalyst.Features.Refactoring; diff --git a/CSharpCodeAnalyst/Features/Refactoring/ICodeElementNaming.cs b/CSharpCodeAnalyst/Features/Refactoring/ICodeElementNaming.cs index 65a6086a..4ec192e6 100644 --- a/CSharpCodeAnalyst/Features/Refactoring/ICodeElementNaming.cs +++ b/CSharpCodeAnalyst/Features/Refactoring/ICodeElementNaming.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CSharpCodeAnalyst.Features.Refactoring; diff --git a/CSharpCodeAnalyst/Features/Refactoring/IRefactoringInteraction.cs b/CSharpCodeAnalyst/Features/Refactoring/IRefactoringInteraction.cs index 68617f3f..d231731b 100644 --- a/CSharpCodeAnalyst/Features/Refactoring/IRefactoringInteraction.cs +++ b/CSharpCodeAnalyst/Features/Refactoring/IRefactoringInteraction.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CSharpCodeAnalyst.Features.Refactoring; diff --git a/CSharpCodeAnalyst/Features/Refactoring/RefactoringInteraction.cs b/CSharpCodeAnalyst/Features/Refactoring/RefactoringInteraction.cs index 10c4399e..61faea12 100644 --- a/CSharpCodeAnalyst/Features/Refactoring/RefactoringInteraction.cs +++ b/CSharpCodeAnalyst/Features/Refactoring/RefactoringInteraction.cs @@ -1,5 +1,5 @@ using System.Windows; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; using CSharpCodeAnalyst.Resources; namespace CSharpCodeAnalyst.Features.Refactoring; diff --git a/CSharpCodeAnalyst/Features/Refactoring/RefactoringService.cs b/CSharpCodeAnalyst/Features/Refactoring/RefactoringService.cs index b7b21bd1..5777c64e 100644 --- a/CSharpCodeAnalyst/Features/Refactoring/RefactoringService.cs +++ b/CSharpCodeAnalyst/Features/Refactoring/RefactoringService.cs @@ -1,5 +1,6 @@ using System.Diagnostics; -using CodeGraph.Graph; +using CSharpCodeAnalyst.AnalyzerSdk.Contracts; +using CSharpCodeAnalyst.CodeGraph.Graph; using CSharpCodeAnalyst.Resources; using CSharpCodeAnalyst.Shared.Contracts; using CSharpCodeAnalyst.Shared.Messages; diff --git a/CSharpCodeAnalyst/Features/Tree/TreeControl.xaml b/CSharpCodeAnalyst/Features/Tree/TreeControl.xaml index 500d7e10..0c5f279e 100644 --- a/CSharpCodeAnalyst/Features/Tree/TreeControl.xaml +++ b/CSharpCodeAnalyst/Features/Tree/TreeControl.xaml @@ -16,7 +16,7 @@ - + diff --git a/CSharpCodeAnalyst/Features/Tree/TreeItemViewModel.cs b/CSharpCodeAnalyst/Features/Tree/TreeItemViewModel.cs index d63f044e..22bc101f 100644 --- a/CSharpCodeAnalyst/Features/Tree/TreeItemViewModel.cs +++ b/CSharpCodeAnalyst/Features/Tree/TreeItemViewModel.cs @@ -2,7 +2,7 @@ using System.ComponentModel; using System.Diagnostics; using System.Windows.Media.Imaging; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; using CSharpCodeAnalyst.Shared.Messages; namespace CSharpCodeAnalyst.Features.Tree; diff --git a/CSharpCodeAnalyst/Features/Tree/TreeViewModel.cs b/CSharpCodeAnalyst/Features/Tree/TreeViewModel.cs index 51a9e165..7ebb4fc2 100644 --- a/CSharpCodeAnalyst/Features/Tree/TreeViewModel.cs +++ b/CSharpCodeAnalyst/Features/Tree/TreeViewModel.cs @@ -3,10 +3,12 @@ using System.Diagnostics; using System.Windows; using System.Windows.Input; -using CodeGraph.Graph; +using CSharpCodeAnalyst.AnalyzerSdk.Messages; +using CSharpCodeAnalyst.AnalyzerSdk.Search; +using CSharpCodeAnalyst.AnalyzerSdk.Wpf; +using CSharpCodeAnalyst.CodeGraph.Graph; using CSharpCodeAnalyst.Features.Refactoring; using CSharpCodeAnalyst.Shared.Messages; -using CSharpCodeAnalyst.Shared.Search; using CSharpCodeAnalyst.Shared.Services; using CSharpCodeAnalyst.Shared.Wpf; diff --git a/CSharpCodeAnalyst/Features/WebGraph/WebContextMenuFactory.cs b/CSharpCodeAnalyst/Features/WebGraph/WebContextMenuFactory.cs index f8f2dce7..e149e33c 100644 --- a/CSharpCodeAnalyst/Features/WebGraph/WebContextMenuFactory.cs +++ b/CSharpCodeAnalyst/Features/WebGraph/WebContextMenuFactory.cs @@ -1,6 +1,6 @@ using System.Windows.Controls; using System.Windows.Media; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; using CSharpCodeAnalyst.Features.Graph; namespace CSharpCodeAnalyst.Features.WebGraph; diff --git a/CSharpCodeAnalyst/Features/WebGraph/WebGraphBuilder.cs b/CSharpCodeAnalyst/Features/WebGraph/WebGraphBuilder.cs index 1feaab51..1c4e65b0 100644 --- a/CSharpCodeAnalyst/Features/WebGraph/WebGraphBuilder.cs +++ b/CSharpCodeAnalyst/Features/WebGraph/WebGraphBuilder.cs @@ -1,13 +1,13 @@ using System.Text.Json; -using CodeGraph.Colors; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Colors; +using CSharpCodeAnalyst.CodeGraph.Graph; using CSharpCodeAnalyst.Features.Graph; using CSharpCodeAnalyst.Features.Graph.Filtering; namespace CSharpCodeAnalyst.Features.WebGraph; /// -/// Transforms a into the JSON shape that +/// Transforms a into the JSON shape that /// the Cytoscape front-end (app.js / renderGraph) expects: { nodes: [...], edges: [...] }. /// It honours the presentation state (collapse/expand) and the (hidden element and /// relationship types). diff --git a/CSharpCodeAnalyst/Features/WebGraph/WebGraphControl.xaml.cs b/CSharpCodeAnalyst/Features/WebGraph/WebGraphControl.xaml.cs index 995a2343..071e0949 100644 --- a/CSharpCodeAnalyst/Features/WebGraph/WebGraphControl.xaml.cs +++ b/CSharpCodeAnalyst/Features/WebGraph/WebGraphControl.xaml.cs @@ -7,7 +7,8 @@ using System.Windows.Controls.Primitives; using System.Windows.Media.Imaging; using System.Windows.Threading; -using CodeGraph.Graph; +using CSharpCodeAnalyst.AnalyzerSdk.Contracts; +using CSharpCodeAnalyst.CodeGraph.Graph; using CSharpCodeAnalyst.Configuration; using CSharpCodeAnalyst.Features.Graph; using CSharpCodeAnalyst.Features.Graph.RenderOptions; diff --git a/CSharpCodeAnalyst/MainViewModel.cs b/CSharpCodeAnalyst/MainViewModel.cs index 7d30933d..8ff7bfd4 100644 --- a/CSharpCodeAnalyst/MainViewModel.cs +++ b/CSharpCodeAnalyst/MainViewModel.cs @@ -6,13 +6,18 @@ using System.Runtime.CompilerServices; using System.Windows; using System.Windows.Input; -using CodeGraph.Algorithms.Cycles; -using CodeGraph.Algorithms.Metrics; -using CodeGraph.Algorithms.Partitioning; -using CodeGraph.Graph; -using CodeGraph.Metrics; -using CodeParser.Parser; -using CodeParser.Parser.Config; +using CSharpCodeAnalyst.AnalyzerSdk.Contracts; +using CSharpCodeAnalyst.AnalyzerSdk.DynamicDataGrid.Contracts.TabularData; +using CSharpCodeAnalyst.AnalyzerSdk.Messages; +using CSharpCodeAnalyst.AnalyzerSdk.Notifications; +using CSharpCodeAnalyst.AnalyzerSdk.Wpf; +using CSharpCodeAnalyst.CodeGraph.Algorithms.Cycles; +using CSharpCodeAnalyst.CodeGraph.Algorithms.Metrics; +using CSharpCodeAnalyst.CodeGraph.Algorithms.Partitioning; +using CSharpCodeAnalyst.CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Metrics; +using CSharpCodeAnalyst.CodeParser.Parser; +using CSharpCodeAnalyst.CodeParser.Parser.Config; using CSharpCodeAnalyst.Configuration; using CSharpCodeAnalyst.Features.AdvancedSearch; using CSharpCodeAnalyst.Features.Ai; @@ -33,7 +38,6 @@ using CSharpCodeAnalyst.Resources; using CSharpCodeAnalyst.Shared; using CSharpCodeAnalyst.Shared.Contracts; -using CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; using CSharpCodeAnalyst.Shared.Filter; using CSharpCodeAnalyst.Shared.Messages; using CSharpCodeAnalyst.Shared.Notifications; diff --git a/CSharpCodeAnalyst/MainWindow.xaml b/CSharpCodeAnalyst/MainWindow.xaml index 7e36ed70..5796b207 100644 --- a/CSharpCodeAnalyst/MainWindow.xaml +++ b/CSharpCodeAnalyst/MainWindow.xaml @@ -25,7 +25,7 @@ - + diff --git a/CSharpCodeAnalyst/MainWindow.xaml.cs b/CSharpCodeAnalyst/MainWindow.xaml.cs index 6405a4c7..ab301292 100644 --- a/CSharpCodeAnalyst/MainWindow.xaml.cs +++ b/CSharpCodeAnalyst/MainWindow.xaml.cs @@ -6,6 +6,7 @@ using System.Windows.Controls.Ribbon; using System.Windows.Input; using System.Windows.Threading; +using CSharpCodeAnalyst.AnalyzerSdk.Contracts; using CSharpCodeAnalyst.Configuration; using CSharpCodeAnalyst.Features.Graph; using CSharpCodeAnalyst.Shared.Contracts; diff --git a/CSharpCodeAnalyst/Persistence/Dto/ProjectData.cs b/CSharpCodeAnalyst/Persistence/Dto/ProjectData.cs index 3fd8076b..b3918834 100644 --- a/CSharpCodeAnalyst/Persistence/Dto/ProjectData.cs +++ b/CSharpCodeAnalyst/Persistence/Dto/ProjectData.cs @@ -1,5 +1,5 @@ -using CodeGraph.Graph; -using CodeGraph.Metrics; +using CSharpCodeAnalyst.CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Metrics; using CSharpCodeAnalyst.Features.Gallery; namespace CSharpCodeAnalyst.Persistence.Dto; diff --git a/CSharpCodeAnalyst/Persistence/Dto/SerializableCodeElement.cs b/CSharpCodeAnalyst/Persistence/Dto/SerializableCodeElement.cs index 17150c14..68b00419 100644 --- a/CSharpCodeAnalyst/Persistence/Dto/SerializableCodeElement.cs +++ b/CSharpCodeAnalyst/Persistence/Dto/SerializableCodeElement.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CSharpCodeAnalyst.Persistence.Dto; diff --git a/CSharpCodeAnalyst/Persistence/Dto/SerializableRelationship.cs b/CSharpCodeAnalyst/Persistence/Dto/SerializableRelationship.cs index dfc63652..4ae6c982 100644 --- a/CSharpCodeAnalyst/Persistence/Dto/SerializableRelationship.cs +++ b/CSharpCodeAnalyst/Persistence/Dto/SerializableRelationship.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CSharpCodeAnalyst.Persistence.Dto; diff --git a/CSharpCodeAnalyst/Persistence/Json/ProjectService.cs b/CSharpCodeAnalyst/Persistence/Json/ProjectService.cs index 2b12a41b..22617dcb 100644 --- a/CSharpCodeAnalyst/Persistence/Json/ProjectService.cs +++ b/CSharpCodeAnalyst/Persistence/Json/ProjectService.cs @@ -1,3 +1,4 @@ +using CSharpCodeAnalyst.AnalyzerSdk.Notifications; using CSharpCodeAnalyst.Configuration; using CSharpCodeAnalyst.Features.Import; using CSharpCodeAnalyst.Persistence.Contracts; diff --git a/CSharpCodeAnalyst/Resources/Strings.Designer.cs b/CSharpCodeAnalyst/Resources/Strings.Designer.cs index 5d645868..da707f45 100644 --- a/CSharpCodeAnalyst/Resources/Strings.Designer.cs +++ b/CSharpCodeAnalyst/Resources/Strings.Designer.cs @@ -251,231 +251,6 @@ public static string AllOutgoingRelationshipsDeep { } } - /// - /// Looks up a localized string similar to Rule text cannot be empty. - /// - public static string Analyzer_Empty_Rule { - get { - return ResourceManager.GetString("Analyzer_Empty_Rule", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Architectural rules. - /// - public static string Analyzer_ArchitecturalRules_Label { - get { - return ResourceManager.GetString("Analyzer_ArchitecturalRules_Label", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Validates your architectural constraints based on user-defined rules. - /// - public static string Analyzer_ArchitecturalRules_Tooltip { - get { - return ResourceManager.GetString("Analyzer_ArchitecturalRules_Tooltip", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No rule violations found!. - /// - public static string Analyzer_ArchitecturalRules_NoData { - get { - return ResourceManager.GetString("Analyzer_ArchitecturalRules_NoData", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Error parsing rules: {0}. - /// - public static string Analyzer_ArchitecturalRules_ParseError { - get { - return ResourceManager.GetString("Analyzer_ArchitecturalRules_ParseError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Load rules. - /// - public static string ArchitecturalRules_LoadDialog_Title { - get { - return ResourceManager.GetString("ArchitecturalRules_LoadDialog_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Save rules. - /// - public static string ArchitecturalRules_SaveDialog_Title { - get { - return ResourceManager.GetString("ArchitecturalRules_SaveDialog_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Error loading file: {0}. - /// - public static string ArchitecturalRules_LoadFileError_Message { - get { - return ResourceManager.GetString("ArchitecturalRules_LoadFileError_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Error saving file: {0}. - /// - public static string ArchitecturalRules_SaveFileError_Message { - get { - return ResourceManager.GetString("ArchitecturalRules_SaveFileError_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Rules saved successfully!. - /// - public static string ArchitecturalRules_SaveFileSuccess_Message { - get { - return ResourceManager.GetString("ArchitecturalRules_SaveFileSuccess_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Are you sure you want to clear all rules?. - /// - public static string ArchitecturalRules_ClearConfirm_Message { - get { - return ResourceManager.GetString("ArchitecturalRules_ClearConfirm_Message", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Confirm Clear. - /// - public static string ArchitecturalRules_ClearConfirm_Title { - get { - return ResourceManager.GetString("ArchitecturalRules_ClearConfirm_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Rule Type. - /// - public static string Column_ArchitecturalRules_RuleType { - get { - return ResourceManager.GetString("Column_ArchitecturalRules_RuleType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Source. - /// - public static string Column_ArchitecturalRules_Source { - get { - return ResourceManager.GetString("Column_ArchitecturalRules_Source", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Target. - /// - public static string Column_ArchitecturalRules_Target { - get { - return ResourceManager.GetString("Column_ArchitecturalRules_Target", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Violations. - /// - public static string Column_ArchitecturalRules_Violations { - get { - return ResourceManager.GetString("Column_ArchitecturalRules_Violations", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Event registrations. - /// - public static string Analyzer_EventRegistration_Label { - get { - return ResourceManager.GetString("Analyzer_EventRegistration_Label", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Finds imbalances between number of event registrations / un-registrations. - /// - public static string Analyzer_EventRegistration_Tooltip { - get { - return ResourceManager.GetString("Analyzer_EventRegistration_Tooltip", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No event handler registration / un-registration imbalances found. - /// - public static string Analyzer_EventRegistration_NoData { - get { - return ResourceManager.GetString("Analyzer_EventRegistration_NoData", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Type Cohesion. - /// - public static string Analyzer_TypeCohesion_Label { - get { - return ResourceManager.GetString("Analyzer_TypeCohesion_Label", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No classes with separable partitions found. - /// - public static string Analyzer_TypeCohesion_NoData { - get { - return ResourceManager.GetString("Analyzer_TypeCohesion_NoData", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Finds classes whose members split into independent groups (partitions) — candidates for splitting. Double-click a row to view its partitions.. - /// - public static string Analyzer_TypeCohesion_Tooltip { - get { - return ResourceManager.GetString("Analyzer_TypeCohesion_Tooltip", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Type Dependencies. - /// - public static string Analyzer_TypeDependencies_Label { - get { - return ResourceManager.GetString("Analyzer_TypeDependencies_Label", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No types found to rank. - /// - public static string Analyzer_TypeDependencies_NoData { - get { - return ResourceManager.GetString("Analyzer_TypeDependencies_NoData", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Ranks types by their role in the dependency structure (fan-in, fan-out, importance). Helps you find the types to understand first.. - /// - public static string Analyzer_TypeDependencies_Tooltip { - get { - return ResourceManager.GetString("Analyzer_TypeDependencies_Tooltip", resourceCulture); - } - } - /// /// Looks up a localized string similar to Analyzers. /// @@ -503,38 +278,6 @@ public static string AppTitle { } } - /// - /// Looks up a localized string similar to Architectural rules configuration. - /// - public static string ArchitecturalRules_Title { - get { - return ResourceManager.GetString("ArchitecturalRules_Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Three rules are supported: - /// - ///DENY: Forbids dependencies from source to target - ///RESTRICT: Allows only specified dependencies - ///ISOLATE: Completely isolates the source from external dependencies - /// - ///Patterns: - ///MyApp.Business → exact match - ///MyApp.Business.* → element + direct children - ///MyApp.Business.** → element + all descendants - /// - ///Examples: - ///DENY: MyApp.Business.** -> MyApp.Data.** - ///RESTRICT: MyApp.Controllers.** -> MyApp.Services.** - ///ISOLATE: MyApp.Domain.**. - /// - public static string ArchitectureRules_Info { - get { - return ResourceManager.GetString("ArchitectureRules_Info", resourceCulture); - } - } - /// /// Looks up a localized string similar to Bottom to Top. /// @@ -634,42 +377,6 @@ public static string Cmd_RulesFile { } } - /// - /// Looks up a localized string similar to No rule violations found.. - /// - public static string Cmd_NoRuleViolations { - get { - return ResourceManager.GetString("Cmd_NoRuleViolations", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Violations. - /// - public static string Cmd_ViolationsHeader { - get { - return ResourceManager.GetString("Cmd_ViolationsHeader", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to - Rule Type: {0}. - /// - public static string Cmd_RuleTypeLine { - get { - return ResourceManager.GetString("Cmd_RuleTypeLine", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to (!) Invalid relationship with missing elements.. - /// - public static string Cmd_InvalidRelationship { - get { - return ResourceManager.GetString("Cmd_InvalidRelationship", resourceCulture); - } - } - /// /// Looks up a localized string similar to Rules file not found.. /// @@ -787,69 +494,6 @@ public static string CollapseTree_Tooltip { } } - /// - /// Looks up a localized string similar to Event handler (possible errors). - /// - public static string Column_EventRegistration_Header { - get { - return ResourceManager.GetString("Column_EventRegistration_Header", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Class. - /// - public static string Column_TypeCohesion_Class { - get { - return ResourceManager.GetString("Column_TypeCohesion_Class", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Largest %. - /// - public static string Column_TypeCohesion_LargestPartition { - get { - return ResourceManager.GetString("Column_TypeCohesion_LargestPartition", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Method Complexity. - /// - public static string Analyzer_MethodComplexity_Label { - get { - return ResourceManager.GetString("Analyzer_MethodComplexity_Label", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Lines of code and cyclomatic complexity per method. - /// - public static string Analyzer_MethodComplexity_Tooltip { - get { - return ResourceManager.GetString("Analyzer_MethodComplexity_Tooltip", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No source metrics available. - /// - public static string Analyzer_MethodComplexity_NoData { - get { - return ResourceManager.GetString("Analyzer_MethodComplexity_NoData", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Method. - /// - public static string Column_MethodComplexity_Method { - get { - return ResourceManager.GetString("Column_MethodComplexity_Method", resourceCulture); - } - } - /// /// Looks up a localized string similar to Lines. /// @@ -859,123 +503,6 @@ public static string Column_MethodComplexity_Lines { } } - /// - /// Looks up a localized string similar to Code. - /// - public static string Column_MethodComplexity_Code { - get { - return ResourceManager.GetString("Column_MethodComplexity_Code", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Statements. - /// - public static string Column_MethodComplexity_Statements { - get { - return ResourceManager.GetString("Column_MethodComplexity_Statements", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Comments. - /// - public static string Column_MethodComplexity_Comments { - get { - return ResourceManager.GetString("Column_MethodComplexity_Comments", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Comment %. - /// - public static string Column_MethodComplexity_CommentRatio { - get { - return ResourceManager.GetString("Column_MethodComplexity_CommentRatio", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Complexity. - /// - public static string Column_MethodComplexity_Complexity { - get { - return ResourceManager.GetString("Column_MethodComplexity_Complexity", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Members. - /// - public static string Column_TypeCohesion_Members { - get { - return ResourceManager.GetString("Column_TypeCohesion_Members", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Partitions. - /// - public static string Column_TypeCohesion_Partitions { - get { - return ResourceManager.GetString("Column_TypeCohesion_Partitions", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Blast radius. - /// - public static string Column_TypeDependencies_BlastRadius { - get { - return ResourceManager.GetString("Column_TypeDependencies_BlastRadius", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Type. - /// - public static string Column_TypeDependencies_Element { - get { - return ResourceManager.GetString("Column_TypeDependencies_Element", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Fan-in. - /// - public static string Column_TypeDependencies_FanIn { - get { - return ResourceManager.GetString("Column_TypeDependencies_FanIn", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Fan-out. - /// - public static string Column_TypeDependencies_FanOut { - get { - return ResourceManager.GetString("Column_TypeDependencies_FanOut", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to #. - /// - public static string Column_TypeDependencies_Rank { - get { - return ResourceManager.GetString("Column_TypeDependencies_Rank", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Score. - /// - public static string Column_TypeDependencies_Score { - get { - return ResourceManager.GetString("Column_TypeDependencies_Score", resourceCulture); - } - } - /// /// Looks up a localized string similar to Complete relationships ///If code elements are selected, adds missing relationships between them. @@ -1144,15 +671,6 @@ public static string Error_Title { } } - /// - /// Looks up a localized string similar to Success. - /// - public static string Success_Title { - get { - return ResourceManager.GetString("Success_Title", resourceCulture); - } - } - /// /// Looks up a localized string similar to ❌ Errors. /// @@ -2107,15 +1625,6 @@ public static string Message_FiltersAreActive { } } - /// - /// Looks up a localized string similar to Operation completed successfully!. - /// - public static string Message_OperationCompleted_Successful { - get { - return ResourceManager.GetString("Message_OperationCompleted_Successful", resourceCulture); - } - } - /// /// Looks up a localized string similar to Clear movement parent. /// @@ -2649,51 +2158,6 @@ public static string Restore_Tooltip { } } - /// - /// Looks up a localized string similar to _Clear. - /// - public static string Rules_Clear { - get { - return ResourceManager.GetString("Rules_Clear", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Define the architectural rules for your solution:. - /// - public static string Rules_Header { - get { - return ResourceManager.GetString("Rules_Header", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _Load from file.... - /// - public static string Rules_LoadFromFile { - get { - return ResourceManager.GetString("Rules_LoadFromFile", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Rules definition. - /// - public static string Rules_RuleDefinition { - get { - return ResourceManager.GetString("Rules_RuleDefinition", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to _Save to file.... - /// - public static string Rules_SaveToFile { - get { - return ResourceManager.GetString("Rules_SaveToFile", resourceCulture); - } - } - /// /// Looks up a localized string similar to Do you want to save the project so you don't have to import it again?. /// @@ -3161,15 +2625,6 @@ public static string Settings_WarnIfFiltersActive_Tooltip { } } - /// - /// Looks up a localized string similar to Show partitions. - /// - public static string ShowPartitions { - get { - return ResourceManager.GetString("ShowPartitions", resourceCulture); - } - } - /// /// Looks up a localized string similar to Snapshot. /// @@ -3361,15 +2816,6 @@ public static string Undo_Tooltip { } } - /// - /// Looks up a localized string similar to Save/_Validate. - /// - public static string Validate { - get { - return ResourceManager.GetString("Validate", resourceCulture); - } - } - /// /// Looks up a localized string similar to Warning. /// diff --git a/CSharpCodeAnalyst/Resources/Strings.resx b/CSharpCodeAnalyst/Resources/Strings.resx index 40c79a4a..b9d4e66a 100644 --- a/CSharpCodeAnalyst/Resources/Strings.resx +++ b/CSharpCodeAnalyst/Resources/Strings.resx @@ -443,9 +443,6 @@ If you abort the graph is maintained but not rendered. Use undo to get to the pr Error - - Success - Invalid project filter regular expression. @@ -458,9 +455,6 @@ If you abort the graph is maintained but not rendered. Use undo to get to the pr Undo - - Save/_Validate - Operation failed: {0} @@ -740,138 +734,6 @@ Search with resharper style = Use at least one uppercase character in a search t Export SVG ... - - Architectural rules - - - Validates your architectural constraints based on user-defined rules - - - No rule violations found! - - - Error parsing rules: {0} - - - Load rules - - - Save rules - - - Error loading file: {0} - - - Error saving file: {0} - - - Rules saved successfully! - - - Are you sure you want to clear all rules? - - - Confirm Clear - - - Rule Type - - - Source - - - Target - - - Violations - - - Event registrations - - - Finds imbalances between number of event registrations / un-registrations - - - No event handler registration / un-registration imbalances found - - - Type Dependencies - - - Ranks types by their role in the dependency structure (fan-in, fan-out, importance). Helps you find the types to understand first. - - - No types found to rank - - - Type Cohesion - - - Finds classes whose members split into independent groups (partitions) — candidates for splitting. Double-click a row to view its partitions. - - - No classes with separable partitions found - - - Class - - - Partitions - - - Members - - - Largest % - - - Method Complexity - - - Lines of code and cyclomatic complexity per method. Requires 'Collect source metrics on import' to be enabled before importing. - - - No source metrics available. Enable 'Collect source metrics on import' in the settings and re-import the solution. - - - Method - - - Code - - - Statements - - - Comments - - - Comment % - - - Complexity - - - Show partitions - - - # - - - Type - - - Fan-in - - - Fan-out - - - Blast radius - - - Score - Cycles @@ -881,9 +743,6 @@ Search with resharper style = Use at least one uppercase character in a search t Analyzers - - Event handler (possible errors) - Left to Right @@ -914,9 +773,6 @@ Search with resharper style = Use at least one uppercase character in a search t No data available - - Rule text cannot be empty - Copy full qualified _name @@ -947,18 +803,6 @@ Search with resharper style = Use at least one uppercase character in a search t Rules file: {0} - - No rule violations found. - - - Violations - - - - Rule Type: {0} - - - (!) Invalid relationship with missing elements. - Include _external code @@ -977,9 +821,6 @@ Search with resharper style = Use at least one uppercase character in a search t Model the getter and setter of each property as separate elements (get_Prop / set_Prop). This distinguishes read from write access and avoids false cycles caused by merging both directions onto a single property node. - - Operation completed successfully! - Hide filters are active! @@ -1061,23 +902,6 @@ Search with resharper style = Use at least one uppercase character in a search t Clear movement parent - - Three rules are supported: - -DENY: Forbids dependencies from source to target -RESTRICT: Allows only specified dependencies -ISOLATE: Completely isolates the source from external dependencies - -Patterns: -MyApp.Business → exact match -MyApp.Business.* → element + direct children -MyApp.Business.** → element + all descendants - -Examples: -DENY: MyApp.Business.** -> MyApp.Data.** -RESTRICT: MyApp.Controllers.** -> MyApp.Services.** -ISOLATE: MyApp.Domain.** - Info @@ -1120,24 +944,6 @@ ISOLATE: MyApp.Domain.** ⚠️ Warnings - - Architectural rules configuration - - - _Load from file... - - - _Clear - - - _Save to file... - - - Rules definition - - - Define the architectural rules for your solution: - Solution files (*.sln)|*.sln|Solution files (*.slnx)|*.slnx|C# project (*.csproj)|*.csproj diff --git a/CSharpCodeAnalyst/Shared/Contracts/IAnalyzerManager.cs b/CSharpCodeAnalyst/Shared/Contracts/IAnalyzerManager.cs index f60b5478..d44ce3c4 100644 --- a/CSharpCodeAnalyst/Shared/Contracts/IAnalyzerManager.cs +++ b/CSharpCodeAnalyst/Shared/Contracts/IAnalyzerManager.cs @@ -1,4 +1,6 @@ -namespace CSharpCodeAnalyst.Shared.Contracts; +using CSharpCodeAnalyst.AnalyzerSdk.Contracts; + +namespace CSharpCodeAnalyst.Shared.Contracts; public interface IAnalyzerManager { diff --git a/CSharpCodeAnalyst/Shared/DynamicDataGrid/DynamicDataGrid.xaml.cs b/CSharpCodeAnalyst/Shared/DynamicDataGrid/DynamicDataGrid.xaml.cs index 6e81e429..f21ea7a1 100644 --- a/CSharpCodeAnalyst/Shared/DynamicDataGrid/DynamicDataGrid.xaml.cs +++ b/CSharpCodeAnalyst/Shared/DynamicDataGrid/DynamicDataGrid.xaml.cs @@ -10,9 +10,9 @@ using System.Windows.Markup; using System.Windows.Media; using System.Windows.Threading; +using CSharpCodeAnalyst.AnalyzerSdk.DynamicDataGrid.Contracts.TabularData; using CSharpCodeAnalyst.Resources; using CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.Attributes; -using CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; namespace CSharpCodeAnalyst.Shared.DynamicDataGrid; diff --git a/CSharpCodeAnalyst/Shared/Filter/FilterDialog.xaml.cs b/CSharpCodeAnalyst/Shared/Filter/FilterDialog.xaml.cs index 4df39b65..b5392ec2 100644 --- a/CSharpCodeAnalyst/Shared/Filter/FilterDialog.xaml.cs +++ b/CSharpCodeAnalyst/Shared/Filter/FilterDialog.xaml.cs @@ -1,6 +1,6 @@ using System.Text.RegularExpressions; using System.Windows; -using CodeParser.Parser.Config; +using CSharpCodeAnalyst.CodeParser.Parser.Config; using CSharpCodeAnalyst.Resources; namespace CSharpCodeAnalyst.Shared.Filter; diff --git a/CSharpCodeAnalyst/Shared/Messages/CodeElementIconMapper.cs b/CSharpCodeAnalyst/Shared/Messages/CodeElementIconMapper.cs index 1fb297fa..582eab77 100644 --- a/CSharpCodeAnalyst/Shared/Messages/CodeElementIconMapper.cs +++ b/CSharpCodeAnalyst/Shared/Messages/CodeElementIconMapper.cs @@ -1,5 +1,5 @@ using System.Windows.Media.Imaging; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CSharpCodeAnalyst.Shared.Messages; diff --git a/CSharpCodeAnalyst/Shared/Messages/CodeGraphRefactored.cs b/CSharpCodeAnalyst/Shared/Messages/CodeGraphRefactored.cs index 689faf11..35f6a050 100644 --- a/CSharpCodeAnalyst/Shared/Messages/CodeGraphRefactored.cs +++ b/CSharpCodeAnalyst/Shared/Messages/CodeGraphRefactored.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CSharpCodeAnalyst.Shared.Messages; diff --git a/CSharpCodeAnalyst/Shared/Messages/CycleCalculationComplete.cs b/CSharpCodeAnalyst/Shared/Messages/CycleCalculationComplete.cs index 74404038..f5f0368d 100644 --- a/CSharpCodeAnalyst/Shared/Messages/CycleCalculationComplete.cs +++ b/CSharpCodeAnalyst/Shared/Messages/CycleCalculationComplete.cs @@ -1,4 +1,4 @@ -using CodeGraph.Algorithms.Cycles; +using CSharpCodeAnalyst.CodeGraph.Algorithms.Cycles; namespace CSharpCodeAnalyst.Shared.Messages; diff --git a/CSharpCodeAnalyst/Shared/Messages/MessageBus.cs b/CSharpCodeAnalyst/Shared/Messages/MessageBus.cs index 9c2aaeb4..0f0f86f9 100644 --- a/CSharpCodeAnalyst/Shared/Messages/MessageBus.cs +++ b/CSharpCodeAnalyst/Shared/Messages/MessageBus.cs @@ -1,4 +1,5 @@ -using CSharpCodeAnalyst.Shared.Contracts; +using CSharpCodeAnalyst.AnalyzerSdk.Contracts; +using CSharpCodeAnalyst.Shared.Contracts; namespace CSharpCodeAnalyst.Shared.Messages; diff --git a/CSharpCodeAnalyst/Shared/Messages/ShowCycleGroupRequest.cs b/CSharpCodeAnalyst/Shared/Messages/ShowCycleGroupRequest.cs index 611303ef..be805b67 100644 --- a/CSharpCodeAnalyst/Shared/Messages/ShowCycleGroupRequest.cs +++ b/CSharpCodeAnalyst/Shared/Messages/ShowCycleGroupRequest.cs @@ -1,4 +1,4 @@ -using CodeGraph.Algorithms.Cycles; +using CSharpCodeAnalyst.CodeGraph.Algorithms.Cycles; namespace CSharpCodeAnalyst.Shared.Messages; diff --git a/CSharpCodeAnalyst/Shared/Notifications/ConsoleUserNotification.cs b/CSharpCodeAnalyst/Shared/Notifications/ConsoleUserNotification.cs index 5677b659..aaf2bae2 100644 --- a/CSharpCodeAnalyst/Shared/Notifications/ConsoleUserNotification.cs +++ b/CSharpCodeAnalyst/Shared/Notifications/ConsoleUserNotification.cs @@ -1,4 +1,5 @@ using System.Diagnostics; +using CSharpCodeAnalyst.AnalyzerSdk.Notifications; namespace CSharpCodeAnalyst.Shared.Notifications; diff --git a/CSharpCodeAnalyst/Shared/Notifications/WindowsUserNotification.cs b/CSharpCodeAnalyst/Shared/Notifications/WindowsUserNotification.cs index 3cad1eeb..1c6f5091 100644 --- a/CSharpCodeAnalyst/Shared/Notifications/WindowsUserNotification.cs +++ b/CSharpCodeAnalyst/Shared/Notifications/WindowsUserNotification.cs @@ -1,4 +1,5 @@ using System.Windows; +using CSharpCodeAnalyst.AnalyzerSdk.Notifications; using CSharpCodeAnalyst.Resources; using CSharpCodeAnalyst.Shared.UI; using Microsoft.Win32; diff --git a/CSharpCodeAnalyst/Shared/QuickInfo.cs b/CSharpCodeAnalyst/Shared/QuickInfo.cs index 5045d21e..df317a4b 100644 --- a/CSharpCodeAnalyst/Shared/QuickInfo.cs +++ b/CSharpCodeAnalyst/Shared/QuickInfo.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CSharpCodeAnalyst.Shared; diff --git a/CSharpCodeAnalyst/Shared/Services/SourceLocationNavigator.cs b/CSharpCodeAnalyst/Shared/Services/SourceLocationNavigator.cs index d7800a16..36e3cdfa 100644 --- a/CSharpCodeAnalyst/Shared/Services/SourceLocationNavigator.cs +++ b/CSharpCodeAnalyst/Shared/Services/SourceLocationNavigator.cs @@ -2,7 +2,7 @@ using System.IO; using System.Runtime.InteropServices; using System.Windows; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; using CSharpCodeAnalyst.Resources; namespace CSharpCodeAnalyst.Shared.Services; diff --git a/CSharpCodeAnalyst/Shared/Tabs/DynamicTabViewModel.cs b/CSharpCodeAnalyst/Shared/Tabs/DynamicTabViewModel.cs index 13536566..720c309e 100644 --- a/CSharpCodeAnalyst/Shared/Tabs/DynamicTabViewModel.cs +++ b/CSharpCodeAnalyst/Shared/Tabs/DynamicTabViewModel.cs @@ -1,7 +1,7 @@ using System.ComponentModel; using System.Runtime.CompilerServices; using System.Windows.Input; -using CSharpCodeAnalyst.Shared.DynamicDataGrid.Contracts.TabularData; +using CSharpCodeAnalyst.AnalyzerSdk.DynamicDataGrid.Contracts.TabularData; namespace CSharpCodeAnalyst.Shared.Tabs; diff --git a/CSharpCodeAnalyst/Shared/UI/CodeElementLineViewModel.cs b/CSharpCodeAnalyst/Shared/UI/CodeElementLineViewModel.cs index a11537e4..26b5272e 100644 --- a/CSharpCodeAnalyst/Shared/UI/CodeElementLineViewModel.cs +++ b/CSharpCodeAnalyst/Shared/UI/CodeElementLineViewModel.cs @@ -1,5 +1,5 @@ using System.Windows.Media.Imaging; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; using CSharpCodeAnalyst.Shared.Messages; namespace CSharpCodeAnalyst.Shared.UI; diff --git a/CSharpCodeAnalyst/Shared/UI/ToastNotification.xaml b/CSharpCodeAnalyst/Shared/UI/ToastNotification.xaml index fcd6b4d0..941de6c8 100644 --- a/CSharpCodeAnalyst/Shared/UI/ToastNotification.xaml +++ b/CSharpCodeAnalyst/Shared/UI/ToastNotification.xaml @@ -1,7 +1,6 @@ diff --git a/CSharpCodeAnalyst/Shared/Wpf/IconLoader.cs b/CSharpCodeAnalyst/Shared/Wpf/IconLoader.cs deleted file mode 100644 index 8522aae1..00000000 --- a/CSharpCodeAnalyst/Shared/Wpf/IconLoader.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Windows.Media; -using System.Windows.Media.Imaging; - -namespace CSharpCodeAnalyst.Shared.Wpf; - -internal static class IconLoader -{ - private static readonly Dictionary IconCache = new(); - - public static ImageSource? LoadIcon(string iconPath) - { - try - { - if (IconCache.TryGetValue(iconPath, out var icon)) - { - return icon; - } - - var bitmap = new BitmapImage(); - bitmap.BeginInit(); - bitmap.UriSource = new Uri($"pack://application:,,,/{iconPath}"); - bitmap.DecodePixelWidth = 16; - bitmap.DecodePixelHeight = 16; - bitmap.CacheOption = BitmapCacheOption.OnLoad; - bitmap.EndInit(); - bitmap.Freeze(); - - IconCache[iconPath] = bitmap; - return bitmap; - } - catch - { - return null; - } - } -} \ No newline at end of file diff --git a/Tests/ApprovalTests/ApprovalTestBase.cs b/Tests/ApprovalTests/ApprovalTestBase.cs index c2198d9b..fc585285 100644 --- a/Tests/ApprovalTests/ApprovalTestBase.cs +++ b/Tests/ApprovalTests/ApprovalTestBase.cs @@ -1,6 +1,6 @@ -using CodeGraph.Graph; -using CodeParser.Parser; -using CodeParser.Parser.Config; +using CSharpCodeAnalyst.CodeGraph.Graph; +using CSharpCodeAnalyst.CodeParser.Parser; +using CSharpCodeAnalyst.CodeParser.Parser.Config; namespace CodeParserTests.ApprovalTests; @@ -33,7 +33,7 @@ public override int GetHashCode() internal static class Init { - private static CodeGraph.Graph.CodeGraph? _instance; + private static CodeGraph? _instance; static Init() { @@ -41,7 +41,7 @@ static Init() Initializer.InitializeMsBuildLocator(); } - public static async Task LoadAsync() + public static async Task LoadAsync() { if (_instance == null) { @@ -61,7 +61,7 @@ static Init() public abstract class ApprovalTestBase { - protected CodeGraph.Graph.CodeGraph Graph = null!; + protected CodeGraph Graph = null!; public static string DumpRelationships(HashSet relationships) @@ -76,17 +76,17 @@ public static string DumpCodeElements(HashSet nodes) return formattedNodes; } - protected HashSet GetAllStructs(CodeGraph.Graph.CodeGraph graph) + protected HashSet GetAllStructs(CodeGraph graph) { return GetElementOfType(graph, CodeElementType.Struct); } - protected HashSet GetAllEnums(CodeGraph.Graph.CodeGraph graph) + protected HashSet GetAllEnums(CodeGraph graph) { return GetElementOfType(graph, CodeElementType.Enum); } - protected HashSet GetAllProperties(CodeGraph.Graph.CodeGraph graph) + protected HashSet GetAllProperties(CodeGraph graph) { return GetElementOfType(graph, CodeElementType.Property); } @@ -101,7 +101,7 @@ protected bool IsInProject(CodeElement element, string projectFilter) return element.FullName.StartsWith(projectFilter); } - protected CodeGraph.Graph.CodeGraph GetTestGraph(string rootElementName) + protected CodeGraph GetTestGraph(string rootElementName) { var root = Graph.Nodes.Values.Single(n => n.FullName == rootElementName); return Graph.SubGraphOf(root); @@ -113,31 +113,31 @@ public async Task FixtureSetup() Graph = await Init.LoadAsync(); } - protected HashSet GetAllClasses(CodeGraph.Graph.CodeGraph graph) + protected HashSet GetAllClasses(CodeGraph graph) { return GetElementOfType(graph, CodeElementType.Class); } - protected HashSet GetAllClasses(CodeGraph.Graph.CodeGraph graph, string inNamespace) + protected HashSet GetAllClasses(CodeGraph graph, string inNamespace) { return GetElementOfType(graph, CodeElementType.Class, inNamespace); } - protected static HashSet GetAllNodes(CodeGraph.Graph.CodeGraph graph) + protected static HashSet GetAllNodes(CodeGraph graph) { return graph.Nodes.Values .Select(n => n.FullName) .ToHashSet(); } - protected static HashSet GetAllNodesOfType(CodeGraph.Graph.CodeGraph graph, CodeElementType type) + protected static HashSet GetAllNodesOfType(CodeGraph graph, CodeElementType type) { return graph.Nodes.Values.Where(n => n.ElementType == type) .Select(n => n.FullName) .ToHashSet(); } - private static HashSet GetElementOfType(CodeGraph.Graph.CodeGraph graph, CodeElementType type, string? inNamespace = null!) + private static HashSet GetElementOfType(CodeGraph graph, CodeElementType type, string? inNamespace = null!) { var elements = graph.Nodes.Values .Where(n => n.ElementType == type); @@ -151,7 +151,7 @@ private static HashSet GetElementOfType(CodeGraph.Graph.CodeGraph graph, .ToHashSet(); } - public HashSet GetAllMethodGroupUsages(CodeGraph.Graph.CodeGraph graph) + public HashSet GetAllMethodGroupUsages(CodeGraph graph) { return graph.GetAllRelationships() .Where(r => r.Type == RelationshipType.Uses && r.Attributes.HasFlag(RelationshipAttribute.IsMethodGroup)) @@ -160,7 +160,7 @@ public HashSet GetAllMethodGroupUsages(CodeGraph.Graph.CodeGraph graph) .ToHashSet(); } - public HashSet GetRelationshipsOfType(CodeGraph.Graph.CodeGraph graph, RelationshipType type) + public HashSet GetRelationshipsOfType(CodeGraph graph, RelationshipType type) { return graph.GetAllRelationships() .Where(r => r.Type == type) @@ -169,7 +169,7 @@ public HashSet GetRelationshipsOfType(CodeGraph.Graph.CodeGraph graph, R .ToHashSet(); } - protected HashSet GetAllRelationships(CodeGraph.Graph.CodeGraph graph) + protected HashSet GetAllRelationships(CodeGraph graph) { return graph.GetAllRelationships() .Select(CreateResolvedRelationShip) @@ -185,7 +185,7 @@ public ResolvedRelationship CreateResolvedRelationShip(Relationship relationship return new ResolvedRelationship(Graph.Nodes[relationship.SourceId].FullName, Graph.Nodes[relationship.TargetId].FullName); } - public static HashSet GetAllEventImplementations(CodeGraph.Graph.CodeGraph graph) + public static HashSet GetAllEventImplementations(CodeGraph graph) { var actual = graph.Nodes.Values .SelectMany(n => n.Relationships) @@ -198,7 +198,7 @@ public static HashSet GetAllEventImplementations(CodeGraph.Graph.CodeGra return actual; } - public static HashSet GetAllPropertyOverrides(CodeGraph.Graph.CodeGraph graph) + public static HashSet GetAllPropertyOverrides(CodeGraph graph) { var actual = graph.Nodes.Values .SelectMany(n => n.Relationships) @@ -211,7 +211,7 @@ public static HashSet GetAllPropertyOverrides(CodeGraph.Graph.CodeGraph return actual; } - protected static HashSet GetAllPropertyImplementations(CodeGraph.Graph.CodeGraph graph) + protected static HashSet GetAllPropertyImplementations(CodeGraph graph) { var actual = graph.Nodes.Values .SelectMany(n => n.Relationships) @@ -224,7 +224,7 @@ protected static HashSet GetAllPropertyImplementations(CodeGraph.Graph.C return actual; } - protected static HashSet GetAllMethodImplementations(CodeGraph.Graph.CodeGraph graph) + protected static HashSet GetAllMethodImplementations(CodeGraph graph) { var actual = graph.Nodes.Values .SelectMany(n => n.Relationships) @@ -237,7 +237,7 @@ protected static HashSet GetAllMethodImplementations(CodeGraph.Graph.Cod return actual; } - protected static HashSet GetAllMethodOverrides(CodeGraph.Graph.CodeGraph graph) + protected static HashSet GetAllMethodOverrides(CodeGraph graph) { var actual = graph.Nodes.Values .SelectMany(n => n.Relationships) @@ -250,7 +250,7 @@ protected static HashSet GetAllMethodOverrides(CodeGraph.Graph.CodeGraph return actual; } - public static HashSet GetAllEventInvocations(CodeGraph.Graph.CodeGraph graph) + public static HashSet GetAllEventInvocations(CodeGraph graph) { var actual = graph.Nodes.Values .SelectMany(n => n.Relationships) @@ -261,7 +261,7 @@ public static HashSet GetAllEventInvocations(CodeGraph.Graph.CodeGraph g return actual; } - protected static HashSet GetAllInterfaceImplementations(CodeGraph.Graph.CodeGraph graph) + protected static HashSet GetAllInterfaceImplementations(CodeGraph graph) { var actual = graph.Nodes.Values .SelectMany(n => n.Relationships) @@ -275,7 +275,7 @@ protected static HashSet GetAllInterfaceImplementations(CodeGraph.Graph. return actual; } - protected static HashSet GetAllClassInheritance(CodeGraph.Graph.CodeGraph graph) + protected static HashSet GetAllClassInheritance(CodeGraph graph) { var actual = graph.Nodes.Values .SelectMany(n => n.Relationships) diff --git a/Tests/ApprovalTests/ModuleLevelApprovalTests.cs b/Tests/ApprovalTests/ModuleLevelApprovalTests.cs index 5b28dbd7..3d937009 100644 --- a/Tests/ApprovalTests/ModuleLevelApprovalTests.cs +++ b/Tests/ApprovalTests/ModuleLevelApprovalTests.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.ApprovalTests; @@ -6,7 +6,7 @@ namespace CodeParserTests.ApprovalTests; public class ModuleLevelApprovalTests : ApprovalTestBase { - private CodeGraph.Graph.CodeGraph GetTestAssemblyGraph() + private CodeGraph GetTestAssemblyGraph() { var g0 = GetTestGraph("ModuleLevel0"); var g1 = GetTestGraph("ModuleLevel1"); diff --git a/Tests/ApprovalTests/OldCSharpLanguageApprovalTests.cs b/Tests/ApprovalTests/OldCSharpLanguageApprovalTests.cs index 51acf745..ff50ae94 100644 --- a/Tests/ApprovalTests/OldCSharpLanguageApprovalTests.cs +++ b/Tests/ApprovalTests/OldCSharpLanguageApprovalTests.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; // ReSharper disable StringLiteralTypo @@ -9,7 +9,7 @@ namespace CodeParserTests.ApprovalTests; /// public class OldCSharpLanguageApprovalTests : ApprovalTestBase { - private CodeGraph.Graph.CodeGraph GetTestAssemblyGraph() + private CodeGraph GetTestAssemblyGraph() { return GetTestGraph("Old.CSharpLanguage"); } @@ -330,7 +330,7 @@ public void FindsAllEventUsages() Assert.That(actual, Is.EquivalentTo(expected)); } - private static HashSet GetAllEventUsages(CodeGraph.Graph.CodeGraph graph) + private static HashSet GetAllEventUsages(CodeGraph graph) { var actual = graph.Nodes.Values .SelectMany(n => n.Relationships) diff --git a/Tests/ApprovalTests/SolutionApprovalTest.cs b/Tests/ApprovalTests/SolutionApprovalTest.cs index 3020b22a..9c1e221d 100644 --- a/Tests/ApprovalTests/SolutionApprovalTest.cs +++ b/Tests/ApprovalTests/SolutionApprovalTest.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.ApprovalTests; diff --git a/Tests/Helper/TestCodeGraph.cs b/Tests/Helper/TestCodeGraph.cs index ebd7c625..9d1f7c9f 100644 --- a/Tests/Helper/TestCodeGraph.cs +++ b/Tests/Helper/TestCodeGraph.cs @@ -1,8 +1,8 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.Helper; -public class TestCodeGraph : CodeGraph.Graph.CodeGraph +public class TestCodeGraph : CodeGraph { public CodeElement CreateNamespace(string id, CodeElement? parent = null) { diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 24238688..fa33901b 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -21,9 +21,11 @@ - - + + + + diff --git a/Tests/UnitTests/ArchitecturalRules/AnalyzerIntegrationTests.cs b/Tests/UnitTests/ArchitecturalRules/AnalyzerIntegrationTests.cs index 205fb0a0..c7b64be3 100644 --- a/Tests/UnitTests/ArchitecturalRules/AnalyzerIntegrationTests.cs +++ b/Tests/UnitTests/ArchitecturalRules/AnalyzerIntegrationTests.cs @@ -1,7 +1,7 @@ -using CodeGraph.Graph; using CodeParserTests.Helper; -using CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules; -using CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Rules; +using CSharpCodeAnalyst.Analyzers.ArchitecturalRules; +using CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Rules; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.ArchitecturalRules; @@ -17,7 +17,7 @@ public void SetUp() private TestCodeGraph _codeGraph; - private static List ExecuteRulesAnalysis(string rulesText, CodeGraph.Graph.CodeGraph graph) + private static List ExecuteRulesAnalysis(string rulesText, CodeGraph graph) { var rules = RuleParser.ParseRules(rulesText); var violations = new List(); diff --git a/Tests/UnitTests/ArchitecturalRules/PatternMatcherTests.cs b/Tests/UnitTests/ArchitecturalRules/PatternMatcherTests.cs index eb113ac5..63e8f0f7 100644 --- a/Tests/UnitTests/ArchitecturalRules/PatternMatcherTests.cs +++ b/Tests/UnitTests/ArchitecturalRules/PatternMatcherTests.cs @@ -1,5 +1,5 @@ using CodeParserTests.Helper; -using CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules; +using CSharpCodeAnalyst.Analyzers.ArchitecturalRules; namespace CodeParserTests.UnitTests.ArchitecturalRules; diff --git a/Tests/UnitTests/ArchitecturalRules/RuleParserTests.cs b/Tests/UnitTests/ArchitecturalRules/RuleParserTests.cs index a5059453..00cb892a 100644 --- a/Tests/UnitTests/ArchitecturalRules/RuleParserTests.cs +++ b/Tests/UnitTests/ArchitecturalRules/RuleParserTests.cs @@ -1,5 +1,5 @@ -using CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules; -using CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Rules; +using CSharpCodeAnalyst.Analyzers.ArchitecturalRules; +using CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Rules; namespace CodeParserTests.UnitTests.ArchitecturalRules; diff --git a/Tests/UnitTests/ArchitecturalRules/RuleValidationTests.cs b/Tests/UnitTests/ArchitecturalRules/RuleValidationTests.cs index 2a26c0ed..470eb012 100644 --- a/Tests/UnitTests/ArchitecturalRules/RuleValidationTests.cs +++ b/Tests/UnitTests/ArchitecturalRules/RuleValidationTests.cs @@ -1,6 +1,6 @@ -using CodeGraph.Graph; using CodeParserTests.Helper; -using CSharpCodeAnalyst.Features.Analyzers.ArchitecturalRules.Rules; +using CSharpCodeAnalyst.Analyzers.ArchitecturalRules.Rules; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.ArchitecturalRules; diff --git a/Tests/UnitTests/Cycles/CodeGraphBuilderTests.cs b/Tests/UnitTests/Cycles/CodeGraphBuilderTests.cs index b8dac4a2..37002f84 100644 --- a/Tests/UnitTests/Cycles/CodeGraphBuilderTests.cs +++ b/Tests/UnitTests/Cycles/CodeGraphBuilderTests.cs @@ -1,5 +1,5 @@ -using CodeGraph.Algorithms.Cycles; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Algorithms.Cycles; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Cycles; @@ -12,7 +12,7 @@ public class CodeGraphGeneratorTests [Test] public void GenerateDetailedCodeGraph_SimpleClassDependency_PreservesDependency() { - var originalGraph = new CodeGraph.Graph.CodeGraph(); + var originalGraph = new CodeGraph(); var classA = new CodeElement("A", CodeElementType.Class, "ClassA", "", null); @@ -38,7 +38,7 @@ public void GenerateDetailedCodeGraph_SimpleClassDependency_PreservesDependency( [Test] public void GenerateDetailedCodeGraph_MethodDependency_PreservesMethodLevelDependency() { - var originalGraph = new CodeGraph.Graph.CodeGraph(); + var originalGraph = new CodeGraph(); var classA = new CodeElement("A", CodeElementType.Class, "ClassA", "", null); @@ -75,7 +75,7 @@ public void GenerateDetailedCodeGraph_MethodDependency_PreservesMethodLevelDepen [Test] public void GenerateDetailedCodeGraph_MultipleDependencies_PreservesAllDependencies() { - var originalGraph = new CodeGraph.Graph.CodeGraph(); + var originalGraph = new CodeGraph(); var classA = new CodeElement("A", CodeElementType.Class, "ClassA", "", null); diff --git a/Tests/UnitTests/Cycles/CycleFinderTests.cs b/Tests/UnitTests/Cycles/CycleFinderTests.cs index 72f0a5a0..09ba8982 100644 --- a/Tests/UnitTests/Cycles/CycleFinderTests.cs +++ b/Tests/UnitTests/Cycles/CycleFinderTests.cs @@ -1,6 +1,6 @@ -using CodeGraph.Algorithms.Cycles; -using CodeGraph.Graph; -using CodeParserTests.Helper; +using CodeParserTests.Helper; +using CSharpCodeAnalyst.CodeGraph.Algorithms.Cycles; +using CSharpCodeAnalyst.CodeGraph.Graph; // ReSharper disable InconsistentNaming @@ -352,9 +352,9 @@ public void FindStronglyConnectedComponents_ShouldFindSCC() Assert.That(scc.CodeGraph.Nodes.ContainsKey("C")); } - private static CodeGraph.Graph.CodeGraph CreateCodeGraphForShouldFindScc() + private static CodeGraph CreateCodeGraphForShouldFindScc() { - var codeStructure = new CodeGraph.Graph.CodeGraph(); + var codeStructure = new CodeGraph(); // Create nodes var nodeA = new CodeElement("A", CodeElementType.Class, diff --git a/Tests/UnitTests/Cycles/TarjanTests.cs b/Tests/UnitTests/Cycles/TarjanTests.cs index 3ba5075d..0959ce92 100644 --- a/Tests/UnitTests/Cycles/TarjanTests.cs +++ b/Tests/UnitTests/Cycles/TarjanTests.cs @@ -1,4 +1,4 @@ -using CodeGraph.Algorithms.Cycles; +using CSharpCodeAnalyst.CodeGraph.Algorithms.Cycles; namespace CodeParserTests.UnitTests.Cycles; diff --git a/Tests/UnitTests/Exploration/CodeGraphExplorerTests.cs b/Tests/UnitTests/Exploration/CodeGraphExplorerTests.cs index 5ea1cf80..718f867f 100644 --- a/Tests/UnitTests/Exploration/CodeGraphExplorerTests.cs +++ b/Tests/UnitTests/Exploration/CodeGraphExplorerTests.cs @@ -1,6 +1,6 @@ -using CodeGraph.Exploration; -using CodeGraph.Graph; using CodeParserTests.Helper; +using CSharpCodeAnalyst.CodeGraph.Exploration; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Exploration; diff --git a/Tests/UnitTests/Export/CodeGraphSerializerTests.cs b/Tests/UnitTests/Export/CodeGraphSerializerTests.cs index f9ce0905..05cafcae 100644 --- a/Tests/UnitTests/Export/CodeGraphSerializerTests.cs +++ b/Tests/UnitTests/Export/CodeGraphSerializerTests.cs @@ -1,15 +1,15 @@ using System.Text; -using CodeGraph.Export; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Export; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Export; [TestFixture] public class CodeGraphSerializerTests { - private CodeGraph.Graph.CodeGraph CreateSampleGraph() + private CodeGraph CreateSampleGraph() { - var g = new CodeGraph.Graph.CodeGraph(); + var g = new CodeGraph(); var asm = new CodeElement("Asm", CodeElementType.Assembly, "Asm", "Asm", null); var ns = new CodeElement("Ns", CodeElementType.Namespace, "Ns", "Ns", asm); var cls = new CodeElement("Cls", CodeElementType.Class, "Cls", "Ns.Cls", ns); diff --git a/Tests/UnitTests/Export/PlantUmlExportTests.cs b/Tests/UnitTests/Export/PlantUmlExportTests.cs index db012469..28eb4e83 100644 --- a/Tests/UnitTests/Export/PlantUmlExportTests.cs +++ b/Tests/UnitTests/Export/PlantUmlExportTests.cs @@ -1,13 +1,13 @@ -using CodeGraph.Export; -using CodeGraph.Graph; using CodeParserTests.Helper; +using CSharpCodeAnalyst.CodeGraph.Export; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Export; [TestFixture] public class PlantUmlExportTests { - private static string Export(CodeGraph.Graph.CodeGraph g) + private static string Export(CodeGraph g) { var exporter = new PlantUmlExport(); return exporter.Export(g); diff --git a/Tests/UnitTests/Import/JdepsReaderTest.cs b/Tests/UnitTests/Import/JdepsReaderTest.cs index 962c7e90..cc7f8360 100644 --- a/Tests/UnitTests/Import/JdepsReaderTest.cs +++ b/Tests/UnitTests/Import/JdepsReaderTest.cs @@ -1,5 +1,5 @@ using System.Text; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; using CSharpCodeAnalyst.Features.Import; namespace CodeParserTests.UnitTests.Import; diff --git a/Tests/UnitTests/Metrics/TypeCohesionAnalysisTests.cs b/Tests/UnitTests/Metrics/TypeCohesionAnalysisTests.cs index 3090805c..a074aa9b 100644 --- a/Tests/UnitTests/Metrics/TypeCohesionAnalysisTests.cs +++ b/Tests/UnitTests/Metrics/TypeCohesionAnalysisTests.cs @@ -1,6 +1,6 @@ -using CodeGraph.Algorithms.Partitioning; -using CodeGraph.Graph; using CodeParserTests.Helper; +using CSharpCodeAnalyst.CodeGraph.Algorithms.Partitioning; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Metrics; diff --git a/Tests/UnitTests/Metrics/TypeDependencyAnalysisTests.cs b/Tests/UnitTests/Metrics/TypeDependencyAnalysisTests.cs index 02faf26f..35210b05 100644 --- a/Tests/UnitTests/Metrics/TypeDependencyAnalysisTests.cs +++ b/Tests/UnitTests/Metrics/TypeDependencyAnalysisTests.cs @@ -1,6 +1,6 @@ -using CodeGraph.Algorithms.Metrics; -using CodeGraph.Graph; using CodeParserTests.Helper; +using CSharpCodeAnalyst.CodeGraph.Algorithms.Metrics; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Metrics; diff --git a/Tests/UnitTests/Parser/AssignmentDuplicateParseTests.cs b/Tests/UnitTests/Parser/AssignmentDuplicateParseTests.cs index c431ba77..b440942d 100644 --- a/Tests/UnitTests/Parser/AssignmentDuplicateParseTests.cs +++ b/Tests/UnitTests/Parser/AssignmentDuplicateParseTests.cs @@ -1,5 +1,5 @@ -using CodeGraph.Graph; -using CodeParser.Parser.Config; +using CSharpCodeAnalyst.CodeGraph.Graph; +using CSharpCodeAnalyst.CodeParser.Parser.Config; namespace CodeParserTests.UnitTests.Parser; @@ -30,13 +30,13 @@ public void TestMethod() } """; - private CodeGraph.Graph.CodeGraph _graph = null!; + private CodeGraph _graph = null!; [OneTimeSetUp] public async Task Setup() { // Split off to mirror the original parser configuration of this scenario. - var parser = new CodeParser.Parser.Parser(new ParserConfig(new ProjectExclusionRegExCollection(), false)); + var parser = new CSharpCodeAnalyst.CodeParser.Parser.Parser(new ParserConfig(new ProjectExclusionRegExCollection(), false)); var result = await parser.ParseSourceAsync(Code); _graph = result.CodeGraph; } diff --git a/Tests/UnitTests/Parser/BasicLanguageFeatures_BasicCallsParseTests.cs b/Tests/UnitTests/Parser/BasicLanguageFeatures_BasicCallsParseTests.cs index 5175bd1b..3e85f993 100644 --- a/Tests/UnitTests/Parser/BasicLanguageFeatures_BasicCallsParseTests.cs +++ b/Tests/UnitTests/Parser/BasicLanguageFeatures_BasicCallsParseTests.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Parser; diff --git a/Tests/UnitTests/Parser/BasicLanguageFeatures_IndexersAndOperatorsParseTests.cs b/Tests/UnitTests/Parser/BasicLanguageFeatures_IndexersAndOperatorsParseTests.cs index 10d9de55..e382645e 100644 --- a/Tests/UnitTests/Parser/BasicLanguageFeatures_IndexersAndOperatorsParseTests.cs +++ b/Tests/UnitTests/Parser/BasicLanguageFeatures_IndexersAndOperatorsParseTests.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Parser; diff --git a/Tests/UnitTests/Parser/BasicLanguageFeatures_InheritanceParseTests.cs b/Tests/UnitTests/Parser/BasicLanguageFeatures_InheritanceParseTests.cs index 701f0f24..e66de675 100644 --- a/Tests/UnitTests/Parser/BasicLanguageFeatures_InheritanceParseTests.cs +++ b/Tests/UnitTests/Parser/BasicLanguageFeatures_InheritanceParseTests.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Parser; diff --git a/Tests/UnitTests/Parser/BasicLanguageFeatures_InitializersParseTests.cs b/Tests/UnitTests/Parser/BasicLanguageFeatures_InitializersParseTests.cs index 93d55696..40076d87 100644 --- a/Tests/UnitTests/Parser/BasicLanguageFeatures_InitializersParseTests.cs +++ b/Tests/UnitTests/Parser/BasicLanguageFeatures_InitializersParseTests.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Parser; diff --git a/Tests/UnitTests/Parser/BasicLanguageFeatures_OverloadsParseTests.cs b/Tests/UnitTests/Parser/BasicLanguageFeatures_OverloadsParseTests.cs index aed308e2..3b29e717 100644 --- a/Tests/UnitTests/Parser/BasicLanguageFeatures_OverloadsParseTests.cs +++ b/Tests/UnitTests/Parser/BasicLanguageFeatures_OverloadsParseTests.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Parser; diff --git a/Tests/UnitTests/Parser/BasicLanguageFeatures_PatternMatchingParseTests.cs b/Tests/UnitTests/Parser/BasicLanguageFeatures_PatternMatchingParseTests.cs index 871b7ff3..d9d46c78 100644 --- a/Tests/UnitTests/Parser/BasicLanguageFeatures_PatternMatchingParseTests.cs +++ b/Tests/UnitTests/Parser/BasicLanguageFeatures_PatternMatchingParseTests.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Parser; diff --git a/Tests/UnitTests/Parser/BasicLanguageFeatures_StructsAndEnumsParseTests.cs b/Tests/UnitTests/Parser/BasicLanguageFeatures_StructsAndEnumsParseTests.cs index 4b0039d4..561318e5 100644 --- a/Tests/UnitTests/Parser/BasicLanguageFeatures_StructsAndEnumsParseTests.cs +++ b/Tests/UnitTests/Parser/BasicLanguageFeatures_StructsAndEnumsParseTests.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Parser; diff --git a/Tests/UnitTests/Parser/BasicLanguageFeatures_TypeContextsParseTests.cs b/Tests/UnitTests/Parser/BasicLanguageFeatures_TypeContextsParseTests.cs index 01ce98fb..282ad0aa 100644 --- a/Tests/UnitTests/Parser/BasicLanguageFeatures_TypeContextsParseTests.cs +++ b/Tests/UnitTests/Parser/BasicLanguageFeatures_TypeContextsParseTests.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Parser; diff --git a/Tests/UnitTests/Parser/EventDeRegistrationInLambdaParseTests.cs b/Tests/UnitTests/Parser/EventDeRegistrationInLambdaParseTests.cs index d9538999..db5e32a9 100644 --- a/Tests/UnitTests/Parser/EventDeRegistrationInLambdaParseTests.cs +++ b/Tests/UnitTests/Parser/EventDeRegistrationInLambdaParseTests.cs @@ -1,5 +1,5 @@ -using CodeGraph.Graph; -using CodeParser.Parser.Config; +using CSharpCodeAnalyst.CodeGraph.Graph; +using CSharpCodeAnalyst.CodeParser.Parser.Config; namespace CodeParserTests.UnitTests.Parser; @@ -51,12 +51,12 @@ public static void LoopOver(this IEnumerable enumerable, Action action) } """; - private CodeGraph.Graph.CodeGraph _graph = null!; + private CodeGraph _graph = null!; [OneTimeSetUp] public async Task Setup() { - var parser = new CodeParser.Parser.Parser(new ParserConfig(new ProjectExclusionRegExCollection(), false)); + var parser = new CSharpCodeAnalyst.CodeParser.Parser.Parser(new ParserConfig(new ProjectExclusionRegExCollection(), false)); var result = await parser.ParseSourceAsync(Code); _graph = result.CodeGraph; } diff --git a/Tests/UnitTests/Parser/Events_InterfaceParseTests.cs b/Tests/UnitTests/Parser/Events_InterfaceParseTests.cs index c1692709..50d73836 100644 --- a/Tests/UnitTests/Parser/Events_InterfaceParseTests.cs +++ b/Tests/UnitTests/Parser/Events_InterfaceParseTests.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Parser; diff --git a/Tests/UnitTests/Parser/Events_PublishSubscribeParseTests.cs b/Tests/UnitTests/Parser/Events_PublishSubscribeParseTests.cs index 50ec34ce..be1b2793 100644 --- a/Tests/UnitTests/Parser/Events_PublishSubscribeParseTests.cs +++ b/Tests/UnitTests/Parser/Events_PublishSubscribeParseTests.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Parser; diff --git a/Tests/UnitTests/Parser/FollowHeuristic_PropertyChainSplitAccessorsParseTests.cs b/Tests/UnitTests/Parser/FollowHeuristic_PropertyChainSplitAccessorsParseTests.cs index 05d8533f..a5dcaabb 100644 --- a/Tests/UnitTests/Parser/FollowHeuristic_PropertyChainSplitAccessorsParseTests.cs +++ b/Tests/UnitTests/Parser/FollowHeuristic_PropertyChainSplitAccessorsParseTests.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Parser; diff --git a/Tests/UnitTests/Parser/FollowIncomingCallsParseTests.cs b/Tests/UnitTests/Parser/FollowIncomingCallsParseTests.cs index 63db0366..5065cc79 100644 --- a/Tests/UnitTests/Parser/FollowIncomingCallsParseTests.cs +++ b/Tests/UnitTests/Parser/FollowIncomingCallsParseTests.cs @@ -1,5 +1,5 @@ -using CodeGraph.Graph; -using CodeParser.Parser.Config; +using CSharpCodeAnalyst.CodeGraph.Graph; +using CSharpCodeAnalyst.CodeParser.Parser.Config; namespace CodeParserTests.UnitTests.Parser; @@ -60,12 +60,12 @@ public Driver() } """; - private CodeGraph.Graph.CodeGraph _graph = null!; + private CodeGraph _graph = null!; [OneTimeSetUp] public async Task Setup() { - var parser = new CodeParser.Parser.Parser(new ParserConfig(new ProjectExclusionRegExCollection(), false)); + var parser = new CSharpCodeAnalyst.CodeParser.Parser.Parser(new ParserConfig(new ProjectExclusionRegExCollection(), false)); var result = await parser.ParseSourceAsync(Code); _graph = result.CodeGraph; } diff --git a/Tests/UnitTests/Parser/GenericsParseTests.cs b/Tests/UnitTests/Parser/GenericsParseTests.cs index 7bcec7b6..0ba459f8 100644 --- a/Tests/UnitTests/Parser/GenericsParseTests.cs +++ b/Tests/UnitTests/Parser/GenericsParseTests.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Parser; diff --git a/Tests/UnitTests/Parser/InMemoryCycleParseTestBase.cs b/Tests/UnitTests/Parser/InMemoryCycleParseTestBase.cs index 48eb4b1c..b4e2c3e4 100644 --- a/Tests/UnitTests/Parser/InMemoryCycleParseTestBase.cs +++ b/Tests/UnitTests/Parser/InMemoryCycleParseTestBase.cs @@ -1,5 +1,4 @@ -using CodeGraph.Algorithms.Cycles; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Algorithms.Cycles; namespace CodeParserTests.UnitTests.Parser; diff --git a/Tests/UnitTests/Parser/InMemoryFollowIncomingCallsTestBase.cs b/Tests/UnitTests/Parser/InMemoryFollowIncomingCallsTestBase.cs index 0e3af6c5..cd30b75b 100644 --- a/Tests/UnitTests/Parser/InMemoryFollowIncomingCallsTestBase.cs +++ b/Tests/UnitTests/Parser/InMemoryFollowIncomingCallsTestBase.cs @@ -1,5 +1,4 @@ -using CodeGraph.Exploration; -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Exploration; namespace CodeParserTests.UnitTests.Parser; diff --git a/Tests/UnitTests/Parser/InMemoryParseTestBase.cs b/Tests/UnitTests/Parser/InMemoryParseTestBase.cs index 1ebc9104..129e328e 100644 --- a/Tests/UnitTests/Parser/InMemoryParseTestBase.cs +++ b/Tests/UnitTests/Parser/InMemoryParseTestBase.cs @@ -1,5 +1,5 @@ -using CodeGraph.Graph; -using CodeParser.Parser.Config; +using CSharpCodeAnalyst.CodeGraph.Graph; +using CSharpCodeAnalyst.CodeParser.Parser.Config; namespace CodeParserTests.UnitTests.Parser; @@ -12,7 +12,7 @@ namespace CodeParserTests.UnitTests.Parser; /// public abstract class InMemoryParseTestBase { - protected CodeGraph.Graph.CodeGraph Graph = null!; + protected CodeGraph Graph = null!; /// The C# snippet to parse. One compilation unit; typically under namespace Demo;. protected abstract string Code { get; } @@ -23,7 +23,7 @@ public abstract class InMemoryParseTestBase [OneTimeSetUp] public async Task ParseCode() { - var parser = new CodeParser.Parser.Parser( + var parser = new CSharpCodeAnalyst.CodeParser.Parser.Parser( new ParserConfig(new ProjectExclusionRegExCollection(), false, splitPropertyAccessors: SplitPropertyAccessors)); var result = await parser.ParseSourceAsync(Code); Graph = result.CodeGraph; diff --git a/Tests/UnitTests/Parser/LambdaConstructorReferenceTests.cs b/Tests/UnitTests/Parser/LambdaConstructorReferenceTests.cs index ce6c68e8..fc61783c 100644 --- a/Tests/UnitTests/Parser/LambdaConstructorReferenceTests.cs +++ b/Tests/UnitTests/Parser/LambdaConstructorReferenceTests.cs @@ -1,5 +1,5 @@ -using CodeGraph.Graph; -using CodeParser.Parser.Config; +using CSharpCodeAnalyst.CodeGraph.Graph; +using CSharpCodeAnalyst.CodeParser.Parser.Config; namespace CodeParserTests.UnitTests.Parser; @@ -33,7 +33,7 @@ public void BuildDirect() } """; - private CodeGraph.Graph.CodeGraph _graph = null!; + private CodeGraph _graph = null!; [OneTimeSetUp] public void Setup() @@ -93,9 +93,9 @@ private static bool Has(CodeElement source, CodeElement target, RelationshipType return source.Relationships.Any(r => r.TargetId == target.Id && r.Type == type); } - private static CodeGraph.Graph.CodeGraph Parse(string code) + private static CodeGraph Parse(string code) { - var parser = new CodeParser.Parser.Parser(new ParserConfig(new ProjectExclusionRegExCollection(), false)); + var parser = new CSharpCodeAnalyst.CodeParser.Parser.Parser(new ParserConfig(new ProjectExclusionRegExCollection(), false)); return parser.ParseSourceAsync(code).GetAwaiter().GetResult().CodeGraph; } } diff --git a/Tests/UnitTests/Parser/MemberAccessDuplicateParseTests.cs b/Tests/UnitTests/Parser/MemberAccessDuplicateParseTests.cs index 12aeaaab..1887f6c1 100644 --- a/Tests/UnitTests/Parser/MemberAccessDuplicateParseTests.cs +++ b/Tests/UnitTests/Parser/MemberAccessDuplicateParseTests.cs @@ -1,5 +1,5 @@ -using CodeGraph.Graph; -using CodeParser.Parser.Config; +using CSharpCodeAnalyst.CodeGraph.Graph; +using CSharpCodeAnalyst.CodeParser.Parser.Config; namespace CodeParserTests.UnitTests.Parser; @@ -36,13 +36,13 @@ public void TestMethod() } """; - private CodeGraph.Graph.CodeGraph _graph = null!; + private CodeGraph _graph = null!; [OneTimeSetUp] public void Setup() { // Split off to mirror the original parser configuration of this scenario. - var parser = new CodeParser.Parser.Parser(new ParserConfig(new ProjectExclusionRegExCollection(), false)); + var parser = new CSharpCodeAnalyst.CodeParser.Parser.Parser(new ParserConfig(new ProjectExclusionRegExCollection(), false)); _graph = parser.ParseSourceAsync(Code).GetAwaiter().GetResult().CodeGraph; } diff --git a/Tests/UnitTests/Parser/MethodGroups_DelegatesParseTests.cs b/Tests/UnitTests/Parser/MethodGroups_DelegatesParseTests.cs index bb2dd165..9d29661e 100644 --- a/Tests/UnitTests/Parser/MethodGroups_DelegatesParseTests.cs +++ b/Tests/UnitTests/Parser/MethodGroups_DelegatesParseTests.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Parser; diff --git a/Tests/UnitTests/Parser/MethodGroups_EventsParseTests.cs b/Tests/UnitTests/Parser/MethodGroups_EventsParseTests.cs index 1db458c4..049aee58 100644 --- a/Tests/UnitTests/Parser/MethodGroups_EventsParseTests.cs +++ b/Tests/UnitTests/Parser/MethodGroups_EventsParseTests.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Parser; diff --git a/Tests/UnitTests/Parser/MethodGroups_LinqParseTests.cs b/Tests/UnitTests/Parser/MethodGroups_LinqParseTests.cs index 78d3ac43..38e39ac2 100644 --- a/Tests/UnitTests/Parser/MethodGroups_LinqParseTests.cs +++ b/Tests/UnitTests/Parser/MethodGroups_LinqParseTests.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Parser; diff --git a/Tests/UnitTests/Parser/NameOfDetectionTests.cs b/Tests/UnitTests/Parser/NameOfDetectionTests.cs index e8423509..021eae78 100644 --- a/Tests/UnitTests/Parser/NameOfDetectionTests.cs +++ b/Tests/UnitTests/Parser/NameOfDetectionTests.cs @@ -1,4 +1,4 @@ -using CodeParser.Parser; +using CSharpCodeAnalyst.CodeParser.Parser; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; diff --git a/Tests/UnitTests/Parser/NamespacesParseTests.cs b/Tests/UnitTests/Parser/NamespacesParseTests.cs index 821fd348..514f46f7 100644 --- a/Tests/UnitTests/Parser/NamespacesParseTests.cs +++ b/Tests/UnitTests/Parser/NamespacesParseTests.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Parser; diff --git a/Tests/UnitTests/Parser/ObjectOriented_InheritanceParseTests.cs b/Tests/UnitTests/Parser/ObjectOriented_InheritanceParseTests.cs index 462cc5ba..e07c9949 100644 --- a/Tests/UnitTests/Parser/ObjectOriented_InheritanceParseTests.cs +++ b/Tests/UnitTests/Parser/ObjectOriented_InheritanceParseTests.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Parser; diff --git a/Tests/UnitTests/Parser/ObjectOriented_InterfacesParseTests.cs b/Tests/UnitTests/Parser/ObjectOriented_InterfacesParseTests.cs index 8ad615f9..4bbd2c54 100644 --- a/Tests/UnitTests/Parser/ObjectOriented_InterfacesParseTests.cs +++ b/Tests/UnitTests/Parser/ObjectOriented_InterfacesParseTests.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Parser; diff --git a/Tests/UnitTests/Parser/ObjectOriented_PolymorphismParseTests.cs b/Tests/UnitTests/Parser/ObjectOriented_PolymorphismParseTests.cs index 7eb52845..f05eefaa 100644 --- a/Tests/UnitTests/Parser/ObjectOriented_PolymorphismParseTests.cs +++ b/Tests/UnitTests/Parser/ObjectOriented_PolymorphismParseTests.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Parser; diff --git a/Tests/UnitTests/Parser/OrderProcessingParseTests.cs b/Tests/UnitTests/Parser/OrderProcessingParseTests.cs index 5b323ebb..671d928e 100644 --- a/Tests/UnitTests/Parser/OrderProcessingParseTests.cs +++ b/Tests/UnitTests/Parser/OrderProcessingParseTests.cs @@ -1,4 +1,4 @@ -using CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Parser; diff --git a/Tests/UnitTests/Parser/ProjectSelectorTests.cs b/Tests/UnitTests/Parser/ProjectSelectorTests.cs index 0ea10c3f..87b94cd0 100644 --- a/Tests/UnitTests/Parser/ProjectSelectorTests.cs +++ b/Tests/UnitTests/Parser/ProjectSelectorTests.cs @@ -1,4 +1,4 @@ -using CodeParser.Parser; +using CSharpCodeAnalyst.CodeParser.Parser; namespace CodeParserTests.UnitTests.Parser; diff --git a/Tests/UnitTests/Parser/PropertyAccessClassifierTests.cs b/Tests/UnitTests/Parser/PropertyAccessClassifierTests.cs index 09fb809c..fedaf669 100644 --- a/Tests/UnitTests/Parser/PropertyAccessClassifierTests.cs +++ b/Tests/UnitTests/Parser/PropertyAccessClassifierTests.cs @@ -1,4 +1,4 @@ -using CodeParser.Parser; +using CSharpCodeAnalyst.CodeParser.Parser; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; diff --git a/Tests/UnitTests/Parser/RecordsAndStructsParseTests.cs b/Tests/UnitTests/Parser/RecordsAndStructsParseTests.cs index 78c768cc..a7be1e35 100644 --- a/Tests/UnitTests/Parser/RecordsAndStructsParseTests.cs +++ b/Tests/UnitTests/Parser/RecordsAndStructsParseTests.cs @@ -1,5 +1,5 @@ -using CodeGraph.Graph; -using CodeParser.Parser.Config; +using CSharpCodeAnalyst.CodeGraph.Graph; +using CSharpCodeAnalyst.CodeParser.Parser.Config; namespace CodeParserTests.UnitTests.Parser; @@ -69,13 +69,13 @@ partial void OnCreated() } """; - private CodeGraph.Graph.CodeGraph _graph = null!; + private CodeGraph _graph = null!; [OneTimeSetUp] public void Setup() { // Split off to mirror the original parser configuration of this scenario. - var parser = new CodeParser.Parser.Parser(new ParserConfig(new ProjectExclusionRegExCollection(), false)); + var parser = new CSharpCodeAnalyst.CodeParser.Parser.Parser(new ParserConfig(new ProjectExclusionRegExCollection(), false)); _graph = parser.ParseSourceAsync(Code).GetAwaiter().GetResult().CodeGraph; } diff --git a/Tests/UnitTests/Parser/SingleFileParseTests.cs b/Tests/UnitTests/Parser/SingleFileParseTests.cs index 2db51f1e..ac5d45ae 100644 --- a/Tests/UnitTests/Parser/SingleFileParseTests.cs +++ b/Tests/UnitTests/Parser/SingleFileParseTests.cs @@ -1,7 +1,7 @@ using System; using System.IO; -using CodeGraph.Graph; -using CodeParser.Parser.Config; +using CSharpCodeAnalyst.CodeGraph.Graph; +using CSharpCodeAnalyst.CodeParser.Parser.Config; namespace CodeParserTests.UnitTests.Parser; @@ -27,7 +27,7 @@ public void Bar() { } try { - var parser = new CodeParser.Parser.Parser(new ParserConfig(new ProjectExclusionRegExCollection(), false)); + var parser = new CSharpCodeAnalyst.CodeParser.Parser.Parser(new ParserConfig(new ProjectExclusionRegExCollection(), false)); var graph = parser.ParseAsync(path).GetAwaiter().GetResult().CodeGraph; var foo = graph.Nodes.Values.SingleOrDefault(n => n.ElementType == CodeElementType.Class && n.Name == "Foo"); diff --git a/Tests/UnitTests/Parser/SourceMetricsParseTests.cs b/Tests/UnitTests/Parser/SourceMetricsParseTests.cs index b2cb86ea..8009eb73 100644 --- a/Tests/UnitTests/Parser/SourceMetricsParseTests.cs +++ b/Tests/UnitTests/Parser/SourceMetricsParseTests.cs @@ -1,7 +1,7 @@ -using CodeGraph.Graph; -using CodeGraph.Metrics; -using CodeParser.Parser; -using CodeParser.Parser.Config; +using CSharpCodeAnalyst.CodeGraph.Graph; +using CSharpCodeAnalyst.CodeGraph.Metrics; +using CSharpCodeAnalyst.CodeParser.Parser; +using CSharpCodeAnalyst.CodeParser.Parser.Config; namespace CodeParserTests.UnitTests.Parser; @@ -59,9 +59,9 @@ abstract class Abstract } """; - private static CodeParser.Parser.Parser CreateParser(bool collectMetrics) + private static CSharpCodeAnalyst.CodeParser.Parser.Parser CreateParser(bool collectMetrics) { - return new CodeParser.Parser.Parser( + return new CSharpCodeAnalyst.CodeParser.Parser.Parser( new ParserConfig(new ProjectExclusionRegExCollection(), false, collectSourceMetrics: collectMetrics)); } diff --git a/Tests/UnitTests/Parser/SplitPropertyAccessorsTests.cs b/Tests/UnitTests/Parser/SplitPropertyAccessorsTests.cs index 9fe0675a..3be2e0a7 100644 --- a/Tests/UnitTests/Parser/SplitPropertyAccessorsTests.cs +++ b/Tests/UnitTests/Parser/SplitPropertyAccessorsTests.cs @@ -1,6 +1,6 @@ -using CodeGraph.Graph; -using CodeParser.Parser; -using CodeParser.Parser.Config; +using CSharpCodeAnalyst.CodeGraph.Graph; +using CSharpCodeAnalyst.CodeParser.Parser; +using CSharpCodeAnalyst.CodeParser.Parser.Config; namespace CodeParserTests.UnitTests.Parser; @@ -12,7 +12,7 @@ namespace CodeParserTests.UnitTests.Parser; [TestFixture] public class SplitPropertyAccessorsTests { - private CodeGraph.Graph.CodeGraph _graph = null!; + private CodeGraph _graph = null!; [OneTimeSetUp] public async Task FixtureSetup() @@ -27,7 +27,7 @@ public async Task FixtureSetup() // already registered } - var parser = new CodeParser.Parser.Parser(new ParserConfig(new ProjectExclusionRegExCollection(), false, + var parser = new CSharpCodeAnalyst.CodeParser.Parser.Parser(new ParserConfig(new ProjectExclusionRegExCollection(), false, splitPropertyAccessors: true)); _graph = (await parser.ParseAsync(@"..\..\..\..\TestSuite\TestSuite.sln")).CodeGraph; } diff --git a/Tests/UnitTests/Partitioning/CodeElementPartitionerBaseClassTests.cs b/Tests/UnitTests/Partitioning/CodeElementPartitionerBaseClassTests.cs index 1d200d58..f8610b56 100644 --- a/Tests/UnitTests/Partitioning/CodeElementPartitionerBaseClassTests.cs +++ b/Tests/UnitTests/Partitioning/CodeElementPartitionerBaseClassTests.cs @@ -1,6 +1,6 @@ -using CodeGraph.Algorithms.Partitioning; -using CodeGraph.Graph; using CodeParserTests.Helper; +using CSharpCodeAnalyst.CodeGraph.Algorithms.Partitioning; +using CSharpCodeAnalyst.CodeGraph.Graph; namespace CodeParserTests.UnitTests.Partitioning; diff --git a/Tests/UnitTests/Search/PascalCaseSearchTests.cs b/Tests/UnitTests/Search/PascalCaseSearchTests.cs index a734339d..05859fbf 100644 --- a/Tests/UnitTests/Search/PascalCaseSearchTests.cs +++ b/Tests/UnitTests/Search/PascalCaseSearchTests.cs @@ -1,4 +1,4 @@ -using CSharpCodeAnalyst.Shared.Search; +using CSharpCodeAnalyst.AnalyzerSdk.Search; namespace CodeParserTests.UnitTests.Search;