mirror of
https://github.com/Tyrrrz/CliFx.git
synced 2025-10-25 15:19:17 +00:00
Improve analyzer diagnostics
This commit is contained in:
@@ -13,7 +13,8 @@ public class OptionMustHaveUniqueShortNameAnalyzer : AnalyzerBase
|
||||
public OptionMustHaveUniqueShortNameAnalyzer()
|
||||
: base(
|
||||
"Options must have unique short names",
|
||||
"This option's short name must be unique within the command (comparison IS case sensitive).")
|
||||
"This option's short name must be unique within the command (comparison IS case sensitive). " +
|
||||
"Specified short name: '{0}'.")
|
||||
{
|
||||
}
|
||||
|
||||
@@ -50,7 +51,12 @@ public class OptionMustHaveUniqueShortNameAnalyzer : AnalyzerBase
|
||||
|
||||
if (option.ShortName == otherOption.ShortName)
|
||||
{
|
||||
context.ReportDiagnostic(CreateDiagnostic(propertyDeclaration.GetLocation()));
|
||||
context.ReportDiagnostic(
|
||||
CreateDiagnostic(
|
||||
propertyDeclaration.Identifier.GetLocation(),
|
||||
option.ShortName
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user