diff --git a/CodeDocumentor/Analyzers/BaseAnalyzerSettings.cs b/CodeDocumentor.Analyzers/Analyzers/BaseAnalyzerSettings.cs
similarity index 89%
rename from CodeDocumentor/Analyzers/BaseAnalyzerSettings.cs
rename to CodeDocumentor.Analyzers/Analyzers/BaseAnalyzerSettings.cs
index e71ad46..00a06dd 100644
--- a/CodeDocumentor/Analyzers/BaseAnalyzerSettings.cs
+++ b/CodeDocumentor.Analyzers/Analyzers/BaseAnalyzerSettings.cs
@@ -1,20 +1,21 @@
+using CodeDocumentor.Analyzers.Locators;
using CodeDocumentor.Common;
+using CodeDocumentor.Common.Helpers;
using CodeDocumentor.Common.Interfaces;
-using CodeDocumentor.Locators;
using Microsoft.CodeAnalysis;
namespace CodeDocumentor.Analyzers
{
- internal class BaseAnalyzerSettings
+ public class BaseAnalyzerSettings
{
///
/// The category.
///
- internal const string Category = Constants.CATEGORY;
+ public const string Category = Constants.CATEGORY;
protected IEventLogger EventLogger = ServiceLocator.Logger;
- internal DiagnosticSeverity LookupSeverity(string diagnosticId, ISettings settings)
+ public DiagnosticSeverity LookupSeverity(string diagnosticId, ISettings settings)
{
if (settings == null)
{
diff --git a/CodeDocumentor/Analyzers/Classes/ClassAnalyzer.cs b/CodeDocumentor.Analyzers/Analyzers/Classes/ClassAnalyzer.cs
similarity index 73%
rename from CodeDocumentor/Analyzers/Classes/ClassAnalyzer.cs
rename to CodeDocumentor.Analyzers/Analyzers/Classes/ClassAnalyzer.cs
index d6ee047..0c16bc9 100644
--- a/CodeDocumentor/Analyzers/Classes/ClassAnalyzer.cs
+++ b/CodeDocumentor.Analyzers/Analyzers/Classes/ClassAnalyzer.cs
@@ -1,26 +1,20 @@
using System.Collections.Immutable;
-using CodeDocumentor.Builders;
-using CodeDocumentor.Helper;
+using CodeDocumentor.Analyzers.Builders;
+using CodeDocumentor.Analyzers.Helper;
+using CodeDocumentor.Analyzers.Locators;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
-namespace CodeDocumentor
+namespace CodeDocumentor.Analyzers.Classes
{
///
/// The class analyzer.
///
[DiagnosticAnalyzer(LanguageNames.CSharp)]
- public class ClassAnalyzer : BaseDiagnosticAnalyzer
+ public class ClassAnalyzer : DiagnosticAnalyzer
{
- private readonly ClassAnalyzerSettings _analyzerSettings;
-
- public ClassAnalyzer()
- {
- _analyzerSettings = new ClassAnalyzerSettings();
- }
-
///
/// Gets the supported diagnostics.
///
@@ -28,6 +22,7 @@ public override ImmutableArray SupportedDiagnostics
{
get
{
+ var _analyzerSettings = new ClassAnalyzerSettings();
return ImmutableArray.Create(_analyzerSettings.GetSupportedDiagnosticRule());
}
}
@@ -47,7 +42,7 @@ public override void Initialize(AnalysisContext context)
/// Analyzes node.
///
/// The context.
- public void AnalyzeNode(SyntaxNodeAnalysisContext context)
+ private static void AnalyzeNode(SyntaxNodeAnalysisContext context)
{
if (!(context.Node is ClassDeclarationSyntax node))
{
@@ -57,13 +52,13 @@ public void AnalyzeNode(SyntaxNodeAnalysisContext context)
{
return;
}
- var excludeAnanlyzer = DocumentationHeaderHelper.HasAnalyzerExclusion(node);
+ var excludeAnanlyzer = ServiceLocator.DocumentationHeaderHelper.HasAnalyzerExclusion(node);
if (excludeAnanlyzer)
{
return;
}
- var settings = context.BuildSettings(StaticSettings);
-
+ var settings = ServiceLocator.SettingService.BuildSettings(context);
+ var _analyzerSettings = new ClassAnalyzerSettings();
context.BuildDiagnostic(node, node.Identifier, (alreadyHasComment) => _analyzerSettings.GetRule(alreadyHasComment, settings));
}
}
diff --git a/CodeDocumentor/Analyzers/Classes/ClassAnalyzerSettings.cs b/CodeDocumentor.Analyzers/Analyzers/Classes/ClassAnalyzerSettings.cs
similarity index 60%
rename from CodeDocumentor/Analyzers/Classes/ClassAnalyzerSettings.cs
rename to CodeDocumentor.Analyzers/Analyzers/Classes/ClassAnalyzerSettings.cs
index 26cf225..7ee046d 100644
--- a/CodeDocumentor/Analyzers/Classes/ClassAnalyzerSettings.cs
+++ b/CodeDocumentor.Analyzers/Analyzers/Classes/ClassAnalyzerSettings.cs
@@ -1,28 +1,27 @@
-using CodeDocumentor.Analyzers;
using CodeDocumentor.Common;
using CodeDocumentor.Common.Interfaces;
using Microsoft.CodeAnalysis;
-namespace CodeDocumentor
+namespace CodeDocumentor.Analyzers
{
- internal class ClassAnalyzerSettings: BaseAnalyzerSettings
+ public class ClassAnalyzerSettings : BaseAnalyzerSettings
{
///
/// The diagnostic id.
///
- internal const string DiagnosticId = Constants.DiagnosticIds.CLASS_DIAGNOSTIC_ID;
+ public const string DiagnosticId = Constants.DiagnosticIds.CLASS_DIAGNOSTIC_ID;
///
/// The message format.
///
- internal const string MessageFormat = Title;
+ public const string MessageFormat = Title;
///
/// The title.
///
- internal const string Title = "The class must have a documentation header.";
+ public const string Title = "The class must have a documentation header.";
- internal DiagnosticDescriptor GetSupportedDiagnosticRule()
+ public DiagnosticDescriptor GetSupportedDiagnosticRule()
{
return new DiagnosticDescriptor(DiagnosticId, Title,
MessageFormat, Category,
@@ -30,7 +29,7 @@ internal DiagnosticDescriptor GetSupportedDiagnosticRule()
true);
}
- internal DiagnosticDescriptor GetRule(bool hideDiagnosticSeverity, ISettings settings)
+ public DiagnosticDescriptor GetRule(bool hideDiagnosticSeverity, ISettings settings)
{
return new DiagnosticDescriptor(DiagnosticId, Title,
MessageFormat, Category,
diff --git a/CodeDocumentor/Analyzers/Classes/NonPublicClassAnalyzer.cs b/CodeDocumentor.Analyzers/Analyzers/Classes/NonPublicClassAnalyzer.cs
similarity index 83%
rename from CodeDocumentor/Analyzers/Classes/NonPublicClassAnalyzer.cs
rename to CodeDocumentor.Analyzers/Analyzers/Classes/NonPublicClassAnalyzer.cs
index 93d301d..4ffc579 100644
--- a/CodeDocumentor/Analyzers/Classes/NonPublicClassAnalyzer.cs
+++ b/CodeDocumentor.Analyzers/Analyzers/Classes/NonPublicClassAnalyzer.cs
@@ -1,18 +1,19 @@
using System.Collections.Immutable;
-using CodeDocumentor.Builders;
-using CodeDocumentor.Helper;
+using CodeDocumentor.Analyzers.Builders;
+using CodeDocumentor.Analyzers.Helper;
+using CodeDocumentor.Analyzers.Locators;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
-namespace CodeDocumentor
+namespace CodeDocumentor.Analyzers.Classes
{
///
/// The class analyzer.
///
[DiagnosticAnalyzer(LanguageNames.CSharp)]
- public class NonPublicClassAnalyzer : BaseDiagnosticAnalyzer
+ public class NonPublicClassAnalyzer : DiagnosticAnalyzer
{
private readonly ClassAnalyzerSettings _analyzerSettings;
@@ -53,13 +54,13 @@ private void AnalyzeNode(SyntaxNodeAnalysisContext context)
{
return;
}
- var settings = context.BuildSettings(StaticSettings);
+ var settings = ServiceLocator.SettingService.BuildSettings(context);
if (settings.IsEnabledForPublicMembersOnly)
{
return;
}
- var excludeAnanlyzer = DocumentationHeaderHelper.HasAnalyzerExclusion(node);
+ var excludeAnanlyzer = ServiceLocator.DocumentationHeaderHelper.HasAnalyzerExclusion(node);
if (excludeAnanlyzer)
{
return;
diff --git a/CodeDocumentor/Analyzers/Constructors/ConstructorAnalyzer.cs b/CodeDocumentor.Analyzers/Analyzers/Constructors/ConstructorAnalyzer.cs
similarity index 78%
rename from CodeDocumentor/Analyzers/Constructors/ConstructorAnalyzer.cs
rename to CodeDocumentor.Analyzers/Analyzers/Constructors/ConstructorAnalyzer.cs
index 17b4853..58ff751 100644
--- a/CodeDocumentor/Analyzers/Constructors/ConstructorAnalyzer.cs
+++ b/CodeDocumentor.Analyzers/Analyzers/Constructors/ConstructorAnalyzer.cs
@@ -1,24 +1,25 @@
using System.Collections.Immutable;
-using CodeDocumentor.Builders;
-using CodeDocumentor.Helper;
+using CodeDocumentor.Analyzers.Builders;
+using CodeDocumentor.Analyzers.Helper;
+using CodeDocumentor.Analyzers.Locators;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
-namespace CodeDocumentor
+namespace CodeDocumentor.Analyzers.Constructors
{
///
/// The constructor analyzer.
///
[DiagnosticAnalyzer(LanguageNames.CSharp)]
- public class ConstructorAnalyzer : BaseDiagnosticAnalyzer
+ public class ConstructorAnalyzer : DiagnosticAnalyzer
{
private readonly ConstructorAnalyzerSettings _analyzerSettings;
public ConstructorAnalyzer()
{
- _analyzerSettings = new ConstructorAnalyzerSettings();
+ _analyzerSettings = new ConstructorAnalyzerSettings();
}
///
/// Gets the supported diagnostics.
@@ -46,7 +47,7 @@ public override void Initialize(AnalysisContext context)
/// Analyzes node.
///
/// The context.
- internal void AnalyzeNode(SyntaxNodeAnalysisContext context)
+ public void AnalyzeNode(SyntaxNodeAnalysisContext context)
{
if (!(context.Node is ConstructorDeclarationSyntax node))
{
@@ -56,12 +57,12 @@ internal void AnalyzeNode(SyntaxNodeAnalysisContext context)
{
return;
}
- var settings = context.BuildSettings(StaticSettings);
+ var settings = ServiceLocator.SettingService.BuildSettings(context);
if (settings.IsEnabledForPublicMembersOnly && PrivateMemberVerifier.IsPrivateMember(node))
{
return;
}
- var excludeAnanlyzer = DocumentationHeaderHelper.HasAnalyzerExclusion(node);
+ var excludeAnanlyzer = ServiceLocator.DocumentationHeaderHelper.HasAnalyzerExclusion(node);
if (excludeAnanlyzer)
{
return;
diff --git a/CodeDocumentor/Analyzers/Constructors/ConstructorAnalyzerSettings.cs b/CodeDocumentor.Analyzers/Analyzers/Constructors/ConstructorAnalyzerSettings.cs
similarity index 59%
rename from CodeDocumentor/Analyzers/Constructors/ConstructorAnalyzerSettings.cs
rename to CodeDocumentor.Analyzers/Analyzers/Constructors/ConstructorAnalyzerSettings.cs
index d7704f8..514f34e 100644
--- a/CodeDocumentor/Analyzers/Constructors/ConstructorAnalyzerSettings.cs
+++ b/CodeDocumentor.Analyzers/Analyzers/Constructors/ConstructorAnalyzerSettings.cs
@@ -1,28 +1,27 @@
-using CodeDocumentor.Analyzers;
using CodeDocumentor.Common;
using CodeDocumentor.Common.Interfaces;
using Microsoft.CodeAnalysis;
-namespace CodeDocumentor
+namespace CodeDocumentor.Analyzers
{
- internal class ConstructorAnalyzerSettings: BaseAnalyzerSettings
+ public class ConstructorAnalyzerSettings : BaseAnalyzerSettings
{
///
/// The diagnostic id.
///
- internal const string DiagnosticId = Constants.DiagnosticIds.CONSTRUCTOR_DIAGNOSTIC_ID;
+ public const string DiagnosticId = Constants.DiagnosticIds.CONSTRUCTOR_DIAGNOSTIC_ID;
///
/// The message format.
///
- internal const string MessageFormat = Title;
+ public const string MessageFormat = Title;
///
/// The title.
///
- internal const string Title = "The constructor must have a documentation header.";
-
- internal DiagnosticDescriptor GetSupportedDiagnosticRule()
+ public const string Title = "The constructor must have a documentation header.";
+
+ public DiagnosticDescriptor GetSupportedDiagnosticRule()
{
return new DiagnosticDescriptor(DiagnosticId, Title,
MessageFormat, Category,
@@ -31,7 +30,7 @@ internal DiagnosticDescriptor GetSupportedDiagnosticRule()
}
- internal DiagnosticDescriptor GetRule(bool hideDiagnosticSeverity, ISettings settings)
+ public DiagnosticDescriptor GetRule(bool hideDiagnosticSeverity, ISettings settings)
{
return new DiagnosticDescriptor(DiagnosticId, Title,
MessageFormat, Category,
diff --git a/CodeDocumentor/Analyzers/Constructors/NonPublicConstructorAnalyzer.cs b/CodeDocumentor.Analyzers/Analyzers/Constructors/NonPublicConstructorAnalyzer.cs
similarity index 82%
rename from CodeDocumentor/Analyzers/Constructors/NonPublicConstructorAnalyzer.cs
rename to CodeDocumentor.Analyzers/Analyzers/Constructors/NonPublicConstructorAnalyzer.cs
index 1236ad7..c40c653 100644
--- a/CodeDocumentor/Analyzers/Constructors/NonPublicConstructorAnalyzer.cs
+++ b/CodeDocumentor.Analyzers/Analyzers/Constructors/NonPublicConstructorAnalyzer.cs
@@ -1,15 +1,16 @@
using System.Collections.Immutable;
-using CodeDocumentor.Builders;
-using CodeDocumentor.Helper;
+using CodeDocumentor.Analyzers.Builders;
+using CodeDocumentor.Analyzers.Helper;
+using CodeDocumentor.Analyzers.Locators;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
-namespace CodeDocumentor
+namespace CodeDocumentor.Analyzers.Constructors
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
- public class NonPublicConstructorAnalyzer : BaseDiagnosticAnalyzer
+ public class NonPublicConstructorAnalyzer : DiagnosticAnalyzer
{
private readonly ConstructorAnalyzerSettings _analyzerSettings;
@@ -50,12 +51,12 @@ private void AnalyzeNode(SyntaxNodeAnalysisContext context)
{
return;
}
- var settings = context.BuildSettings(StaticSettings);
+ var settings = ServiceLocator.SettingService.BuildSettings(context);
if (settings.IsEnabledForPublicMembersOnly)
{
return;
}
- var excludeAnanlyzer = DocumentationHeaderHelper.HasAnalyzerExclusion(node);
+ var excludeAnanlyzer = ServiceLocator.DocumentationHeaderHelper.HasAnalyzerExclusion(node);
if (excludeAnanlyzer)
{
return;
diff --git a/CodeDocumentor/Analyzers/Enums/EnumAnalyzer.cs b/CodeDocumentor.Analyzers/Analyzers/Enums/EnumAnalyzer.cs
similarity index 79%
rename from CodeDocumentor/Analyzers/Enums/EnumAnalyzer.cs
rename to CodeDocumentor.Analyzers/Analyzers/Enums/EnumAnalyzer.cs
index 4a11fde..7e2b8cb 100644
--- a/CodeDocumentor/Analyzers/Enums/EnumAnalyzer.cs
+++ b/CodeDocumentor.Analyzers/Analyzers/Enums/EnumAnalyzer.cs
@@ -1,18 +1,18 @@
using System.Collections.Immutable;
-using CodeDocumentor.Builders;
-using CodeDocumentor.Helper;
+using CodeDocumentor.Analyzers.Builders;
+using CodeDocumentor.Analyzers.Locators;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
-namespace CodeDocumentor
+namespace CodeDocumentor.Analyzers.Enums
{
///
/// The enum analyzer.
///
[DiagnosticAnalyzer(LanguageNames.CSharp)]
- public class EnumAnalyzer : BaseDiagnosticAnalyzer
+ public class EnumAnalyzer : DiagnosticAnalyzer
{
private readonly EnumAnalyzerSettings _analyzerSettings;
@@ -40,18 +40,18 @@ public override void Initialize(AnalysisContext context)
/// Analyzes node.
///
/// The context.
- internal void AnalyzeNode(SyntaxNodeAnalysisContext context)
+ public void AnalyzeNode(SyntaxNodeAnalysisContext context)
{
if (!(context.Node is EnumDeclarationSyntax node))
{
return;
}
- var excludeAnanlyzer = DocumentationHeaderHelper.HasAnalyzerExclusion(node);
+ var excludeAnanlyzer = ServiceLocator.DocumentationHeaderHelper.HasAnalyzerExclusion(node);
if (excludeAnanlyzer)
{
return;
}
- var settings = context.BuildSettings(StaticSettings);
+ var settings = ServiceLocator.SettingService.BuildSettings(context);
context.BuildDiagnostic(node, node.Identifier, (alreadyHasComment) => _analyzerSettings.GetRule(alreadyHasComment, settings));
}
}
diff --git a/CodeDocumentor/Analyzers/Methods/MethodAnalyzerSettings.cs b/CodeDocumentor.Analyzers/Analyzers/Enums/EnumAnalyzerSettings.cs
similarity index 62%
rename from CodeDocumentor/Analyzers/Methods/MethodAnalyzerSettings.cs
rename to CodeDocumentor.Analyzers/Analyzers/Enums/EnumAnalyzerSettings.cs
index 92ef6fd..a234e20 100644
--- a/CodeDocumentor/Analyzers/Methods/MethodAnalyzerSettings.cs
+++ b/CodeDocumentor.Analyzers/Analyzers/Enums/EnumAnalyzerSettings.cs
@@ -1,28 +1,27 @@
-using CodeDocumentor.Analyzers;
using CodeDocumentor.Common;
using CodeDocumentor.Common.Interfaces;
using Microsoft.CodeAnalysis;
-namespace CodeDocumentor
+namespace CodeDocumentor.Analyzers
{
- internal class MethodAnalyzerSettings : BaseAnalyzerSettings
+ public class EnumAnalyzerSettings : BaseAnalyzerSettings
{
///
/// The diagnostic id.
///
- internal const string DiagnosticId = Constants.DiagnosticIds.METHOD_DIAGNOSTIC_ID;
+ public const string DiagnosticId = Constants.DiagnosticIds.ENUM_DIAGNOSTIC_ID;
///
/// The message format.
///
- internal const string MessageFormat = Title;
+ public const string MessageFormat = Title;
///
/// The title.
///
- internal const string Title = "The method must have a documentation header.";
+ public const string Title = "The enum must have a documentation header.";
- internal DiagnosticDescriptor GetSupportedDiagnosticRule()
+ public DiagnosticDescriptor GetSupportedDiagnosticRule()
{
return new DiagnosticDescriptor(DiagnosticId, Title,
MessageFormat, Category,
@@ -33,7 +32,7 @@ internal DiagnosticDescriptor GetSupportedDiagnosticRule()
///
/// The diagnostic descriptor rule.
///
- internal DiagnosticDescriptor GetRule(bool hideDiagnosticSeverity, ISettings settings)
+ public DiagnosticDescriptor GetRule(bool hideDiagnosticSeverity, ISettings settings)
{
return new DiagnosticDescriptor(DiagnosticId, Title,
MessageFormat, Category,
diff --git a/CodeDocumentor/Analyzers/Fields/FieldAnalyzer.cs b/CodeDocumentor.Analyzers/Analyzers/Fields/FieldAnalyzer.cs
similarity index 79%
rename from CodeDocumentor/Analyzers/Fields/FieldAnalyzer.cs
rename to CodeDocumentor.Analyzers/Analyzers/Fields/FieldAnalyzer.cs
index 0b24e4c..9f26647 100644
--- a/CodeDocumentor/Analyzers/Fields/FieldAnalyzer.cs
+++ b/CodeDocumentor.Analyzers/Analyzers/Fields/FieldAnalyzer.cs
@@ -1,19 +1,20 @@
using System.Collections.Immutable;
using System.Linq;
-using CodeDocumentor.Builders;
-using CodeDocumentor.Helper;
+using CodeDocumentor.Analyzers.Builders;
+using CodeDocumentor.Analyzers.Helper;
+using CodeDocumentor.Analyzers.Locators;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
-namespace CodeDocumentor
+namespace CodeDocumentor.Analyzers.Fields
{
///
/// The field analyzer.
///
[DiagnosticAnalyzer(LanguageNames.CSharp)]
- public class FieldAnalyzer : BaseDiagnosticAnalyzer
+ public class FieldAnalyzer : DiagnosticAnalyzer
{
private readonly FieldAnalyzerSettings _analyzerSettings;
@@ -47,13 +48,13 @@ public override void Initialize(AnalysisContext context)
/// Analyzes node.
///
/// The context.
- internal void AnalyzeNode(SyntaxNodeAnalysisContext context)
+ public void AnalyzeNode(SyntaxNodeAnalysisContext context)
{
if (!(context.Node is FieldDeclarationSyntax node))
{
return;
}
- var settings = context.BuildSettings(StaticSettings);
+ var settings = ServiceLocator.SettingService.BuildSettings(context);
if (!settings.IsEnabledForNonPublicFields && PrivateMemberVerifier.IsPrivateMember(node))
{
return;
@@ -64,14 +65,14 @@ internal void AnalyzeNode(SyntaxNodeAnalysisContext context)
{
return;
}
- var excludeAnanlyzer = DocumentationHeaderHelper.HasAnalyzerExclusion(node);
+ var excludeAnanlyzer = ServiceLocator.DocumentationHeaderHelper.HasAnalyzerExclusion(node);
if (excludeAnanlyzer)
{
return;
}
var field = node.DescendantNodes().OfType().First();
- context.BuildDiagnostic(node, field.Identifier, (alreadyHasComment) => _analyzerSettings.GetRule(alreadyHasComment,settings));
+ context.BuildDiagnostic(node, field.Identifier, (alreadyHasComment) => _analyzerSettings.GetRule(alreadyHasComment, settings));
}
}
}
diff --git a/CodeDocumentor/Analyzers/Fields/FieldAnalyzerSettings.cs b/CodeDocumentor.Analyzers/Analyzers/Fields/FieldAnalyzerSettings.cs
similarity index 63%
rename from CodeDocumentor/Analyzers/Fields/FieldAnalyzerSettings.cs
rename to CodeDocumentor.Analyzers/Analyzers/Fields/FieldAnalyzerSettings.cs
index a0d21c9..01a9242 100644
--- a/CodeDocumentor/Analyzers/Fields/FieldAnalyzerSettings.cs
+++ b/CodeDocumentor.Analyzers/Analyzers/Fields/FieldAnalyzerSettings.cs
@@ -1,28 +1,27 @@
-using CodeDocumentor.Analyzers;
using CodeDocumentor.Common;
using CodeDocumentor.Common.Interfaces;
using Microsoft.CodeAnalysis;
-namespace CodeDocumentor
+namespace CodeDocumentor.Analyzers
{
- internal class FieldAnalyzerSettings:BaseAnalyzerSettings
+ public class FieldAnalyzerSettings : BaseAnalyzerSettings
{
///
/// The diagnostic id.
///
- internal const string DiagnosticId = Constants.DiagnosticIds.FIELD_DIAGNOSTIC_ID;
+ public const string DiagnosticId = Constants.DiagnosticIds.FIELD_DIAGNOSTIC_ID;
///
/// The message format.
///
- internal const string MessageFormat = Title;
+ public const string MessageFormat = Title;
///
/// The title.
///
- internal const string Title = "The field must have a documentation header.";
+ public const string Title = "The field must have a documentation header.";
- internal DiagnosticDescriptor GetSupportedDiagnosticRule()
+ public DiagnosticDescriptor GetSupportedDiagnosticRule()
{
return new DiagnosticDescriptor(DiagnosticId, Title,
MessageFormat, Category,
@@ -33,7 +32,7 @@ internal DiagnosticDescriptor GetSupportedDiagnosticRule()
///
/// The diagnostic descriptor rule.
///
- internal DiagnosticDescriptor GetRule(bool hideDiagnosticSeverity, ISettings settings)
+ public DiagnosticDescriptor GetRule(bool hideDiagnosticSeverity, ISettings settings)
{
return new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat,
Category,
diff --git a/CodeDocumentor/Analyzers/Fields/NonPublicFieldAnalyzer.cs b/CodeDocumentor.Analyzers/Analyzers/Fields/NonPublicFieldAnalyzer.cs
similarity index 81%
rename from CodeDocumentor/Analyzers/Fields/NonPublicFieldAnalyzer.cs
rename to CodeDocumentor.Analyzers/Analyzers/Fields/NonPublicFieldAnalyzer.cs
index 2bedf19..8e1957f 100644
--- a/CodeDocumentor/Analyzers/Fields/NonPublicFieldAnalyzer.cs
+++ b/CodeDocumentor.Analyzers/Analyzers/Fields/NonPublicFieldAnalyzer.cs
@@ -1,16 +1,17 @@
using System.Collections.Immutable;
using System.Linq;
-using CodeDocumentor.Builders;
-using CodeDocumentor.Helper;
+using CodeDocumentor.Analyzers.Builders;
+using CodeDocumentor.Analyzers.Helper;
+using CodeDocumentor.Analyzers.Locators;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
-namespace CodeDocumentor
+namespace CodeDocumentor.Analyzers.Fields
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
- public class NonPublicFieldAnalyzer : BaseDiagnosticAnalyzer
+ public class NonPublicFieldAnalyzer : DiagnosticAnalyzer
{
private readonly FieldAnalyzerSettings _analyzerSettings;
@@ -57,19 +58,19 @@ private void AnalyzeNode(SyntaxNodeAnalysisContext context)
{
return;
}
- var settings = context.BuildSettings(StaticSettings);
+ var settings = ServiceLocator.SettingService.BuildSettings(context);
if (settings.IsEnabledForPublicMembersOnly)
{
return;
}
- var excludeAnanlyzer = DocumentationHeaderHelper.HasAnalyzerExclusion(node);
+ var excludeAnanlyzer = ServiceLocator.DocumentationHeaderHelper.HasAnalyzerExclusion(node);
if (excludeAnanlyzer)
{
return;
}
var field = node.DescendantNodes().OfType().First();
- context.BuildDiagnostic(node, field.Identifier, (alreadyHasComment) => _analyzerSettings.GetRule(alreadyHasComment,settings));
+ context.BuildDiagnostic(node, field.Identifier, (alreadyHasComment) => _analyzerSettings.GetRule(alreadyHasComment, settings));
}
}
}
diff --git a/CodeDocumentor/Analyzers/Files/FileAnalyzer.cs b/CodeDocumentor.Analyzers/Analyzers/Files/FileAnalyzer.cs
similarity index 84%
rename from CodeDocumentor/Analyzers/Files/FileAnalyzer.cs
rename to CodeDocumentor.Analyzers/Analyzers/Files/FileAnalyzer.cs
index 5b708e9..829352e 100644
--- a/CodeDocumentor/Analyzers/Files/FileAnalyzer.cs
+++ b/CodeDocumentor.Analyzers/Analyzers/Files/FileAnalyzer.cs
@@ -1,11 +1,9 @@
-using System;
-using System.Collections.Generic;
using System.Collections.Immutable;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Diagnostics;
-namespace CodeDocumentor
+namespace CodeDocumentor.Analyzers.Files
{
///
/// The class analyzer.
@@ -20,9 +18,7 @@ public override ImmutableArray SupportedDiagnostics
{
get
{
- return ImmutableArray.CreateRange(new List {
- FileAnalyzerSettings.GetRule() }
- );
+ return ImmutableArray.Create(FileAnalyzerSettings.GetRule());
}
}
@@ -53,7 +49,7 @@ private static void AnalyzeNode(SyntaxNodeAnalysisContext context)
{
context.ReportDiagnostic(Diagnostic.Create(FileAnalyzerSettings.GetRule(), node.GetLocation()));
}
- catch (OperationCanceledException ex)
+ catch
{
//noop
}
diff --git a/CodeDocumentor/Analyzers/Files/FileAnalyzerSettings.cs b/CodeDocumentor.Analyzers/Analyzers/Files/FileAnalyzerSettings.cs
similarity index 60%
rename from CodeDocumentor/Analyzers/Files/FileAnalyzerSettings.cs
rename to CodeDocumentor.Analyzers/Analyzers/Files/FileAnalyzerSettings.cs
index a25b4e4..56cfedf 100644
--- a/CodeDocumentor/Analyzers/Files/FileAnalyzerSettings.cs
+++ b/CodeDocumentor.Analyzers/Analyzers/Files/FileAnalyzerSettings.cs
@@ -1,27 +1,26 @@
-using CodeDocumentor.Analyzers;
using CodeDocumentor.Common;
using Microsoft.CodeAnalysis;
-namespace CodeDocumentor
+namespace CodeDocumentor.Analyzers
{
- internal class FileAnalyzerSettings: BaseAnalyzerSettings
+ public class FileAnalyzerSettings : BaseAnalyzerSettings
{
///
/// The title.
///
- internal const string Title = "The file needs documentation headers.";
+ public const string Title = "The file needs documentation headers.";
///
/// The diagnostic id.
///
- internal const string DiagnosticId = Constants.DiagnosticIds.FILE_DIAGNOSTIC_ID;
+ public const string DiagnosticId = Constants.DiagnosticIds.FILE_DIAGNOSTIC_ID;
///
/// The message format.
///
- internal const string MessageFormat = Title;
+ public const string MessageFormat = Title;
- internal static DiagnosticDescriptor GetRule()
+ public static DiagnosticDescriptor GetRule()
{
//we dont need to show this to still show the option to decorate the whole file. Setting DiagnosticSeverity.Hidden
return new DiagnosticDescriptor(DiagnosticId, Title,
diff --git a/CodeDocumentor/Analyzers/Interfaces/InterfaceAnalyzer.cs b/CodeDocumentor.Analyzers/Analyzers/Interfaces/InterfaceAnalyzer.cs
similarity index 76%
rename from CodeDocumentor/Analyzers/Interfaces/InterfaceAnalyzer.cs
rename to CodeDocumentor.Analyzers/Analyzers/Interfaces/InterfaceAnalyzer.cs
index a9a6768..4b43795 100644
--- a/CodeDocumentor/Analyzers/Interfaces/InterfaceAnalyzer.cs
+++ b/CodeDocumentor.Analyzers/Analyzers/Interfaces/InterfaceAnalyzer.cs
@@ -1,18 +1,19 @@
using System.Collections.Immutable;
-using CodeDocumentor.Builders;
-using CodeDocumentor.Helper;
+using CodeDocumentor.Analyzers.Builders;
+using CodeDocumentor.Analyzers.Helper;
+using CodeDocumentor.Analyzers.Locators;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
-namespace CodeDocumentor
+namespace CodeDocumentor.Analyzers.Interfaces
{
///
/// The interface analyzer.
///
[DiagnosticAnalyzer(LanguageNames.CSharp)]
- public class InterfaceAnalyzer : BaseDiagnosticAnalyzer
+ public class InterfaceAnalyzer : DiagnosticAnalyzer
{
private readonly InterfaceAnalyzerSettings _analyzerSettings;
@@ -40,23 +41,23 @@ public override void Initialize(AnalysisContext context)
/// Analyzes node.
///
/// The context.
- internal void AnalyzeNode(SyntaxNodeAnalysisContext context)
+ public void AnalyzeNode(SyntaxNodeAnalysisContext context)
{
if (!(context.Node is InterfaceDeclarationSyntax node))
{
return;
}
- var settings = context.BuildSettings(StaticSettings);
+ var settings = ServiceLocator.SettingService.BuildSettings(context);
if (settings.IsEnabledForPublicMembersOnly && PrivateMemberVerifier.IsPrivateMember(node))
{
return;
}
- var excludeAnanlyzer = DocumentationHeaderHelper.HasAnalyzerExclusion(node);
+ var excludeAnanlyzer = ServiceLocator.DocumentationHeaderHelper.HasAnalyzerExclusion(node);
if (excludeAnanlyzer)
{
return;
}
- context.BuildDiagnostic(node, node.Identifier, (alreadyHasComment) => _analyzerSettings.GetRule(alreadyHasComment,settings));
+ context.BuildDiagnostic(node, node.Identifier, (alreadyHasComment) => _analyzerSettings.GetRule(alreadyHasComment, settings));
}
}
}
diff --git a/CodeDocumentor/Analyzers/Interfaces/InterfaceAnalyzerSettings.cs b/CodeDocumentor.Analyzers/Analyzers/Interfaces/InterfaceAnalyzerSettings.cs
similarity index 62%
rename from CodeDocumentor/Analyzers/Interfaces/InterfaceAnalyzerSettings.cs
rename to CodeDocumentor.Analyzers/Analyzers/Interfaces/InterfaceAnalyzerSettings.cs
index dc4e98d..2daf6c4 100644
--- a/CodeDocumentor/Analyzers/Interfaces/InterfaceAnalyzerSettings.cs
+++ b/CodeDocumentor.Analyzers/Analyzers/Interfaces/InterfaceAnalyzerSettings.cs
@@ -1,29 +1,28 @@
-using CodeDocumentor.Analyzers;
using CodeDocumentor.Common;
using CodeDocumentor.Common.Interfaces;
using Microsoft.CodeAnalysis;
-namespace CodeDocumentor
+namespace CodeDocumentor.Analyzers
{
- internal class InterfaceAnalyzerSettings:BaseAnalyzerSettings
+ public class InterfaceAnalyzerSettings : BaseAnalyzerSettings
{
///
/// The diagnostic id.
///
- internal const string DiagnosticId = Constants.DiagnosticIds.INTERFACE_DIAGNOSTIC_ID;
+ public const string DiagnosticId = Constants.DiagnosticIds.INTERFACE_DIAGNOSTIC_ID;
///
/// The message format.
///
- internal const string MessageFormat = Title;
+ public const string MessageFormat = Title;
///
/// The title.
///
- internal const string Title = "The interface must have a documentation header.";
+ public const string Title = "The interface must have a documentation header.";
- internal DiagnosticDescriptor GetSupportedDiagnosticRule()
+ public DiagnosticDescriptor GetSupportedDiagnosticRule()
{
return new DiagnosticDescriptor(DiagnosticId, Title,
MessageFormat, Category,
@@ -34,7 +33,7 @@ internal DiagnosticDescriptor GetSupportedDiagnosticRule()
///
/// The diagnostic descriptor rule.
///
- internal DiagnosticDescriptor GetRule(bool hideDiagnosticSeverity, ISettings settings)
+ public DiagnosticDescriptor GetRule(bool hideDiagnosticSeverity, ISettings settings)
{
return new DiagnosticDescriptor(DiagnosticId, Title,
MessageFormat, Category,
diff --git a/CodeDocumentor/Analyzers/Methods/MethodAnalyzer.cs b/CodeDocumentor.Analyzers/Analyzers/Methods/MethodAnalyzer.cs
similarity index 78%
rename from CodeDocumentor/Analyzers/Methods/MethodAnalyzer.cs
rename to CodeDocumentor.Analyzers/Analyzers/Methods/MethodAnalyzer.cs
index 5fcdf17..60307b1 100644
--- a/CodeDocumentor/Analyzers/Methods/MethodAnalyzer.cs
+++ b/CodeDocumentor.Analyzers/Analyzers/Methods/MethodAnalyzer.cs
@@ -1,18 +1,19 @@
using System.Collections.Immutable;
-using CodeDocumentor.Builders;
-using CodeDocumentor.Helper;
+using CodeDocumentor.Analyzers.Builders;
+using CodeDocumentor.Analyzers.Helper;
+using CodeDocumentor.Analyzers.Locators;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
-namespace CodeDocumentor
+namespace CodeDocumentor.Analyzers.Methods
{
///
/// The method analyzer.
///
[DiagnosticAnalyzer(LanguageNames.CSharp)]
- public class MethodAnalyzer : BaseDiagnosticAnalyzer
+ public class MethodAnalyzer : DiagnosticAnalyzer
{
private readonly MethodAnalyzerSettings _analyzerSettings;
@@ -46,7 +47,7 @@ public override void Initialize(AnalysisContext context)
/// Analyzes node.
///
/// The context.
- internal void AnalyzeNode(SyntaxNodeAnalysisContext context)
+ public void AnalyzeNode(SyntaxNodeAnalysisContext context)
{
if (!(context.Node is MethodDeclarationSyntax node))
{
@@ -60,13 +61,13 @@ internal void AnalyzeNode(SyntaxNodeAnalysisContext context)
{
return;
}
- var excludeAnanlyzer = DocumentationHeaderHelper.HasAnalyzerExclusion(node);
+ var excludeAnanlyzer = ServiceLocator.DocumentationHeaderHelper.HasAnalyzerExclusion(node);
if (excludeAnanlyzer)
{
return;
}
- var settings = context.BuildSettings(StaticSettings);
- context.BuildDiagnostic(node, node.Identifier, (alreadyHasComment) => _analyzerSettings.GetRule(alreadyHasComment,settings));
+ var settings = ServiceLocator.SettingService.BuildSettings(context);
+ context.BuildDiagnostic(node, node.Identifier, (alreadyHasComment) => _analyzerSettings.GetRule(alreadyHasComment, settings));
}
}
}
diff --git a/CodeDocumentor/Analyzers/Enums/EnumAnalyzerSettings.cs b/CodeDocumentor.Analyzers/Analyzers/Methods/MethodAnalyzerSettings.cs
similarity index 64%
rename from CodeDocumentor/Analyzers/Enums/EnumAnalyzerSettings.cs
rename to CodeDocumentor.Analyzers/Analyzers/Methods/MethodAnalyzerSettings.cs
index ef5a325..f6b5457 100644
--- a/CodeDocumentor/Analyzers/Enums/EnumAnalyzerSettings.cs
+++ b/CodeDocumentor.Analyzers/Analyzers/Methods/MethodAnalyzerSettings.cs
@@ -1,28 +1,27 @@
-using CodeDocumentor.Analyzers;
using CodeDocumentor.Common;
using CodeDocumentor.Common.Interfaces;
using Microsoft.CodeAnalysis;
-namespace CodeDocumentor
+namespace CodeDocumentor.Analyzers
{
- internal class EnumAnalyzerSettings : BaseAnalyzerSettings
+ public class MethodAnalyzerSettings : BaseAnalyzerSettings
{
///
/// The diagnostic id.
///
- internal const string DiagnosticId = Constants.DiagnosticIds.ENUM_DIAGNOSTIC_ID;
+ public const string DiagnosticId = Constants.DiagnosticIds.METHOD_DIAGNOSTIC_ID;
///
/// The message format.
///
- internal const string MessageFormat = Title;
+ public const string MessageFormat = Title;
///
/// The title.
///
- internal const string Title = "The enum must have a documentation header.";
+ public const string Title = "The method must have a documentation header.";
- internal DiagnosticDescriptor GetSupportedDiagnosticRule()
+ public DiagnosticDescriptor GetSupportedDiagnosticRule()
{
return new DiagnosticDescriptor(DiagnosticId, Title,
MessageFormat, Category,
@@ -33,7 +32,7 @@ internal DiagnosticDescriptor GetSupportedDiagnosticRule()
///
/// The diagnostic descriptor rule.
///
- internal DiagnosticDescriptor GetRule(bool hideDiagnosticSeverity, ISettings settings)
+ public DiagnosticDescriptor GetRule(bool hideDiagnosticSeverity, ISettings settings)
{
return new DiagnosticDescriptor(DiagnosticId, Title,
MessageFormat, Category,
diff --git a/CodeDocumentor/Analyzers/Methods/NonPublicMethodAnalyzer.cs b/CodeDocumentor.Analyzers/Analyzers/Methods/NonPublicMethodAnalyzer.cs
similarity index 80%
rename from CodeDocumentor/Analyzers/Methods/NonPublicMethodAnalyzer.cs
rename to CodeDocumentor.Analyzers/Analyzers/Methods/NonPublicMethodAnalyzer.cs
index f864a0d..d437d35 100644
--- a/CodeDocumentor/Analyzers/Methods/NonPublicMethodAnalyzer.cs
+++ b/CodeDocumentor.Analyzers/Analyzers/Methods/NonPublicMethodAnalyzer.cs
@@ -1,15 +1,16 @@
using System.Collections.Immutable;
-using CodeDocumentor.Builders;
-using CodeDocumentor.Helper;
+using CodeDocumentor.Analyzers.Builders;
+using CodeDocumentor.Analyzers.Helper;
+using CodeDocumentor.Analyzers.Locators;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
-namespace CodeDocumentor
+namespace CodeDocumentor.Analyzers.Methods
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
- public class NonPublicMethodAnalyzer : BaseDiagnosticAnalyzer
+ public class NonPublicMethodAnalyzer : DiagnosticAnalyzer
{
private readonly MethodAnalyzerSettings _analyzerSettings;
@@ -51,18 +52,18 @@ private void AnalyzeNode(SyntaxNodeAnalysisContext context)
{
return;
}
- var settings = context.BuildSettings(StaticSettings);
+ var settings = ServiceLocator.SettingService.BuildSettings(context);
//NOTE: Since interfaces declarations do not have accessors, we allow documenting all the time.
if (!node.IsOwnedByInterface() && settings.IsEnabledForPublicMembersOnly)
{
return;
}
- var excludeAnanlyzer = DocumentationHeaderHelper.HasAnalyzerExclusion(node);
+ var excludeAnanlyzer = ServiceLocator.DocumentationHeaderHelper.HasAnalyzerExclusion(node);
if (excludeAnanlyzer)
{
return;
}
- context.BuildDiagnostic(node, node.Identifier, (alreadyHasComment) => _analyzerSettings.GetRule(alreadyHasComment,settings));
+ context.BuildDiagnostic(node, node.Identifier, (alreadyHasComment) => _analyzerSettings.GetRule(alreadyHasComment, settings));
}
}
}
diff --git a/CodeDocumentor/Analyzers/Properties/NonPublicPropertyAnalyzer.cs b/CodeDocumentor.Analyzers/Analyzers/Properties/NonPublicPropertyAnalyzer.cs
similarity index 77%
rename from CodeDocumentor/Analyzers/Properties/NonPublicPropertyAnalyzer.cs
rename to CodeDocumentor.Analyzers/Analyzers/Properties/NonPublicPropertyAnalyzer.cs
index 1609966..12e2e74 100644
--- a/CodeDocumentor/Analyzers/Properties/NonPublicPropertyAnalyzer.cs
+++ b/CodeDocumentor.Analyzers/Analyzers/Properties/NonPublicPropertyAnalyzer.cs
@@ -1,18 +1,19 @@
using System.Collections.Immutable;
-using CodeDocumentor.Builders;
-using CodeDocumentor.Helper;
+using CodeDocumentor.Analyzers.Builders;
+using CodeDocumentor.Analyzers.Helper;
+using CodeDocumentor.Analyzers.Locators;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
-namespace CodeDocumentor
+namespace CodeDocumentor.Analyzers.Properties
{
///
/// The property analyzer.
///
[DiagnosticAnalyzer(LanguageNames.CSharp)]
- public class NonPublicPropertyAnalyzer : BaseDiagnosticAnalyzer
+ public class NonPublicPropertyAnalyzer : DiagnosticAnalyzer
{
private readonly PropertyAnalyzerSettings _analyzerSettings;
@@ -47,7 +48,7 @@ public override void Initialize(AnalysisContext context)
/// Analyzes node.
///
/// The context.
- internal void AnalyzeNode(SyntaxNodeAnalysisContext context)
+ public void AnalyzeNode(SyntaxNodeAnalysisContext context)
{
if (!(context.Node is PropertyDeclarationSyntax node))
{
@@ -57,18 +58,18 @@ internal void AnalyzeNode(SyntaxNodeAnalysisContext context)
{
return;
}
- var settings = context.BuildSettings(StaticSettings);
+ var settings = ServiceLocator.SettingService.BuildSettings(context);
if (settings.IsEnabledForPublicMembersOnly)
{
return;
}
- var excludeAnanlyzer = DocumentationHeaderHelper.HasAnalyzerExclusion(node);
+ var excludeAnanlyzer = ServiceLocator.DocumentationHeaderHelper.HasAnalyzerExclusion(node);
if (excludeAnanlyzer)
{
return;
}
- context.BuildDiagnostic(node, node.Identifier, (alreadyHasComment) => _analyzerSettings.GetRule(alreadyHasComment,settings));
+ context.BuildDiagnostic(node, node.Identifier, (alreadyHasComment) => _analyzerSettings.GetRule(alreadyHasComment, settings));
}
}
}
diff --git a/CodeDocumentor/Analyzers/Properties/PropertyAnalyzer.cs b/CodeDocumentor.Analyzers/Analyzers/Properties/PropertyAnalyzer.cs
similarity index 76%
rename from CodeDocumentor/Analyzers/Properties/PropertyAnalyzer.cs
rename to CodeDocumentor.Analyzers/Analyzers/Properties/PropertyAnalyzer.cs
index 96f6d5d..e2c10ed 100644
--- a/CodeDocumentor/Analyzers/Properties/PropertyAnalyzer.cs
+++ b/CodeDocumentor.Analyzers/Analyzers/Properties/PropertyAnalyzer.cs
@@ -1,18 +1,19 @@
using System.Collections.Immutable;
-using CodeDocumentor.Builders;
-using CodeDocumentor.Helper;
+using CodeDocumentor.Analyzers.Builders;
+using CodeDocumentor.Analyzers.Helper;
+using CodeDocumentor.Analyzers.Locators;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
-namespace CodeDocumentor
+namespace CodeDocumentor.Analyzers.Properties
{
///
/// The property analyzer.
///
[DiagnosticAnalyzer(LanguageNames.CSharp)]
- public class PropertyAnalyzer : BaseDiagnosticAnalyzer
+ public class PropertyAnalyzer : DiagnosticAnalyzer
{
private readonly PropertyAnalyzerSettings _analyzerSettings;
@@ -46,7 +47,7 @@ public override void Initialize(AnalysisContext context)
/// Analyzes node.
///
/// The context.
- internal void AnalyzeNode(SyntaxNodeAnalysisContext context)
+ public void AnalyzeNode(SyntaxNodeAnalysisContext context)
{
if (!(context.Node is PropertyDeclarationSyntax node))
{
@@ -56,13 +57,13 @@ internal void AnalyzeNode(SyntaxNodeAnalysisContext context)
{
return;
}
- var excludeAnanlyzer = DocumentationHeaderHelper.HasAnalyzerExclusion(node);
+ var excludeAnanlyzer = ServiceLocator.DocumentationHeaderHelper.HasAnalyzerExclusion(node);
if (excludeAnanlyzer)
{
return;
}
- var settings = context.BuildSettings(StaticSettings);
- context.BuildDiagnostic(node, node.Identifier, (alreadyHasComment) => _analyzerSettings.GetRule(alreadyHasComment,settings));
+ var settings = ServiceLocator.SettingService.BuildSettings(context);
+ context.BuildDiagnostic(node, node.Identifier, (alreadyHasComment) => _analyzerSettings.GetRule(alreadyHasComment, settings));
}
}
}
diff --git a/CodeDocumentor/Analyzers/Properties/PropertyAnalyzerSettings.cs b/CodeDocumentor.Analyzers/Analyzers/Properties/PropertyAnalyzerSettings.cs
similarity index 62%
rename from CodeDocumentor/Analyzers/Properties/PropertyAnalyzerSettings.cs
rename to CodeDocumentor.Analyzers/Analyzers/Properties/PropertyAnalyzerSettings.cs
index d5279bd..de508e0 100644
--- a/CodeDocumentor/Analyzers/Properties/PropertyAnalyzerSettings.cs
+++ b/CodeDocumentor.Analyzers/Analyzers/Properties/PropertyAnalyzerSettings.cs
@@ -1,28 +1,27 @@
-using CodeDocumentor.Analyzers;
using CodeDocumentor.Common;
using CodeDocumentor.Common.Interfaces;
using Microsoft.CodeAnalysis;
-namespace CodeDocumentor
+namespace CodeDocumentor.Analyzers
{
- internal class PropertyAnalyzerSettings: BaseAnalyzerSettings
+ public class PropertyAnalyzerSettings : BaseAnalyzerSettings
{
///
/// The diagnostic id.
///
- internal const string DiagnosticId = Constants.DiagnosticIds.PROPERTY_DIAGNOSTIC_ID;
+ public const string DiagnosticId = Constants.DiagnosticIds.PROPERTY_DIAGNOSTIC_ID;
///
/// The message format.
///
- internal const string MessageFormat = Title;
+ public const string MessageFormat = Title;
///
/// The title.
///
- internal const string Title = "The property must have a documentation header.";
+ public const string Title = "The property must have a documentation header.";
- internal DiagnosticDescriptor GetSupportedDiagnosticRule()
+ public DiagnosticDescriptor GetSupportedDiagnosticRule()
{
return new DiagnosticDescriptor(DiagnosticId, Title,
MessageFormat, Category,
@@ -33,7 +32,7 @@ internal DiagnosticDescriptor GetSupportedDiagnosticRule()
///
/// The diagnostic descriptor rule.
///
- internal DiagnosticDescriptor GetRule(bool hideDiagnosticSeverity, ISettings settings)
+ public DiagnosticDescriptor GetRule(bool hideDiagnosticSeverity, ISettings settings)
{
return new DiagnosticDescriptor(DiagnosticId, Title,
MessageFormat, Category,
diff --git a/CodeDocumentor/Analyzers/Records/NonPublicRecordAnalyzer.cs b/CodeDocumentor.Analyzers/Analyzers/Records/NonPublicRecordAnalyzer.cs
similarity index 79%
rename from CodeDocumentor/Analyzers/Records/NonPublicRecordAnalyzer.cs
rename to CodeDocumentor.Analyzers/Analyzers/Records/NonPublicRecordAnalyzer.cs
index 949d78f..174c16f 100644
--- a/CodeDocumentor/Analyzers/Records/NonPublicRecordAnalyzer.cs
+++ b/CodeDocumentor.Analyzers/Analyzers/Records/NonPublicRecordAnalyzer.cs
@@ -1,18 +1,19 @@
using System.Collections.Immutable;
-using CodeDocumentor.Builders;
-using CodeDocumentor.Helper;
+using CodeDocumentor.Analyzers.Builders;
+using CodeDocumentor.Analyzers.Helper;
+using CodeDocumentor.Analyzers.Locators;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
-namespace CodeDocumentor
+namespace CodeDocumentor.Analyzers.Records
{
///
/// The class analyzer.
///
[DiagnosticAnalyzer(LanguageNames.CSharp)]
- public class NonPublicRecordAnalyzer : BaseDiagnosticAnalyzer
+ public class NonPublicRecordAnalyzer : DiagnosticAnalyzer
{
private readonly RecordAnalyzerSettings _analyzerSettings;
@@ -53,17 +54,17 @@ private void AnalyzeNode(SyntaxNodeAnalysisContext context)
{
return;
}
- var settings = context.BuildSettings(StaticSettings);
+ var settings = ServiceLocator.SettingService.BuildSettings(context);
if (settings.IsEnabledForPublicMembersOnly)
{
return;
}
- var excludeAnanlyzer = DocumentationHeaderHelper.HasAnalyzerExclusion(node);
+ var excludeAnanlyzer = ServiceLocator.DocumentationHeaderHelper.HasAnalyzerExclusion(node);
if (excludeAnanlyzer)
{
return;
}
- context.BuildDiagnostic(node, node.Identifier, (alreadyHasComment) => _analyzerSettings.GetRule(alreadyHasComment,settings));
+ context.BuildDiagnostic(node, node.Identifier, (alreadyHasComment) => _analyzerSettings.GetRule(alreadyHasComment, settings));
}
}
}
diff --git a/CodeDocumentor/Analyzers/Records/RecordAnalyzer.cs b/CodeDocumentor.Analyzers/Analyzers/Records/RecordAnalyzer.cs
similarity index 76%
rename from CodeDocumentor/Analyzers/Records/RecordAnalyzer.cs
rename to CodeDocumentor.Analyzers/Analyzers/Records/RecordAnalyzer.cs
index 8e90d74..3432ab3 100644
--- a/CodeDocumentor/Analyzers/Records/RecordAnalyzer.cs
+++ b/CodeDocumentor.Analyzers/Analyzers/Records/RecordAnalyzer.cs
@@ -1,18 +1,19 @@
using System.Collections.Immutable;
-using CodeDocumentor.Builders;
-using CodeDocumentor.Helper;
+using CodeDocumentor.Analyzers.Builders;
+using CodeDocumentor.Analyzers.Helper;
+using CodeDocumentor.Analyzers.Locators;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
-namespace CodeDocumentor
+namespace CodeDocumentor.Analyzers.Records
{
///
/// The class analyzer.
///
[DiagnosticAnalyzer(LanguageNames.CSharp)]
- public class RecordAnalyzer : BaseDiagnosticAnalyzer
+ public class RecordAnalyzer : DiagnosticAnalyzer
{
private readonly RecordAnalyzerSettings _analyzerSettings;
@@ -46,7 +47,7 @@ public override void Initialize(AnalysisContext context)
/// Analyzes node.
///
/// The context.
- internal void AnalyzeNode(SyntaxNodeAnalysisContext context)
+ public void AnalyzeNode(SyntaxNodeAnalysisContext context)
{
if (!(context.Node is RecordDeclarationSyntax node))
{
@@ -56,13 +57,13 @@ internal void AnalyzeNode(SyntaxNodeAnalysisContext context)
{
return;
}
- var excludeAnanlyzer = DocumentationHeaderHelper.HasAnalyzerExclusion(node);
+ var excludeAnanlyzer = ServiceLocator.DocumentationHeaderHelper.HasAnalyzerExclusion(node);
if (excludeAnanlyzer)
{
return;
}
- var settings = context.BuildSettings(StaticSettings);
- context.BuildDiagnostic(node, node.Identifier, (alreadyHasComment) => _analyzerSettings.GetRule(alreadyHasComment,settings));
+ var settings = ServiceLocator.SettingService.BuildSettings(context);
+ context.BuildDiagnostic(node, node.Identifier, (alreadyHasComment) => _analyzerSettings.GetRule(alreadyHasComment, settings));
}
}
}
diff --git a/CodeDocumentor/Analyzers/Records/RecordAnalyzerSettings.cs b/CodeDocumentor.Analyzers/Analyzers/Records/RecordAnalyzerSettings.cs
similarity index 60%
rename from CodeDocumentor/Analyzers/Records/RecordAnalyzerSettings.cs
rename to CodeDocumentor.Analyzers/Analyzers/Records/RecordAnalyzerSettings.cs
index 98e2d76..d967157 100644
--- a/CodeDocumentor/Analyzers/Records/RecordAnalyzerSettings.cs
+++ b/CodeDocumentor.Analyzers/Analyzers/Records/RecordAnalyzerSettings.cs
@@ -1,28 +1,27 @@
-using CodeDocumentor.Analyzers;
using CodeDocumentor.Common;
using CodeDocumentor.Common.Interfaces;
using Microsoft.CodeAnalysis;
-namespace CodeDocumentor
+namespace CodeDocumentor.Analyzers
{
- internal class RecordAnalyzerSettings: BaseAnalyzerSettings
+ public class RecordAnalyzerSettings : BaseAnalyzerSettings
{
///
/// The diagnostic id.
///
- internal const string DiagnosticId = Constants.DiagnosticIds.RECORD_DIAGNOSTIC_ID;
+ public const string DiagnosticId = Constants.DiagnosticIds.RECORD_DIAGNOSTIC_ID;
///
/// The message format.
///
- internal const string MessageFormat = Title;
+ public const string MessageFormat = Title;
///
/// The title.
///
- internal const string Title = "The record must have a documentation header.";
+ public const string Title = "The record must have a documentation header.";
- internal DiagnosticDescriptor GetSupportedDiagnosticRule()
+ public DiagnosticDescriptor GetSupportedDiagnosticRule()
{
return new DiagnosticDescriptor(DiagnosticId, Title,
MessageFormat, Category,
@@ -30,7 +29,7 @@ internal DiagnosticDescriptor GetSupportedDiagnosticRule()
true);
}
- internal DiagnosticDescriptor GetRule(bool hideDiagnosticSeverity, ISettings settings)
+ public DiagnosticDescriptor GetRule(bool hideDiagnosticSeverity, ISettings settings)
{
return new DiagnosticDescriptor(DiagnosticId, Title,
MessageFormat, Category,
diff --git a/CodeDocumentor/Builders/DiagnosticBuilder.cs b/CodeDocumentor.Analyzers/Builders/DiagnosticBuilder.cs
similarity index 90%
rename from CodeDocumentor/Builders/DiagnosticBuilder.cs
rename to CodeDocumentor.Analyzers/Builders/DiagnosticBuilder.cs
index 77796a5..fa1da0d 100644
--- a/CodeDocumentor/Builders/DiagnosticBuilder.cs
+++ b/CodeDocumentor.Analyzers/Builders/DiagnosticBuilder.cs
@@ -1,13 +1,12 @@
using System;
using System.Linq;
-using CodeDocumentor.Helper;
-using CodeDocumentor.Locators;
+using CodeDocumentor.Analyzers.Locators;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
-namespace CodeDocumentor.Builders
+namespace CodeDocumentor.Analyzers.Builders
{
public static class DiagnosticBuilder
{
@@ -30,7 +29,7 @@ public static void BuildDiagnostic(this SyntaxNodeAnalysisContext context, CShar
var commentHelper = ServiceLocator.CommentHelper;
var alreadyHasComment = commentTriviaSyntax != null && commentHelper.HasComment(commentTriviaSyntax);
- var settings = context.BuildSettings(null);
+ var settings = ServiceLocator.SettingService.BuildSettings(context);
try
{
context.ReportDiagnostic(Diagnostic.Create(getRuleCallback.Invoke(alreadyHasComment), identifier.GetLocation()));
diff --git a/CodeDocumentor/Builders/DocumentationBuilder.cs b/CodeDocumentor.Analyzers/Builders/DocumentationBuilder.cs
similarity index 89%
rename from CodeDocumentor/Builders/DocumentationBuilder.cs
rename to CodeDocumentor.Analyzers/Builders/DocumentationBuilder.cs
index 573a1e3..19c6665 100644
--- a/CodeDocumentor/Builders/DocumentationBuilder.cs
+++ b/CodeDocumentor.Analyzers/Builders/DocumentationBuilder.cs
@@ -1,15 +1,15 @@
using System.Collections.Generic;
using System.Linq;
+using CodeDocumentor.Analyzers.Constructors;
+using CodeDocumentor.Analyzers.Helper;
+using CodeDocumentor.Analyzers.Locators;
using CodeDocumentor.Common;
using CodeDocumentor.Common.Models;
-using CodeDocumentor.Constructors;
-using CodeDocumentor.Helper;
-using CodeDocumentor.Locators;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-namespace CodeDocumentor.Builders
+namespace CodeDocumentor.Analyzers.Builders
{
public class DocumentationBuilder
{
@@ -17,18 +17,18 @@ public class DocumentationBuilder
private XmlElementSyntax _currentElement;
private readonly List _list = new List();
- internal SyntaxList Build()
+ public SyntaxList Build()
{
return new SyntaxList(_list);
}
- internal DocumentationBuilder Reset()
+ public DocumentationBuilder Reset()
{
_currentElement = null;
return this;
}
- internal DocumentationBuilder WithExceptionTypes(MethodDeclarationSyntax declarationSyntax)
+ public DocumentationBuilder WithExceptionTypes(MethodDeclarationSyntax declarationSyntax)
{
var exceptions = _documentationHeaderHelper.GetExceptions(declarationSyntax.Body?.ToFullString());
@@ -47,7 +47,7 @@ internal DocumentationBuilder WithExceptionTypes(MethodDeclarationSyntax declara
return this;
}
- internal DocumentationBuilder WithExisting(CSharpSyntaxNode declarationSyntax, string xmlNodeName)
+ public DocumentationBuilder WithExisting(CSharpSyntaxNode declarationSyntax, string xmlNodeName)
{
var remarks = declarationSyntax.GetElementSyntax(xmlNodeName);
if (remarks != null)
@@ -59,7 +59,7 @@ internal DocumentationBuilder WithExisting(CSharpSyntaxNode declarationSyntax, s
return this;
}
- internal DocumentationBuilder WithParameters(BaseMethodDeclarationSyntax declarationSyntax, WordMap[] wordMaps)
+ public DocumentationBuilder WithParameters(BaseMethodDeclarationSyntax declarationSyntax, WordMap[] wordMaps)
{
if (declarationSyntax?.ParameterList?.Parameters.Any() == true)
{
@@ -77,14 +77,14 @@ internal DocumentationBuilder WithParameters(BaseMethodDeclarationSyntax declara
return this;
}
- internal DocumentationBuilder WithParameters(TypeDeclarationSyntax declarationSyntax, WordMap[] wordMaps)
+ public DocumentationBuilder WithParameters(TypeDeclarationSyntax declarationSyntax, WordMap[] wordMaps)
{
if (declarationSyntax?.ParameterList?.Parameters.Any() == true)
{
var commentHelper = ServiceLocator.CommentHelper;
foreach (var parameter in declarationSyntax.ParameterList.Parameters)
{
- var parameterComment = commentHelper.CreateParameterComment(parameter,wordMaps);
+ var parameterComment = commentHelper.CreateParameterComment(parameter, wordMaps);
var parameterElement = _documentationHeaderHelper.CreateParameterElementSyntax(parameter.Identifier.ValueText, parameterComment);
@@ -96,7 +96,7 @@ internal DocumentationBuilder WithParameters(TypeDeclarationSyntax declarationSy
return this;
}
- internal DocumentationBuilder WithPropertyValueTypes(BasePropertyDeclarationSyntax declarationSyntax,
+ public DocumentationBuilder WithPropertyValueTypes(BasePropertyDeclarationSyntax declarationSyntax,
ReturnTypeBuilderOptions options, WordMap[] wordMaps)
{
if (options.GenerateReturnStatement)
@@ -111,12 +111,12 @@ internal DocumentationBuilder WithPropertyValueTypes(BasePropertyDeclarationSynt
return this;
}
- internal DocumentationBuilder WithReturnType(MethodDeclarationSyntax declarationSyntax,
+ public DocumentationBuilder WithReturnType(MethodDeclarationSyntax declarationSyntax,
bool useNaturalLanguageForReturnNode,
bool tryToIncludeCrefsForReturnTypes,
WordMap[] wordMaps)
{
- var returnType = declarationSyntax.ReturnType.ToString().Replace("?",string.Empty);
+ var returnType = declarationSyntax.ReturnType.ToString().Replace("?", string.Empty);
if (returnType != "void")
{
var commentConstructor = new ReturnCommentConstruction(declarationSyntax.ReturnType,
@@ -133,7 +133,7 @@ internal DocumentationBuilder WithReturnType(MethodDeclarationSyntax declaration
return this;
}
- internal DocumentationBuilder WithSummary(CSharpSyntaxNode declarationSyntax, string content, bool preserveExistingSummaryText)
+ public DocumentationBuilder WithSummary(CSharpSyntaxNode declarationSyntax, string content, bool preserveExistingSummaryText)
{
if (preserveExistingSummaryText)
{
@@ -153,7 +153,7 @@ internal DocumentationBuilder WithSummary(CSharpSyntaxNode declarationSyntax, st
return this;
}
- internal DocumentationBuilder WithSummary(string content)
+ public DocumentationBuilder WithSummary(string content)
{
Reset().WithTripleSlashSpace().WithStartingTag(Constants.SUMMARY).WithLineEndTextSyntax()
.WithTripleSlashSpace().WithContent(content).WithLineEndTextSyntax()
@@ -162,7 +162,7 @@ internal DocumentationBuilder WithSummary(string content)
return this;
}
- internal DocumentationBuilder WithTypeParamters(TypeDeclarationSyntax declarationSyntax)
+ public DocumentationBuilder WithTypeParamters(TypeDeclarationSyntax declarationSyntax)
{
if (declarationSyntax?.TypeParameterList?.Parameters.Any() == true)
{
@@ -177,7 +177,7 @@ internal DocumentationBuilder WithTypeParamters(TypeDeclarationSyntax declaratio
return this;
}
- internal DocumentationBuilder WithTypeParamters(MethodDeclarationSyntax declarationSyntax)
+ public DocumentationBuilder WithTypeParamters(MethodDeclarationSyntax declarationSyntax)
{
if (declarationSyntax?.TypeParameterList?.Parameters.Any() == true)
{
diff --git a/CodeDocumentor.Analyzers/CodeDocumentor.Analyzers.csproj b/CodeDocumentor.Analyzers/CodeDocumentor.Analyzers.csproj
new file mode 100644
index 0000000..8045aaf
--- /dev/null
+++ b/CodeDocumentor.Analyzers/CodeDocumentor.Analyzers.csproj
@@ -0,0 +1,17 @@
+
+
+
+ netstandard2.0
+ true
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CodeDocumentor/Constructors/BaseReturnTypeCommentConstruction.cs b/CodeDocumentor.Analyzers/Constructors/BaseReturnTypeCommentConstruction.cs
similarity index 95%
rename from CodeDocumentor/Constructors/BaseReturnTypeCommentConstruction.cs
rename to CodeDocumentor.Analyzers/Constructors/BaseReturnTypeCommentConstruction.cs
index 1c36752..9986b8a 100644
--- a/CodeDocumentor/Constructors/BaseReturnTypeCommentConstruction.cs
+++ b/CodeDocumentor.Analyzers/Constructors/BaseReturnTypeCommentConstruction.cs
@@ -1,13 +1,13 @@
using System;
using System.Linq;
+using CodeDocumentor.Analyzers.Helper;
+using CodeDocumentor.Analyzers.Locators;
+using CodeDocumentor.Analyzers.Managers;
using CodeDocumentor.Common.Models;
-using CodeDocumentor.Helper;
-using CodeDocumentor.Locators;
-using CodeDocumentor.Managers;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-namespace CodeDocumentor.Constructors
+namespace CodeDocumentor.Analyzers.Constructors
{
public abstract class BaseReturnTypeCommentConstruction
{
@@ -38,7 +38,7 @@ public abstract class BaseReturnTypeCommentConstruction
/// The return type.
/// The options
/// The comment
- internal virtual string BuildComment(TypeSyntax returnType, ReturnTypeBuilderOptions options, WordMap[] wordMaps)
+ public virtual string BuildComment(TypeSyntax returnType, ReturnTypeBuilderOptions options, WordMap[] wordMaps)
{
var returnComment = string.Empty;
if (returnType is IdentifierNameSyntax identifier)
@@ -114,7 +114,7 @@ private static MethodDeclarationSyntax GetMethodDeclarationSyntax(SyntaxNode nod
private string GenerateGeneralComment(ReadOnlySpan returnType, ReturnTypeBuilderOptions options)
{
var rt = returnType.ToString().Trim();
- string startWord = "";
+ var startWord = "";
if (options.IncludeStartingWordInText)
{
startWord = DocumentationHeaderHelper.DetermineStartingWord(rt.AsSpan(), options.UseProperCasing);
diff --git a/CodeDocumentor/Constructors/ReturnCommentConstruction.cs b/CodeDocumentor.Analyzers/Constructors/ReturnCommentConstruction.cs
similarity index 95%
rename from CodeDocumentor/Constructors/ReturnCommentConstruction.cs
rename to CodeDocumentor.Analyzers/Constructors/ReturnCommentConstruction.cs
index ef017d1..44d3033 100644
--- a/CodeDocumentor/Constructors/ReturnCommentConstruction.cs
+++ b/CodeDocumentor.Analyzers/Constructors/ReturnCommentConstruction.cs
@@ -1,9 +1,8 @@
using System;
using CodeDocumentor.Common.Models;
-using CodeDocumentor.Helper;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-namespace CodeDocumentor.Constructors
+namespace CodeDocumentor.Analyzers.Constructors
{
///
/// The return comment construction.
@@ -34,7 +33,7 @@ public ReturnCommentConstruction(TypeSyntax returnType, ReturnTypeBuilderOptions
}
//used for testing
- internal ReturnCommentConstruction()
+ public ReturnCommentConstruction()
{
}
diff --git a/CodeDocumentor/Constructors/SingleWordCommentSummaryConstruction.cs b/CodeDocumentor.Analyzers/Constructors/SingleWordCommentSummaryConstruction.cs
similarity index 96%
rename from CodeDocumentor/Constructors/SingleWordCommentSummaryConstruction.cs
rename to CodeDocumentor.Analyzers/Constructors/SingleWordCommentSummaryConstruction.cs
index ed786d0..f17153e 100644
--- a/CodeDocumentor/Constructors/SingleWordCommentSummaryConstruction.cs
+++ b/CodeDocumentor.Analyzers/Constructors/SingleWordCommentSummaryConstruction.cs
@@ -1,9 +1,8 @@
using System;
using CodeDocumentor.Common.Models;
-using CodeDocumentor.Helper;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-namespace CodeDocumentor.Constructors
+namespace CodeDocumentor.Analyzers.Constructors
{
public class SingleWordCommentSummaryConstruction : BaseReturnTypeCommentConstruction
{
diff --git a/CodeDocumentor/Helper/CommentHelper.cs b/CodeDocumentor.Analyzers/Helper/CommentHelper.cs
similarity index 98%
rename from CodeDocumentor/Helper/CommentHelper.cs
rename to CodeDocumentor.Analyzers/Helper/CommentHelper.cs
index 8ff3c3e..bf7f468 100644
--- a/CodeDocumentor/Helper/CommentHelper.cs
+++ b/CodeDocumentor.Analyzers/Helper/CommentHelper.cs
@@ -2,6 +2,8 @@
using System.Linq;
using System.Runtime.CompilerServices;
using CodeDocumentor.Common;
+using CodeDocumentor.Common.Extensions;
+using CodeDocumentor.Common.Helpers;
using CodeDocumentor.Common.Models;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
@@ -9,7 +11,7 @@
[assembly: InternalsVisibleTo("CodeDocumentor.Test")]
-namespace CodeDocumentor.Helper
+namespace CodeDocumentor.Analyzers.Helper
{
///
/// The comment helper.
@@ -74,7 +76,7 @@ public string CreateConstructorComment(string name, bool isPrivate, WordMap[] wo
///
/// The name.
/// A string.
- public string CreateEnumComment(string name, WordMap[] wordMaps)
+ public string CreateEnumComment(string name, WordMap[] wordMaps)
{
if (string.IsNullOrEmpty(name))
{
diff --git a/CodeDocumentor/Helper/DocumentationHeaderHelper.cs b/CodeDocumentor.Analyzers/Helper/DocumentationHeaderHelper.cs
similarity index 92%
rename from CodeDocumentor/Helper/DocumentationHeaderHelper.cs
rename to CodeDocumentor.Analyzers/Helper/DocumentationHeaderHelper.cs
index b2907a2..04c2338 100644
--- a/CodeDocumentor/Helper/DocumentationHeaderHelper.cs
+++ b/CodeDocumentor.Analyzers/Helper/DocumentationHeaderHelper.cs
@@ -2,14 +2,17 @@
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
+using CodeDocumentor.Analyzers.Locators;
using CodeDocumentor.Common;
+using CodeDocumentor.Common.Extensions;
+using CodeDocumentor.Common.Helpers;
+using CodeDocumentor.Common.Interfaces;
using CodeDocumentor.Common.Models;
-using CodeDocumentor.Locators;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-namespace CodeDocumentor.Helper
+namespace CodeDocumentor.Analyzers.Helper
{
///
/// The documentation header helper.
@@ -21,7 +24,7 @@ public class DocumentationHeaderHelper
private readonly Regex _regExInline = new Regex(@"(\w+Exception)\.Throw\w+", RegexOptions.IgnoreCase | RegexOptions.Multiline);
private readonly Regex _regExParseXmlElement = new Regex(@"<(.*?)\s(\w*)=""(.*?)""\s*/>", RegexOptions.IgnoreCase);
- private readonly Logger _eventLogger =ServiceLocator.Logger;
+ private readonly IEventLogger _eventLogger = ServiceLocator.Logger;
///
/// Has analyzer exclusion.
@@ -54,7 +57,7 @@ public bool HasAnalyzerExclusion(SyntaxNode node, bool recursive = true, List The parameter name.
/// The parameter content.
/// A XmlElementSyntax.
- internal XmlElementSyntax CreateParameterElementSyntax(string parameterName, string parameterContent)
+ public XmlElementSyntax CreateParameterElementSyntax(string parameterName, string parameterContent)
{
var paramName = SyntaxFactory.XmlName("param");
@@ -94,7 +97,7 @@ internal XmlElementSyntax CreateParameterElementSyntax(string parameterName, str
/// The content.
/// The XML node name.
/// A XmlNodeSyntax.
- internal XmlNodeSyntax CreateReturnElementSyntax(string content, string xmlNodeName = "returns")
+ public XmlNodeSyntax CreateReturnElementSyntax(string content, string xmlNodeName = "returns")
{
var xmlName = SyntaxFactory.XmlName(xmlNodeName);
/// [0]xxx[1]
@@ -159,7 +162,7 @@ internal XmlNodeSyntax CreateReturnElementSyntax(string content, string xmlNodeN
/// The specific type.
/// Flag determines if name should be pluralized
/// The comment.
- internal string DetermineSpecificObjectName(TypeSyntax specificType, WordMap[] wordMaps, bool pluaralizeName = false, bool pluaralizeIdentifierType = true)
+ public string DetermineSpecificObjectName(TypeSyntax specificType, WordMap[] wordMaps, bool pluaralizeName = false, bool pluaralizeIdentifierType = true)
{
string value;
switch (specificType)
@@ -187,7 +190,7 @@ internal string DetermineSpecificObjectName(TypeSyntax specificType, WordMap[] w
/// The return type.
/// If true, use proper casing.
/// A string.
- internal string DetermineStartingWord(ReadOnlySpan returnType, bool useProperCasing = true)
+ public string DetermineStartingWord(ReadOnlySpan returnType, bool useProperCasing = true)
{
if (returnType.IsEmpty)
{
@@ -203,14 +206,14 @@ internal string DetermineStartingWord(ReadOnlySpan returnType, bool usePro
return vowelChars.Contains(char.ToLower(returnType[0])) ? useProperCasing ? "An" : "an" : useProperCasing ? "A" : "a";
}
- internal IEnumerable GetExceptions(string textToSearch)
+ public IEnumerable GetExceptions(string textToSearch)
{
if (string.IsNullOrEmpty(textToSearch))
{
return Enumerable.Empty();
}
- List exceptions = new List();
+ var exceptions = new List();
TryHelper.Try(() =>
{
@@ -229,7 +232,7 @@ internal IEnumerable GetExceptions(string textToSearch)
return exceptions.Distinct();
}
- internal List ParseStringToXmlNodeSyntax(string cleanContent)
+ public List ParseStringToXmlNodeSyntax(string cleanContent)
{
var xmlNodes = new List();
TryHelper.Try(() =>
diff --git a/CodeDocumentor/Helper/ListExtensions.cs b/CodeDocumentor.Analyzers/Helper/ListExtensions.cs
similarity index 96%
rename from CodeDocumentor/Helper/ListExtensions.cs
rename to CodeDocumentor.Analyzers/Helper/ListExtensions.cs
index a47803d..2716d50 100644
--- a/CodeDocumentor/Helper/ListExtensions.cs
+++ b/CodeDocumentor.Analyzers/Helper/ListExtensions.cs
@@ -1,12 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using CodeDocumentor.Analyzers.Constructors;
using CodeDocumentor.Common;
using CodeDocumentor.Common.Models;
-using CodeDocumentor.Constructors;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-namespace CodeDocumentor.Helper
+namespace CodeDocumentor.Analyzers.Helper
{
public static class ListExtensions
{
diff --git a/CodeDocumentor/Helper/PrivateMemberVerifier.cs b/CodeDocumentor.Analyzers/Helper/PrivateMemberVerifier.cs
similarity index 99%
rename from CodeDocumentor/Helper/PrivateMemberVerifier.cs
rename to CodeDocumentor.Analyzers/Helper/PrivateMemberVerifier.cs
index 8883921..4941ac2 100644
--- a/CodeDocumentor/Helper/PrivateMemberVerifier.cs
+++ b/CodeDocumentor.Analyzers/Helper/PrivateMemberVerifier.cs
@@ -2,7 +2,7 @@
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-namespace CodeDocumentor.Helper
+namespace CodeDocumentor.Analyzers.Helper
{
///
/// Verifies whether a member is private.
diff --git a/CodeDocumentor/Helper/SyntaxExtensions.cs b/CodeDocumentor.Analyzers/Helper/SyntaxExtensions.cs
similarity index 94%
rename from CodeDocumentor/Helper/SyntaxExtensions.cs
rename to CodeDocumentor.Analyzers/Helper/SyntaxExtensions.cs
index 4d176f3..8e0a354 100644
--- a/CodeDocumentor/Helper/SyntaxExtensions.cs
+++ b/CodeDocumentor.Analyzers/Helper/SyntaxExtensions.cs
@@ -1,11 +1,12 @@
using System;
using System.Linq;
+using CodeDocumentor.Common.Extensions;
using CodeDocumentor.Common.Models;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-namespace CodeDocumentor.Helper
+namespace CodeDocumentor
{
public static class SyntaxExtensions
{
@@ -82,7 +83,7 @@ public static bool PropertyHasSetter(this PropertyDeclarationSyntax declarationS
{
if (declarationSyntax.AccessorList.Accessors.First(o => o.Kind() == SyntaxKind.SetAccessorDeclaration).ChildTokens().Any(o => o.IsKind(SyntaxKind.PrivateKeyword) || o.IsKind(SyntaxKind.InternalKeyword)))
{
- // private set or internal set should consider as no set.
+ // private set or public set should consider as no set.
hasSetter = false;
}
else
@@ -160,7 +161,7 @@ public static bool IsTask(this GenericNameSyntax nameSyntax)
///
/// The syntax.
/// A bool.
- internal static bool HasSummary(this CSharpSyntaxNode syntax)
+ public static bool HasSummary(this CSharpSyntaxNode syntax)
{
return syntax.HasLeadingTrivia && syntax.GetLeadingTrivia().Any(a => a.IsKind(SyntaxKind.MultiLineDocumentationCommentTrivia)
|| a.IsKind(SyntaxKind.SingleLineDocumentationCommentTrivia)
@@ -172,7 +173,7 @@ internal static bool HasSummary(this CSharpSyntaxNode syntax)
///
/// The declaration syntax.
/// A bool.
- internal static bool IsPrivate(this BaseMethodDeclarationSyntax declarationSyntax)
+ public static bool IsPrivate(this BaseMethodDeclarationSyntax declarationSyntax)
{
var isPrivate = false;
if (declarationSyntax.Modifiers.Any(SyntaxKind.PrivateKeyword))
@@ -188,7 +189,7 @@ internal static bool IsPrivate(this BaseMethodDeclarationSyntax declarationSynta
/// The syntax.
/// The name.
/// A XmlElementSyntax.
- internal static XmlElementSyntax GetElementSyntax(this CSharpSyntaxNode syntax, string name)
+ public static XmlElementSyntax GetElementSyntax(this CSharpSyntaxNode syntax, string name)
{
if (syntax.HasLeadingTrivia)
{
@@ -217,7 +218,7 @@ internal static XmlElementSyntax GetElementSyntax(this CSharpSyntaxNode syntax,
/// The leading trivia.
/// The comment trivia.
/// A SyntaxTriviaList.
- internal static SyntaxTriviaList UpsertLeadingTrivia(this SyntaxTriviaList leadingTrivia, DocumentationCommentTriviaSyntax commentTrivia)
+ public static SyntaxTriviaList UpsertLeadingTrivia(this SyntaxTriviaList leadingTrivia, DocumentationCommentTriviaSyntax commentTrivia)
{
if (leadingTrivia.All(a => a.IsKind(SyntaxKind.EndOfLineTrivia)))
{
diff --git a/CodeDocumentor/Helper/WordExtensions.cs b/CodeDocumentor.Analyzers/Helper/WordExtensions.cs
similarity index 88%
rename from CodeDocumentor/Helper/WordExtensions.cs
rename to CodeDocumentor.Analyzers/Helper/WordExtensions.cs
index 1c1d6a3..75b6969 100644
--- a/CodeDocumentor/Helper/WordExtensions.cs
+++ b/CodeDocumentor.Analyzers/Helper/WordExtensions.cs
@@ -1,6 +1,6 @@
using System;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-namespace CodeDocumentor.Helper
+namespace CodeDocumentor.Analyzers.Helper
{
public static class WordExtensions
{
diff --git a/CodeDocumentor.Analyzers/Locators/ServiceLocator.cs b/CodeDocumentor.Analyzers/Locators/ServiceLocator.cs
new file mode 100644
index 0000000..badca1f
--- /dev/null
+++ b/CodeDocumentor.Analyzers/Locators/ServiceLocator.cs
@@ -0,0 +1,20 @@
+using CodeDocumentor.Analyzers.Builders;
+using CodeDocumentor.Analyzers.Helper;
+using CodeDocumentor.Analyzers.Managers;
+using CodeDocumentor.Analyzers.Services;
+using CodeDocumentor.Common.Interfaces;
+using CodeDocumentor.Services;
+
+namespace CodeDocumentor.Analyzers.Locators
+{
+ public static class ServiceLocator
+ {
+ public static DocumentationHeaderHelper DocumentationHeaderHelper { get; } = new DocumentationHeaderHelper();
+ public static IEventLogger Logger { get; set; } = new PreLoadLogger(); //this is a temp until the real logger can be set at package load time
+ public static ISettingService SettingService { get; set; } = new PreLoadSettingService(); //this is a temp until the LoadAsync can finish with the real settings. but we need something due to order of events firing
+ public static CommentHelper CommentHelper { get; } = new CommentHelper();
+ public static GenericCommentManager GenericCommentManager { get; } = new GenericCommentManager();
+ public static DocumentationBuilder DocumentationBuilder => new DocumentationBuilder();
+
+ }
+}
diff --git a/CodeDocumentor/Managers/GenericCommentManager.cs b/CodeDocumentor.Analyzers/Managers/GenericCommentManager.cs
similarity index 98%
rename from CodeDocumentor/Managers/GenericCommentManager.cs
rename to CodeDocumentor.Analyzers/Managers/GenericCommentManager.cs
index 5c13f45..639645c 100644
--- a/CodeDocumentor/Managers/GenericCommentManager.cs
+++ b/CodeDocumentor.Analyzers/Managers/GenericCommentManager.cs
@@ -1,12 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;
+using CodeDocumentor.Analyzers.Helper;
+using CodeDocumentor.Analyzers.Locators;
+using CodeDocumentor.Common.Extensions;
using CodeDocumentor.Common.Models;
-using CodeDocumentor.Helper;
-using CodeDocumentor.Locators;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-namespace CodeDocumentor.Managers
+namespace CodeDocumentor.Analyzers.Managers
{
public class GenericCommentManager
{
diff --git a/CodeDocumentor.Analyzers/Services/PreLoadLogger.cs b/CodeDocumentor.Analyzers/Services/PreLoadLogger.cs
new file mode 100644
index 0000000..9c478e1
--- /dev/null
+++ b/CodeDocumentor.Analyzers/Services/PreLoadLogger.cs
@@ -0,0 +1,22 @@
+
+using CodeDocumentor.Common.Interfaces;
+
+namespace CodeDocumentor.Analyzers.Services
+{
+ internal class PreLoadLogger : IEventLogger
+ {
+ public void LogDebug(string category, string message)
+ {
+ }
+
+ public void LogError(string message, int eventId, short category, string diagnosticId)
+ {
+
+ }
+
+ public void LogInfo(string message, int eventId, short category, string diagnosticId)
+ {
+
+ }
+ }
+}
diff --git a/CodeDocumentor.Analyzers/Services/PreLoadSettingService.cs b/CodeDocumentor.Analyzers/Services/PreLoadSettingService.cs
new file mode 100644
index 0000000..304b485
--- /dev/null
+++ b/CodeDocumentor.Analyzers/Services/PreLoadSettingService.cs
@@ -0,0 +1,21 @@
+using CodeDocumentor.Common.Interfaces;
+using CodeDocumentor.Common.Models;
+using Microsoft.CodeAnalysis.Diagnostics;
+
+namespace CodeDocumentor.Services
+{
+ public class PreLoadSettingService : ISettingService
+ {
+ public ISettings StaticSettings { get; set; }
+
+ public ISettings BuildSettings(AnalyzerConfigOptions options)
+ {
+ return Settings.BuildDefaults();
+ }
+
+ public ISettings BuildSettings(SyntaxNodeAnalysisContext context)
+ {
+ return Settings.BuildDefaults();
+ }
+ }
+}
diff --git a/CodeDocumentor.Common/CodeDocumentor.Common.csproj b/CodeDocumentor.Common/CodeDocumentor.Common.csproj
index d670910..53d3bec 100644
--- a/CodeDocumentor.Common/CodeDocumentor.Common.csproj
+++ b/CodeDocumentor.Common/CodeDocumentor.Common.csproj
@@ -5,7 +5,7 @@
-
+
diff --git a/CodeDocumentor.Common/Extensions/ListExtensions.cs b/CodeDocumentor.Common/Extensions/ListExtensions.cs
index a000df4..211a392 100644
--- a/CodeDocumentor.Common/Extensions/ListExtensions.cs
+++ b/CodeDocumentor.Common/Extensions/ListExtensions.cs
@@ -2,11 +2,11 @@
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
-using CodeDocumentor.Common;
+using CodeDocumentor.Common.Helpers;
using CodeDocumentor.Common.Models;
using Microsoft.CodeAnalysis;
-namespace CodeDocumentor.Helper
+namespace CodeDocumentor.Common.Extensions
{
public static class ListExtensions
{
@@ -167,7 +167,7 @@ public static List TryAddTodoSummary(this List parts, string ret
{
if (useToDoCommentsOnSummaryError)
{
- parts = new List { Constants.TODO};
+ parts = new List { Constants.TODO };
}
else
{
@@ -177,7 +177,8 @@ public static List TryAddTodoSummary(this List parts, string ret
return parts;
}
- private static bool IsReturnVoidAndOnePart(List parts, string returnType) {
+ private static bool IsReturnVoidAndOnePart(List parts, string returnType)
+ {
return returnType == "void" && (parts.Count == 1 || (parts.Count == 2 && parts.Last() == "asynchronously"));
}
diff --git a/CodeDocumentor.Common/Extensions/Translator.cs b/CodeDocumentor.Common/Extensions/Translator.cs
index fa4dbff..2faffd3 100644
--- a/CodeDocumentor.Common/Extensions/Translator.cs
+++ b/CodeDocumentor.Common/Extensions/Translator.cs
@@ -1,8 +1,8 @@
using System.Text.RegularExpressions;
-using CodeDocumentor.Common;
+using CodeDocumentor.Common.Helpers;
using CodeDocumentor.Common.Models;
-namespace CodeDocumentor.Helper
+namespace CodeDocumentor.Common.Extensions
{
public static class Translator
{
@@ -28,7 +28,7 @@ public static string ApplyUserTranslations(this string text, WordMap[] wordMaps)
private static string TranslateText(string text, WordMap[] wordMaps)
{
var converted = text;
- if (wordMaps == null || wordMaps.Length == 0)
+ if (wordMaps == null || wordMaps.Length == 0)
{
return converted;
}
diff --git a/CodeDocumentor.Common/Helpers/NameSplitter.cs b/CodeDocumentor.Common/Helpers/NameSplitter.cs
index 23117b0..fe88378 100644
--- a/CodeDocumentor.Common/Helpers/NameSplitter.cs
+++ b/CodeDocumentor.Common/Helpers/NameSplitter.cs
@@ -3,7 +3,7 @@
using System.Linq;
using System.Text.RegularExpressions;
-namespace CodeDocumentor.Common
+namespace CodeDocumentor.Common.Helpers
{
///
/// The name splitter.
diff --git a/CodeDocumentor.Common/Helpers/TokenHelper.cs b/CodeDocumentor.Common/Helpers/TokenHelper.cs
index d4c4a1d..ce9c5f1 100644
--- a/CodeDocumentor.Common/Helpers/TokenHelper.cs
+++ b/CodeDocumentor.Common/Helpers/TokenHelper.cs
@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Text.RegularExpressions;
-namespace CodeDocumentor.Common
+namespace CodeDocumentor.Common.Helpers
{
//This takes XML nodes in a string and swaps them to tokens for string manipulation, and then replaces them once complete. This keeps the validity of the XML
public static class TokenHelper
diff --git a/CodeDocumentor.Common/Helpers/TryHelper.cs b/CodeDocumentor.Common/Helpers/TryHelper.cs
index 5a508ae..723c18b 100644
--- a/CodeDocumentor.Common/Helpers/TryHelper.cs
+++ b/CodeDocumentor.Common/Helpers/TryHelper.cs
@@ -1,7 +1,7 @@
using System;
using CodeDocumentor.Common.Interfaces;
-namespace CodeDocumentor.Common
+namespace CodeDocumentor.Common.Helpers
{
public static class TryHelper
{
diff --git a/CodeDocumentor.Common/Interfaces/IEventLogger.cs b/CodeDocumentor.Common/Interfaces/IEventLogger.cs
index a8c4fcf..b50215e 100644
--- a/CodeDocumentor.Common/Interfaces/IEventLogger.cs
+++ b/CodeDocumentor.Common/Interfaces/IEventLogger.cs
@@ -5,6 +5,7 @@ namespace CodeDocumentor.Common.Interfaces
{
public interface IEventLogger
{
+ void LogDebug(string category, string message);
void LogError(string message, int eventId, short category, string diagnosticId);
void LogInfo(string message, int eventId, short category, string diagnosticId);
}
diff --git a/CodeDocumentor.Common/Interfaces/ISettingService.cs b/CodeDocumentor.Common/Interfaces/ISettingService.cs
new file mode 100644
index 0000000..cc72c76
--- /dev/null
+++ b/CodeDocumentor.Common/Interfaces/ISettingService.cs
@@ -0,0 +1,12 @@
+using Microsoft.CodeAnalysis.Diagnostics;
+
+namespace CodeDocumentor.Common.Interfaces
+{
+ public interface ISettingService
+ {
+ ISettings StaticSettings { get; set; }
+
+ ISettings BuildSettings(AnalyzerConfigOptions options);
+ ISettings BuildSettings(SyntaxNodeAnalysisContext context);
+ }
+}
diff --git a/CodeDocumentor.Common/Models/Settings.cs b/CodeDocumentor.Common/Models/Settings.cs
index a1708bd..709f7c4 100644
--- a/CodeDocumentor.Common/Models/Settings.cs
+++ b/CodeDocumentor.Common/Models/Settings.cs
@@ -88,9 +88,34 @@ public class Settings : ISettings
///
public bool UseEditorConfigForSettings { get; set; }
+ public static ISettings BuildDefaults()
+ {
+ return new Settings
+ {
+ ClassDiagnosticSeverity = DiagnosticSeverity.Warning,
+ ConstructorDiagnosticSeverity = DiagnosticSeverity.Warning,
+ DefaultDiagnosticSeverity = DiagnosticSeverity.Warning,
+ EnumDiagnosticSeverity = DiagnosticSeverity.Warning,
+ ExcludeAsyncSuffix = false,
+ FieldDiagnosticSeverity = DiagnosticSeverity.Warning,
+ IncludeValueNodeInProperties = false,
+ InterfaceDiagnosticSeverity = DiagnosticSeverity.Warning,
+ IsEnabledForNonPublicFields = false,
+ IsEnabledForPublicMembersOnly = false,
+ MethodDiagnosticSeverity = DiagnosticSeverity.Warning,
+ PreserveExistingSummaryText = true,
+ PropertyDiagnosticSeverity = DiagnosticSeverity.Warning,
+ RecordDiagnosticSeverity = DiagnosticSeverity.Warning,
+ TryToIncludeCrefsForReturnTypes = true,
+ UseNaturalLanguageForReturnNode = false,
+ UseToDoCommentsOnSummaryError = true,
+ WordMaps = Constants.DEFAULT_WORD_MAPS
+ };
+ }
+
public ISettings Clone()
{
- var newService = new Settings
+ var newSettings = new Settings
{
ClassDiagnosticSeverity = ClassDiagnosticSeverity,
ConstructorDiagnosticSeverity = ConstructorDiagnosticSeverity,
@@ -120,8 +145,8 @@ public ISettings Clone()
WordEvaluator = item.WordEvaluator
});
}
- newService.WordMaps = clonedMaps.ToArray();
- return newService;
+ newSettings.WordMaps = clonedMaps.ToArray();
+ return newSettings;
}
}
}
diff --git a/CodeDocumentor.Test/Builders/DocumentationBuilderTests.cs b/CodeDocumentor.Test/Builders/DocumentationBuilderTests.cs
index c576801..1254d19 100644
--- a/CodeDocumentor.Test/Builders/DocumentationBuilderTests.cs
+++ b/CodeDocumentor.Test/Builders/DocumentationBuilderTests.cs
@@ -1,8 +1,6 @@
using System.Diagnostics.CodeAnalysis;
-using CodeDocumentor.Builders;
-using CodeDocumentor.Common.Interfaces;
+using CodeDocumentor.Analyzers.Builders;
using FluentAssertions;
-using Moq;
using Xunit;
using Xunit.Abstractions;
diff --git a/CodeDocumentor.Test/Classes/ClassUnitTests.cs b/CodeDocumentor.Test/Classes/ClassUnitTests.cs
index 3891a12..27e2f58 100644
--- a/CodeDocumentor.Test/Classes/ClassUnitTests.cs
+++ b/CodeDocumentor.Test/Classes/ClassUnitTests.cs
@@ -1,4 +1,6 @@
using System.Threading.Tasks;
+using CodeDocumentor.Analyzers;
+using CodeDocumentor.Analyzers.Classes;
using CodeDocumentor.Test.TestHelpers;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeFixes;
@@ -81,7 +83,8 @@ public async Task SkipsClassDiagnosticAndFixWhenPublicOnlyTrue()
{
var fix = _fixture.LoadTestFile("./Classes/TestFiles/ClassTester.cs");
var test = _fixture.LoadTestFile("./Classes/TestFiles/ClassTester.cs");
- var clone = new TestSettings {
+ var clone = new TestSettings
+ {
IsEnabledForPublicMembersOnly = true
};
_fixture.MockSettings.SetClone(clone);
diff --git a/CodeDocumentor.Test/CodeDocumentor.Test.csproj b/CodeDocumentor.Test/CodeDocumentor.Test.csproj
index 2e133a4..81bf4b0 100644
--- a/CodeDocumentor.Test/CodeDocumentor.Test.csproj
+++ b/CodeDocumentor.Test/CodeDocumentor.Test.csproj
@@ -487,22 +487,24 @@
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
-
+
compile; build; native; contentfiles; analyzers; buildtransitive
-
+
+
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
@@ -513,6 +515,7 @@
+
diff --git a/CodeDocumentor.Test/Constructors/ConstructorUnitTests.cs b/CodeDocumentor.Test/Constructors/ConstructorUnitTests.cs
index 44452a2..00126b7 100644
--- a/CodeDocumentor.Test/Constructors/ConstructorUnitTests.cs
+++ b/CodeDocumentor.Test/Constructors/ConstructorUnitTests.cs
@@ -1,5 +1,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
+using CodeDocumentor.Analyzers;
+using CodeDocumentor.Analyzers.Constructors;
using CodeDocumentor.Test.TestHelpers;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeFixes;
diff --git a/CodeDocumentor.Test/Enums/EnumUnitTests.cs b/CodeDocumentor.Test/Enums/EnumUnitTests.cs
index 7d4004d..4909172 100644
--- a/CodeDocumentor.Test/Enums/EnumUnitTests.cs
+++ b/CodeDocumentor.Test/Enums/EnumUnitTests.cs
@@ -1,4 +1,6 @@
using System.Threading.Tasks;
+using CodeDocumentor.Analyzers;
+using CodeDocumentor.Analyzers.Enums;
using CodeDocumentor.Test.TestHelpers;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeFixes;
diff --git a/CodeDocumentor.Test/Fields/FieldUnitTests.cs b/CodeDocumentor.Test/Fields/FieldUnitTests.cs
index fb2bfa0..3f82226 100644
--- a/CodeDocumentor.Test/Fields/FieldUnitTests.cs
+++ b/CodeDocumentor.Test/Fields/FieldUnitTests.cs
@@ -1,4 +1,6 @@
-using System.Threading.Tasks;
+using System.Threading.Tasks;
+using CodeDocumentor.Analyzers;
+using CodeDocumentor.Analyzers.Fields;
using CodeDocumentor.Test.TestHelpers;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeFixes;
diff --git a/CodeDocumentor.Test/Helper/CommentHelperTests.cs b/CodeDocumentor.Test/Helper/CommentHelperTests.cs
index b2e4e8a..0a9d72d 100644
--- a/CodeDocumentor.Test/Helper/CommentHelperTests.cs
+++ b/CodeDocumentor.Test/Helper/CommentHelperTests.cs
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
-using CodeDocumentor.Helper;
+using CodeDocumentor.Analyzers.Helper;
+using CodeDocumentor.Common.Extensions;
using CodeDocumentor.Test.TestHelpers;
using FluentAssertions;
using Microsoft.CodeAnalysis;
@@ -93,7 +94,7 @@ public void CreateMethodComment_ReturnsValidName(string name, string returnType,
[Fact]
public void CreateMethodComment_ReturnsValidCommentWhenOneWordMethodAndLayeredList()
{
- TypeSyntax typeSyntax = SyntaxFactory.ParseTypeName("Task>>");
+ var typeSyntax = SyntaxFactory.ParseTypeName("Task>>");
_fixture.MockSettings.ExcludeAsyncSuffix = false;
_fixture.MockSettings.UseToDoCommentsOnSummaryError = false;
@@ -109,14 +110,15 @@ public void CreateMethodComment_ReturnsValidCommentWhenOneWordMethodAndLayeredLi
[Fact]
public void CreateMethodComment_ReturnsValidCommentWhenReturnIsTask_ActionResult_CustomType()
{
- var clone = new TestSettings {
+ var clone = new TestSettings
+ {
ExcludeAsyncSuffix = false,
UseToDoCommentsOnSummaryError = false,
TryToIncludeCrefsForReturnTypes = false
};
_fixture.MockSettings.SetClone(clone);
- TypeSyntax typeSyntax = SyntaxFactory.ParseTypeName("Task>");
+ var typeSyntax = SyntaxFactory.ParseTypeName("Task>");
var commentHelper = new CommentHelper();
var comment = commentHelper.CreateMethodComment("CreateAsync", typeSyntax,
_fixture.MockSettings.UseToDoCommentsOnSummaryError,
diff --git a/CodeDocumentor.Test/Helper/DocumentationHeaderHelperTests.cs b/CodeDocumentor.Test/Helper/DocumentationHeaderHelperTests.cs
index 67b0aa6..ecc5ff5 100644
--- a/CodeDocumentor.Test/Helper/DocumentationHeaderHelperTests.cs
+++ b/CodeDocumentor.Test/Helper/DocumentationHeaderHelperTests.cs
@@ -1,6 +1,6 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
-using CodeDocumentor.Helper;
+using CodeDocumentor.Analyzers.Helper;
using FluentAssertions;
using Xunit;
using Xunit.Abstractions;
diff --git a/CodeDocumentor.Test/Helper/NameSplitterTests.cs b/CodeDocumentor.Test/Helper/NameSplitterTests.cs
index 5965a75..0373156 100644
--- a/CodeDocumentor.Test/Helper/NameSplitterTests.cs
+++ b/CodeDocumentor.Test/Helper/NameSplitterTests.cs
@@ -1,6 +1,6 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
-using CodeDocumentor.Common;
+using CodeDocumentor.Common.Helpers;
using FluentAssertions;
using Xunit;
diff --git a/CodeDocumentor.Test/Helper/ReturnCommentConstructionTests.cs b/CodeDocumentor.Test/Helper/ReturnCommentConstructionTests.cs
index 7b25535..6d9f3ef 100644
--- a/CodeDocumentor.Test/Helper/ReturnCommentConstructionTests.cs
+++ b/CodeDocumentor.Test/Helper/ReturnCommentConstructionTests.cs
@@ -1,6 +1,6 @@
using System.Diagnostics.CodeAnalysis;
+using CodeDocumentor.Analyzers.Constructors;
using CodeDocumentor.Common.Models;
-using CodeDocumentor.Constructors;
using FluentAssertions;
using Microsoft.CodeAnalysis.CSharp;
using Xunit;
diff --git a/CodeDocumentor.Test/Helper/TranslatorTests.cs b/CodeDocumentor.Test/Helper/TranslatorTests.cs
index d629766..4ca8b33 100644
--- a/CodeDocumentor.Test/Helper/TranslatorTests.cs
+++ b/CodeDocumentor.Test/Helper/TranslatorTests.cs
@@ -1,8 +1,8 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using CodeDocumentor.Common;
+using CodeDocumentor.Common.Extensions;
using CodeDocumentor.Common.Models;
-using CodeDocumentor.Helper;
using FluentAssertions;
using Xunit;
using Xunit.Abstractions;
diff --git a/CodeDocumentor.Test/Interfaces/InterfaceUnitTests.cs b/CodeDocumentor.Test/Interfaces/InterfaceUnitTests.cs
index 4b9ccd7..0f9dfaa 100644
--- a/CodeDocumentor.Test/Interfaces/InterfaceUnitTests.cs
+++ b/CodeDocumentor.Test/Interfaces/InterfaceUnitTests.cs
@@ -1,4 +1,6 @@
-using System.Threading.Tasks;
+using System.Threading.Tasks;
+using CodeDocumentor.Analyzers;
+using CodeDocumentor.Analyzers.Interfaces;
using CodeDocumentor.Test.TestHelpers;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeFixes;
diff --git a/CodeDocumentor.Test/Methods/MethodUnitTests.cs b/CodeDocumentor.Test/Methods/MethodUnitTests.cs
index 1bd2d3a..80571b3 100644
--- a/CodeDocumentor.Test/Methods/MethodUnitTests.cs
+++ b/CodeDocumentor.Test/Methods/MethodUnitTests.cs
@@ -1,5 +1,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
+using CodeDocumentor.Analyzers;
+using CodeDocumentor.Analyzers.Methods;
using CodeDocumentor.Test.TestHelpers;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeFixes;
@@ -68,9 +70,10 @@ public async Task ShowMethodDiagnosticAndFix(string testCode, string fixCode, in
{
var fix = _fixture.LoadTestFile($"./Methods/TestFiles/{fixCode}.cs");
var test = _fixture.LoadTestFile($"./Methods/TestFiles/{testCode}.cs");
- _fixture.MockSettings.SetClone(new TestSettings {
- UseNaturalLanguageForReturnNode = false,
- TryToIncludeCrefsForReturnTypes = false
+ _fixture.MockSettings.SetClone(new TestSettings
+ {
+ UseNaturalLanguageForReturnNode = false,
+ TryToIncludeCrefsForReturnTypes = false
});
var expected = new DiagnosticResult
{
diff --git a/CodeDocumentor.Test/Properties/PropertyUnitTests.cs b/CodeDocumentor.Test/Properties/PropertyUnitTests.cs
index 55d0d3b..065b99a 100644
--- a/CodeDocumentor.Test/Properties/PropertyUnitTests.cs
+++ b/CodeDocumentor.Test/Properties/PropertyUnitTests.cs
@@ -1,6 +1,8 @@
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
+using CodeDocumentor.Analyzers;
+using CodeDocumentor.Analyzers.Properties;
using CodeDocumentor.Test.TestHelpers;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeFixes;
diff --git a/CodeDocumentor.Test/Records/RecordUnitTests.cs b/CodeDocumentor.Test/Records/RecordUnitTests.cs
index dc3f9f2..be94719 100644
--- a/CodeDocumentor.Test/Records/RecordUnitTests.cs
+++ b/CodeDocumentor.Test/Records/RecordUnitTests.cs
@@ -1,4 +1,6 @@
using System.Threading.Tasks;
+using CodeDocumentor.Analyzers;
+using CodeDocumentor.Analyzers.Records;
using CodeDocumentor.Test.TestHelpers;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeFixes;
@@ -93,7 +95,8 @@ public async Task SkipsRecordDiagnosticAndFixWhenPublicOnlyTrue()
{
var fix = _fixture.LoadTestFile("./Records/TestFiles/RecordTester.cs");
var test = _fixture.LoadTestFile("./Records/TestFiles/RecordTester.cs");
- var clone = new TestSettings {
+ var clone = new TestSettings
+ {
IsEnabledForPublicMembersOnly = true
};
_fixture.MockSettings.SetClone(clone);
diff --git a/CodeDocumentor.Test/TestFixture.cs b/CodeDocumentor.Test/TestFixture.cs
index ef038ac..6b7ee18 100644
--- a/CodeDocumentor.Test/TestFixture.cs
+++ b/CodeDocumentor.Test/TestFixture.cs
@@ -5,9 +5,10 @@
using System.IO;
using System.Linq;
using System.Reflection;
-using CodeDocumentor.Analyzers;
+using CodeDocumentor.Analyzers.Locators;
using CodeDocumentor.Common.Interfaces;
using CodeDocumentor.Common.Models;
+using CodeDocumentor.Services;
using CodeDocumentor.Test.TestHelpers;
using FluentAssertions;
using Microsoft.CodeAnalysis;
@@ -60,8 +61,9 @@ public void Initialize(ITestOutputHelper output)
CurrentTestName = output.GetTestName();
MockSettings = new TestSettings();
- BaseCodeFixProvider.SetSettings(MockSettings);
- BaseDiagnosticAnalyzer.SetSettings(MockSettings);
+ ServiceLocator.SettingService = new SettingService();
+ ServiceLocator.SettingService.StaticSettings = MockSettings;
+ ServiceLocator.Logger = new Logger();
}
public void SetPublicProcessingOption(ISettings o, string diagType)
diff --git a/CodeDocumentor.sln b/CodeDocumentor.sln
index 3460881..9eb723f 100644
--- a/CodeDocumentor.sln
+++ b/CodeDocumentor.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 17
-VisualStudioVersion = 17.0.31912.275
+# Visual Studio Version 18
+VisualStudioVersion = 18.0.11109.219 d18.0-oob
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionItems", "{FC202D1D-DC77-4AD6-BFA7-AFD04EFCAB03}"
ProjectSection(SolutionItems) = preProject
@@ -43,6 +43,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeDocumentor.Common", "CodeDocumentor.Common\CodeDocumentor.Common.csproj", "{7CC64CDF-A7FF-463B-8F05-C37A6C0A820C}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeDocumentor.Analyzers", "CodeDocumentor.Analyzers\CodeDocumentor.Analyzers.csproj", "{738D16AF-93E6-4F9C-9F6A-9283A3E62243}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -89,6 +91,18 @@ Global
{7CC64CDF-A7FF-463B-8F05-C37A6C0A820C}.Release|x64.Build.0 = Release|Any CPU
{7CC64CDF-A7FF-463B-8F05-C37A6C0A820C}.Release|x86.ActiveCfg = Release|Any CPU
{7CC64CDF-A7FF-463B-8F05-C37A6C0A820C}.Release|x86.Build.0 = Release|Any CPU
+ {738D16AF-93E6-4F9C-9F6A-9283A3E62243}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {738D16AF-93E6-4F9C-9F6A-9283A3E62243}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {738D16AF-93E6-4F9C-9F6A-9283A3E62243}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {738D16AF-93E6-4F9C-9F6A-9283A3E62243}.Debug|x64.Build.0 = Debug|Any CPU
+ {738D16AF-93E6-4F9C-9F6A-9283A3E62243}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {738D16AF-93E6-4F9C-9F6A-9283A3E62243}.Debug|x86.Build.0 = Debug|Any CPU
+ {738D16AF-93E6-4F9C-9F6A-9283A3E62243}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {738D16AF-93E6-4F9C-9F6A-9283A3E62243}.Release|Any CPU.Build.0 = Release|Any CPU
+ {738D16AF-93E6-4F9C-9F6A-9283A3E62243}.Release|x64.ActiveCfg = Release|Any CPU
+ {738D16AF-93E6-4F9C-9F6A-9283A3E62243}.Release|x64.Build.0 = Release|Any CPU
+ {738D16AF-93E6-4F9C-9F6A-9283A3E62243}.Release|x86.ActiveCfg = Release|Any CPU
+ {738D16AF-93E6-4F9C-9F6A-9283A3E62243}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/CodeDocumentor/Analyzers/BaseDiagnosticAnalyzer.cs b/CodeDocumentor/Analyzers/BaseDiagnosticAnalyzer.cs
deleted file mode 100644
index df7df27..0000000
--- a/CodeDocumentor/Analyzers/BaseDiagnosticAnalyzer.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using CodeDocumentor.Common.Interfaces;
-using CodeDocumentor.Helper;
-using CodeDocumentor.Locators;
-using Microsoft.CodeAnalysis.Diagnostics;
-
-namespace CodeDocumentor
-{
- public abstract class BaseDiagnosticAnalyzer : DiagnosticAnalyzer
- {
- protected DocumentationHeaderHelper DocumentationHeaderHelper = ServiceLocator.DocumentationHeaderHelper;
-
- private static ISettings _settings;
-
- public static void SetSettings(ISettings settings)
- {
- _settings = settings;
- }
-
- protected static ISettings StaticSettings =>
- //we serve up a fresh new instance from the static, and use that instead, keeps everything testable and decoupled from the static
- _settings?.Clone();
- }
-}
diff --git a/CodeDocumentor/CodeDocumentor.Package.cs b/CodeDocumentor/CodeDocumentor.Package.cs
index 8203255..2d4e960 100644
--- a/CodeDocumentor/CodeDocumentor.Package.cs
+++ b/CodeDocumentor/CodeDocumentor.Package.cs
@@ -1,10 +1,11 @@
using System;
-using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading;
+using CodeDocumentor.Analyzers.Locators;
using CodeDocumentor.Common;
using CodeDocumentor.Common.Models;
+using CodeDocumentor.Services;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.Threading;
@@ -41,7 +42,7 @@ namespace CodeDocumentor.Vsix2022
[ProvideOptionPage(typeof(OptionPageGrid), OptionPageGrid.Category, OptionPageGrid.SubCategory, 1000, 1001, true)]
//[ProvideAutoLoad(UIContextGuids80.NoSolution, PackageAutoLoadFlags.BackgroundLoad)]
[ProvideAutoLoad(UIContextGuids80.SolutionExists, PackageAutoLoadFlags.BackgroundLoad)]
- [ComVisible(true)]
+ //[ComVisible(true)]
public sealed class CodeDocumentorPackage : AsyncPackage
{
#region Package Members
@@ -63,6 +64,15 @@ protected override async Task InitializeAsync(CancellationToken cancellationToke
// When initialized asynchronously, the current thread may be a background thread at this point. Do any
// initialization that requires the UI thread after switching to the UI thread.
await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);
+ Load();
+
+ }
+
+ private void Load()
+ {
+ //this needs to be set here due to bootstrapping environment and where EventLog is available
+ ServiceLocator.Logger = new Logger();
+ ServiceLocator.SettingService = new SettingService();
//var hasCodeDocumentorInEditorConfig = await SlnHasEditorConfigAsync(hasCodeDocumentorInEditorConfig);
@@ -71,35 +81,33 @@ protected override async Task InitializeAsync(CancellationToken cancellationToke
var options = (OptionPageGrid)GetDialogPage(typeof(OptionPageGrid));
var settings = new Settings();
settings.SetFromOptionsGrid(options);
- BaseCodeFixProvider.SetSettings(settings);
- BaseDiagnosticAnalyzer.SetSettings(settings);
-
+ ServiceLocator.SettingService.StaticSettings = settings;
}
- private async System.Threading.Tasks.Task SlnHasEditorConfigAsync(bool hasCodeDocumentorInEditorConfig)
- {
- var solutionService = await GetServiceAsync(typeof(SVsSolution)) as IVsSolution;
- if (solutionService != null)
- {
- solutionService.GetSolutionInfo(out string solutionDir, out _, out _);
+ //private async System.Threading.Tasks.Task SlnHasEditorConfigAsync(bool hasCodeDocumentorInEditorConfig)
+ //{
+ // var solutionService = await GetServiceAsync(typeof(SVsSolution)) as IVsSolution;
+ // if (solutionService != null)
+ // {
+ // solutionService.GetSolutionInfo(out string solutionDir, out _, out _);
- if (!string.IsNullOrEmpty(solutionDir))
- {
- // Look for .editorconfig in the solution directory
- var editorConfigPath = System.IO.Path.Combine(solutionDir, ".editorconfig");
- if (System.IO.File.Exists(editorConfigPath))
- {
- // Read the .editorconfig file
- var lines = System.IO.File.ReadAllLines(editorConfigPath);
- // Check for a specific value, e.g., "my_setting = true"
- hasCodeDocumentorInEditorConfig = lines.Any(line => line.Trim().StartsWith("codedocumentor_", StringComparison.OrdinalIgnoreCase));
+ // if (!string.IsNullOrEmpty(solutionDir))
+ // {
+ // // Look for .editorconfig in the solution directory
+ // var editorConfigPath = System.IO.Path.Combine(solutionDir, ".editorconfig");
+ // if (System.IO.File.Exists(editorConfigPath))
+ // {
+ // // Read the .editorconfig file
+ // var lines = System.IO.File.ReadAllLines(editorConfigPath);
+ // // Check for a specific value, e.g., "my_setting = true"
+ // hasCodeDocumentorInEditorConfig = lines.Any(line => line.Trim().StartsWith("codedocumentor_", StringComparison.OrdinalIgnoreCase));
- }
- }
- }
+ // }
+ // }
+ // }
- return hasCodeDocumentorInEditorConfig;
- }
+ // return hasCodeDocumentorInEditorConfig;
+ //}
#endregion
}
diff --git a/CodeDocumentor/CodeDocumentor.csproj b/CodeDocumentor/CodeDocumentor.csproj
index 5da1759..7df8525 100644
--- a/CodeDocumentor/CodeDocumentor.csproj
+++ b/CodeDocumentor/CodeDocumentor.csproj
@@ -53,63 +53,25 @@
4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
Component
-
-
-
-
-
-
-
+
@@ -117,22 +79,18 @@
-
- 4.13.0
-
-
+
compile; build; native; contentfiles; analyzers; buildtransitive
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
- 8.0.0
+ 9.0.9
-
-
-
+
+
@@ -151,13 +109,17 @@
true
-
+
+ {738d16af-93e6-4f9c-9f6a-9283a3e62243}
+ CodeDocumentor.Analyzers
+
{7cc64cdf-a7ff-463b-8f05-c37a6c0a820c}
CodeDocumentor.Common
+
diff --git a/TestProject/Sample/Sample.sln b/TestProject/Sample/Sample.sln
index c63d806..7d55086 100644
--- a/TestProject/Sample/Sample.sln
+++ b/TestProject/Sample/Sample.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
-VisualStudioVersion = 17.0.31912.275
+VisualStudioVersion = 17.14.36623.8 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample", "Sample\Sample.csproj", "{A3BBEBB1-7614-4446-A87D-8E9F0A3CAAE6}"
EndProject
diff --git a/TestProject/Sample/Sample/CodeDocumentor/ClassConstructors.cs b/TestProject/Sample/Sample/CodeDocumentor/ClassConstructors.cs
index a6c214b..288b7fe 100644
--- a/TestProject/Sample/Sample/CodeDocumentor/ClassConstructors.cs
+++ b/TestProject/Sample/Sample/CodeDocumentor/ClassConstructors.cs
@@ -1,12 +1,7 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
namespace Sample.CodeDocumentor
{
- public class ClassConstructors(string test, int testInt)
- {
- }
+ public class ClassConstructors(string test, int testInt)
+ {
+ }
}
diff --git a/TestProject/Sample/Sample/CodeDocumentor/FieldOCRTestSingleClass.cs b/TestProject/Sample/Sample/CodeDocumentor/FieldOCRTestSingleClass.cs
index ba8f38e..9137cca 100644
--- a/TestProject/Sample/Sample/CodeDocumentor/FieldOCRTestSingleClass.cs
+++ b/TestProject/Sample/Sample/CodeDocumentor/FieldOCRTestSingleClass.cs
@@ -1,8 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace Sample.CodeDocumentor
{
diff --git a/TestProject/Sample/Sample/CodeDocumentor/ITestPublicInteraceMethods.cs b/TestProject/Sample/Sample/CodeDocumentor/ITestPublicInteraceMethods.cs
deleted file mode 100644
index 2f28e00..0000000
--- a/TestProject/Sample/Sample/CodeDocumentor/ITestPublicInteraceMethods.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using System.Threading.Tasks;
-
-namespace Sample.CodeDocumentor
-{
-
- public interface ITestPublicInteraceMethods
- {
- Task GetNamesAsync(string name);
- }
-}
diff --git a/TestProject/Sample/Sample/CodeDocumentor/ITestPublicInterfaceMethods.cs b/TestProject/Sample/Sample/CodeDocumentor/ITestPublicInterfaceMethods.cs
new file mode 100644
index 0000000..74b74b2
--- /dev/null
+++ b/TestProject/Sample/Sample/CodeDocumentor/ITestPublicInterfaceMethods.cs
@@ -0,0 +1,11 @@
+using System.Threading.Tasks;
+
+namespace Sample.CodeDocumentor
+{
+
+ public interface ITestPublicInterfaceMethods
+ {
+
+ Task GetNamesAsync(string name, string age);
+ }
+}
diff --git a/TestProject/Sample/Sample/CodeDocumentor/TestCommentFile.cs b/TestProject/Sample/Sample/CodeDocumentor/TestCommentFile.cs
index da1604b..aaa1d9a 100644
--- a/TestProject/Sample/Sample/CodeDocumentor/TestCommentFile.cs
+++ b/TestProject/Sample/Sample/CodeDocumentor/TestCommentFile.cs
@@ -106,7 +106,7 @@ public string ToUpperCase()
public void Publish()
{
-
+
}
public string PublishAsync()
{
diff --git a/TestProject/Sample/Sample/ProtoAttributor/ProtoTesterBracketNamespace.cs b/TestProject/Sample/Sample/ProtoAttributor/ProtoTesterBracketNamespace.cs
index b9aef18..4815335 100644
--- a/TestProject/Sample/Sample/ProtoAttributor/ProtoTesterBracketNamespace.cs
+++ b/TestProject/Sample/Sample/ProtoAttributor/ProtoTesterBracketNamespace.cs
@@ -1,23 +1,23 @@
-using ProtoBuf;
+using ProtoBuf;
namespace Sample.Other
{
- [ProtoContract]
- public class ProtoTesterBracketNamespace
+ [ProtoContract]
+ public class ProtoTesterBracketNamespace
+ {
+ public ProtoTesterBracketNamespace()
{
- public ProtoTesterBracketNamespace()
- {
- }
- static ProtoTesterBracketNamespace()
- {
+ }
+ static ProtoTesterBracketNamespace()
+ {
- }
+ }
- [ProtoMember(1)]
- public int MyProperty { get; set; }
+ [ProtoMember(1)]
+ public int MyProperty { get; set; }
- [ProtoMember(2)]
- internal int MyProperty1 { get; set; }
- }
+ [ProtoMember(2)]
+ internal int MyProperty1 { get; set; }
+ }
}
diff --git a/TestProject/Sample/Sample/ProtoAttributor/ProtoTesterFileScoped.cs b/TestProject/Sample/Sample/ProtoAttributor/ProtoTesterFileScoped.cs
index 6d04e95..102e52a 100644
--- a/TestProject/Sample/Sample/ProtoAttributor/ProtoTesterFileScoped.cs
+++ b/TestProject/Sample/Sample/ProtoAttributor/ProtoTesterFileScoped.cs
@@ -1,27 +1,27 @@
-using System;
using ProtoBuf;
+using System;
namespace Sample;
[ProtoContract]
public class ProtoTesterFileScoped
{
- private string _test;
+ private string _test;
- [ProtoMember(1)]
- public int MyProperty { get; set; }
+ [ProtoMember(1)]
+ public int MyProperty { get; set; }
- [ProtoMember(2)]
- public int MyProperty1 { get; set; }
+ [ProtoMember(2)]
+ public int MyProperty1 { get; set; }
- public DateTime? NullDateTime { get; set; }
+ public DateTime? NullDateTime { get; set; }
- public int? NullInt { get; set; }
+ public int? NullInt { get; set; }
- public int?[] NullIntArray { get; set; }
+ public int?[] NullIntArray { get; set; }
- public bool ExecuteWelcome() { ManWorker(); return true; }
+ public bool ExecuteWelcome() { ManWorker(); return true; }
- private string ManWorker() { return ""; }
+ private string ManWorker() { return ""; }
}
diff --git a/TestProject/Sample/Sample/Sample.csproj b/TestProject/Sample/Sample/Sample.csproj
index f0ca0e0..1b62a09 100644
--- a/TestProject/Sample/Sample/Sample.csproj
+++ b/TestProject/Sample/Sample/Sample.csproj
@@ -7,5 +7,4 @@
-