Skip to content

Commit fb1bde1

Browse files
committed
Fix additional documentation items found when reviewing SA1629 violations
1 parent 241a420 commit fb1bde1

8 files changed

Lines changed: 34 additions & 24 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/OrderingRules/UsingCodeFixProvider.SourceMap.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,16 @@ internal sealed partial class UsingCodeFixProvider
1818
{
1919
/// <summary>
2020
/// Contains a map of the different regions of a source file.
21-
/// Used source file regions are:
22-
/// - conditional directives (#if, #else, #elif, #endif)
23-
/// - pragma warning directives
24-
/// - region directives.
2521
/// </summary>
22+
/// <remarks>
23+
/// <para>Used source file regions are:</para>
24+
///
25+
/// <list type="bullet">
26+
/// <item>conditional directives (#if, #else, #elif, #endif)</item>
27+
/// <item>pragma warning directives</item>
28+
/// <item>region directives</item>
29+
/// </list>
30+
/// </remarks>
2631
private class SourceMap
2732
{
2833
private readonly TreeTextSpan regionRoot;

StyleCop.Analyzers/StyleCop.Analyzers.Status.Generator/SolutionReader.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ private SolutionReader()
6262
/// <summary>
6363
/// Creates a new instance of the <see cref="SolutionReader"/> class.
6464
/// </summary>
65-
/// <param name="pathToSln">The path to the StyleCop.Analayzers sln.</param>
65+
/// <param name="pathToSln">The path to the StyleCop.Analayzers solution.</param>
6666
/// <param name="analyzerProjectName">The project name of the analyzer project.</param>
6767
/// <param name="codeFixProjectName">The project name of the code fix project.</param>
68-
/// <returns>A <see cref="Task{SolutionReader}"/> representing the asynchronous operation.</returns>
68+
/// <returns>A <see cref="Task{TResult}"/> representing the asynchronous operation.</returns>
6969
public static async Task<SolutionReader> CreateAsync(string pathToSln, string analyzerProjectName = "StyleCop.Analyzers", string codeFixProjectName = "StyleCop.Analyzers.CodeFixes")
7070
{
7171
SolutionReader reader = new SolutionReader();

StyleCop.Analyzers/StyleCop.Analyzers.Status.Generator/StyleCopDiagnostic.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public class StyleCopDiagnostic
9797
/// Creates an instance of the <see cref="StyleCopDiagnostic"/> class
9898
/// that is populated with the data stored in <paramref name="value"/>.
9999
/// </summary>
100-
/// <param name="value">A json representing a <see cref="StyleCopDiagnostic"/>.</param>
100+
/// <param name="value">A JSON string representing a <see cref="StyleCopDiagnostic"/>.</param>
101101
/// <returns>A <see cref="StyleCopDiagnostic"/> that is populated with the data stored in <paramref name="value"/>.</returns>
102102
public static StyleCopDiagnostic FromJson(string value)
103103
{
@@ -116,9 +116,9 @@ public override string ToString()
116116
}
117117

118118
/// <summary>
119-
/// Returns a json representation of this diagnostic.
119+
/// Returns a JSON representation of this diagnostic.
120120
/// </summary>
121-
/// <returns>A json string representing this diagnostic.</returns>
121+
/// <returns>A JSON string representing this diagnostic.</returns>
122122
public string ToJson()
123123
{
124124
return JsonConvert.SerializeObject(this);

StyleCop.Analyzers/StyleCop.Analyzers.Test/HelperTests/IndentationHelperTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public class IndentationHelperTests
9999
private const string TestFilename = "Test0.cs";
100100

101101
/// <summary>
102-
/// Verify the workings of IndentationHelper.GetIndentationSteps.
102+
/// Verify the workings of <see cref="IndentationHelper.GetIndentationSteps(IndentationSettings, SyntaxToken)"/>.
103103
/// </summary>
104104
/// <param name="indentationString">The indentation string to use with the test.</param>
105105
/// <param name="expectedIndentationSteps">The expected number of indentation steps.</param>
@@ -121,7 +121,8 @@ public async Task VerifyGetIndentationStepsAsync(string indentationString, int e
121121
}
122122

123123
/// <summary>
124-
/// Verify the that IndentationHelper.GetIndentationSteps will return zero (0) for tokens that are not the first token on a line.
124+
/// Verify the that <see cref="IndentationHelper.GetIndentationSteps(IndentationSettings, SyntaxToken)"/> will
125+
/// return zero (0) for tokens that are not the first token on a line.
125126
/// </summary>
126127
/// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns>
127128
[Fact]

StyleCop.Analyzers/StyleCop.Analyzers.Test/Helpers/DiagnosticVerifier.Helper.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ protected DiagnosticResult CSharpCompilerError(string errorIdentifier)
251251
/// <param name="sources">Classes in the form of strings.</param>
252252
/// <param name="language">The language the source classes are in. Values may be taken from the
253253
/// <see cref="LanguageNames"/> class.</param>
254-
/// <param name="filenames">The filenames or null if the default filename should be used.</param>
254+
/// <param name="filenames">The filenames or <see langword="null"/> if the default filename should be used.</param>
255255
/// <returns>A <see cref="Project"/> created out of the <see cref="Document"/>s created from the source
256256
/// strings.</returns>
257257
protected Project CreateProject(string[] sources, string language = LanguageNames.CSharp, string[] filenames = null)
@@ -266,7 +266,7 @@ protected Project CreateProject(string[] sources, string language = LanguageName
266266
/// <param name="sources">Classes in the form of strings.</param>
267267
/// <param name="language">The language the source classes are in. Values may be taken from the
268268
/// <see cref="LanguageNames"/> class.</param>
269-
/// <param name="filenames">The filenames or null if the default filename should be used.</param>
269+
/// <param name="filenames">The filenames or <see langword="null"/> if the default filename should be used.</param>
270270
/// <returns>A <see cref="Project"/> created out of the <see cref="Document"/>s created from the source
271271
/// strings.</returns>
272272
protected virtual Project CreateProjectImpl(string[] sources, string language, string[] filenames)
@@ -296,7 +296,7 @@ protected virtual Project CreateProjectImpl(string[] sources, string language, s
296296
/// <remarks>
297297
/// <para>The default implementation configures the project by enabling all supported diagnostics of analyzers
298298
/// included in <see cref="GetCSharpDiagnosticAnalyzers"/> as well as <c>AD0001</c>. After configuring these
299-
/// diagnostics, any diagnostic IDs indicated in <see cref="GetDisabledDiagnostics"/> are explictly supressed
299+
/// diagnostics, any diagnostic IDs indicated in <see cref="GetDisabledDiagnostics"/> are explicitly suppressed
300300
/// using <see cref="ReportDiagnostic.Suppress"/>.</para>
301301
/// </remarks>
302302
/// <param name="project">The project.</param>
@@ -381,7 +381,7 @@ private static Diagnostic[] SortDistinctDiagnostics(IEnumerable<Diagnostic> diag
381381
/// <see cref="LanguageNames"/> class.</param>
382382
/// <param name="analyzers">The analyzers to be run on the sources.</param>
383383
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that the task will observe.</param>
384-
/// <param name="filenames">The filenames or null if the default filename should be used.</param>
384+
/// <param name="filenames">The filenames or <see langword="null"/> if the default filename should be used.</param>
385385
/// <returns>A collection of <see cref="Diagnostic"/>s that surfaced in the source code, sorted by
386386
/// <see cref="Diagnostic.Location"/>.</returns>
387387
private Task<ImmutableArray<Diagnostic>> GetSortedDiagnosticsAsync(string[] sources, string language, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken, string[] filenames)
@@ -396,7 +396,7 @@ private Task<ImmutableArray<Diagnostic>> GetSortedDiagnosticsAsync(string[] sour
396396
/// <param name="sources">Classes in the form of strings.</param>
397397
/// <param name="language">The language the source classes are in. Values may be taken from the
398398
/// <see cref="LanguageNames"/> class.</param>
399-
/// <param name="filenames">The filenames or null if the default filename should be used.</param>
399+
/// <param name="filenames">The filenames or <see langword="null"/> if the default filename should be used.</param>
400400
/// <returns>A collection of <see cref="Document"/>s representing the sources.</returns>
401401
private Document[] GetDocuments(string[] sources, string language, string[] filenames)
402402
{

StyleCop.Analyzers/StyleCop.Analyzers.Test/WorkItemAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace StyleCop.Analyzers.Test
66
using System;
77

88
/// <summary>
9-
/// Used to tag test methods or types which are created for a given WorkItem.
9+
/// Used to tag test methods or types which are created for a given work item.
1010
/// </summary>
1111
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
1212
public sealed class WorkItemAttribute : Attribute

StyleCop.Analyzers/StyleCop.Analyzers/Helpers/XmlCommentHelper.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ internal static class XmlCommentHelper
5454
/// - it is null
5555
/// - it does not have any text in any XML element and it does not have an empty XML element in it.
5656
/// </summary>
57-
/// <param name="xmlComment">The xmlComment that should be checked.</param>
57+
/// <param name="xmlComment">The XML comment that should be checked.</param>
5858
/// <returns>true, if the comment should be considered empty, false otherwise.</returns>
5959
internal static bool IsConsideredEmpty(DocumentationCommentTriviaSyntax xmlComment)
6060
{
@@ -78,7 +78,7 @@ internal static bool IsConsideredEmpty(DocumentationCommentTriviaSyntax xmlComme
7878
/// This helper is used by documentation diagnostics to check if a XML comment should be considered empty.
7979
/// A comment is empty if it does not have any text in any XML element and it does not have an empty XML element in it.
8080
/// </summary>
81-
/// <param name="xmlSyntax">The xmlSyntax that should be checked.</param>
81+
/// <param name="xmlSyntax">The XML syntax that should be checked.</param>
8282
/// <param name="considerEmptyElements">Flag indicating if empty elements should be considered or assumed non-empty.</param>
8383
/// <returns>true, if the comment should be considered empty, false otherwise.</returns>
8484
internal static bool IsConsideredEmpty(XmlNodeSyntax xmlSyntax, bool considerEmptyElements = false)
@@ -171,10 +171,14 @@ internal static bool IsConsideredEmpty(XNode node)
171171
}
172172

173173
/// <summary>
174-
/// Checks if a SyntaxTrivia contains a DocumentationCommentTriviaSyntax and returns true if it is considered empty.
174+
/// Checks if a <see cref="SyntaxTrivia"/> contains a <see cref="DocumentationCommentTriviaSyntax"/> and returns
175+
/// <see langword="true"/> if it is considered empty.
175176
/// </summary>
176-
/// <param name="commentTrivia">A SyntaxTrivia containing possible documentation.</param>
177-
/// <returns>true if commentTrivia does not have documentation in it or the documentation in SyntaxTriviais considered empty. False otherwise.</returns>
177+
/// <param name="commentTrivia">A <see cref="SyntaxTrivia"/> containing possible documentation.</param>
178+
/// <returns>
179+
/// <see langword="true"/> if <paramref name="commentTrivia"/> does not have documentation in it or the
180+
/// documentation in <paramref name="commentTrivia"/> is considered empty; otherwise, <see langword="false"/>.
181+
/// </returns>
178182
internal static bool IsMissingOrEmpty(SyntaxTrivia commentTrivia)
179183
{
180184
if (!commentTrivia.HasStructure)

StyleCop.Analyzers/StyleCop.Analyzers/LightJson/JsonValue.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,8 @@ public JsonValue this[string key]
487487
/// Gets or sets the value at the specified index.
488488
/// </summary>
489489
/// <param name="index">The zero-based index of the value to get or set.</param>
490-
/// <exception cref="System.InvalidOperationException">
491-
/// Thrown when this JsonValue is not a JsonArray.
490+
/// <exception cref="InvalidOperationException">
491+
/// Thrown when this <see cref="JsonValue"/> is not a <see cref="JsonArray"/>.
492492
/// </exception>
493493
public JsonValue this[int index]
494494
{

0 commit comments

Comments
 (0)