Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private void AnalyzeNamespace(SyntaxNodeAnalysisContext context)
diagnosticLocation,
severity,
ImmutableArray.Create(declaration.GetLocation()),
ImmutableDictionary<string, string?>.Empty);
ImmutableDictionary<string, string?>.Empty).Diagnostic;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private void AnalyzeNamespace(SyntaxNodeAnalysisContext context)
diagnosticLocation,
severity,
ImmutableArray.Create(declaration.GetLocation()),
ImmutableDictionary<string, string?>.Empty);
ImmutableDictionary<string, string?>.Empty).Diagnostic;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private void AnalyzeSyntax(SyntaxNodeAnalysisContext context)
var properties = ImmutableDictionary<string, string?>.Empty.Add(nameof(UseExpressionBody), "");
return DiagnosticHelper.Create(
CreateDescriptorWithId(helper.DiagnosticId, helper.EnforceOnBuild, helper.UseExpressionBodyTitle, helper.UseExpressionBodyTitle),
location, severity, additionalLocations: additionalLocations, properties: properties);
location, severity, additionalLocations: additionalLocations, properties: properties).Diagnostic;
}

if (helper.CanOfferUseBlockBody(preference, declaration, forAnalyzer: true, out var fixesError, out var expressionBody))
Expand All @@ -122,7 +122,7 @@ private void AnalyzeSyntax(SyntaxNodeAnalysisContext context)
var additionalLocations = ImmutableArray.Create(declaration.GetLocation());
return DiagnosticHelper.Create(
CreateDescriptorWithId(helper.DiagnosticId, helper.EnforceOnBuild, helper.UseBlockBodyTitle, helper.UseBlockBodyTitle),
location, severity, additionalLocations: additionalLocations, properties: properties);
location, severity, additionalLocations: additionalLocations, properties: properties).Diagnostic;
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private void HandleVariableDeclaration(SyntaxNodeAnalysisContext context)
context.ReportDiagnostic(CreateDiagnostic(descriptor, declarationStatement, declaredType.StripRefIfNeeded().Span, typeStyle.Severity));
}

private static Diagnostic CreateDiagnostic(DiagnosticDescriptor descriptor, SyntaxNode declaration, TextSpan diagnosticSpan, ReportDiagnostic severity)
private static DiagnosticHelper.DiagnosticWrapper CreateDiagnostic(DiagnosticDescriptor descriptor, SyntaxNode declaration, TextSpan diagnosticSpan, ReportDiagnostic severity)
=> DiagnosticHelper.Create(descriptor, declaration.SyntaxTree.GetLocation(diagnosticSpan), severity, additionalLocations: null, properties: null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ private static bool IsValidIndexing(IInvocationOperation invocation, InfoCache i
return !invocation.Syntax.IsLeftSideOfAnyAssignExpression() || indexer == null || !IsWriteableIndexer(invocation, indexer);
}

private Diagnostic CreateDiagnostic(Result result, ReportDiagnostic severity)
private DiagnosticHelper.DiagnosticWrapper CreateDiagnostic(Result result, ReportDiagnostic severity)
{
// Keep track of the invocation node
var invocation = result.Invocation;
Expand Down
58 changes: 29 additions & 29 deletions src/Analyzers/Core/Analyzers/AnalyzersResources.resx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema

<!--
Microsoft ResX Schema
Version 2.0

The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.

Example:

... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
Expand All @@ -26,36 +26,36 @@
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>

There are any number of "resheader" rows that contain simple
There are any number of "resheader" rows that contain simple
name/value pairs.

Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.

The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:

Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.

mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
Expand Down Expand Up @@ -136,10 +136,10 @@
<value>Private member '{0}' can be removed as the value assigned to it is never read</value>
</data>
<data name="Private_method_0_can_be_removed_as_it_is_never_invoked" xml:space="preserve">
<value>Private method '{0}' can be removed as it is never invoked.</value>
<value>Private method '{0}' can be removed as it is never invoked</value>
</data>
<data name="Private_property_0_can_be_converted_to_a_method_as_its_get_accessor_is_never_invoked" xml:space="preserve">
<value>Private property '{0}' can be converted to a method as its get accessor is never invoked.</value>
<value>Private property '{0}' can be converted to a method as its get accessor is never invoked</value>
</data>
<data name="A_source_file_is_missing_a_required_header" xml:space="preserve">
<value>A source file is missing a required header.</value>
Expand Down
Loading