90 references to DeclarePublicApiAnalyzer
Microsoft.CodeAnalysis.PublicApiAnalyzers (5)
PublicApiFile.cs (5)
18
IsShipping = IsFile(fileName, isPublic ?
DeclarePublicApiAnalyzer
.PublicShippedFileNamePrefix :
DeclarePublicApiAnalyzer
.InternalShippedFileNamePrefix);
19
var isUnshippedFile = IsFile(fileName, isPublic ?
DeclarePublicApiAnalyzer
.PublicUnshippedFileNamePrefix :
DeclarePublicApiAnalyzer
.InternalUnshippedFileNamePrefix);
29
=> path.StartsWith(prefix, StringComparison.Ordinal) && path.EndsWith(
DeclarePublicApiAnalyzer
.Extension, StringComparison.Ordinal);
Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes (21)
AnnotatePublicApiFix.cs (8)
41
string minimalSymbolName = diagnostic.Properties[
DeclarePublicApiAnalyzer
.MinimalNamePropertyBagKey];
42
string publicSymbolName = diagnostic.Properties[
DeclarePublicApiAnalyzer
.ApiNamePropertyBagKey];
43
string publicSymbolNameWithNullability = diagnostic.Properties[
DeclarePublicApiAnalyzer
.ApiNameWithNullabilityPropertyBagKey];
44
string fileName = diagnostic.Properties[
DeclarePublicApiAnalyzer
.FileName];
144
string oldName = diagnostic.Properties[
DeclarePublicApiAnalyzer
.ApiNamePropertyBagKey];
145
string newName = diagnostic.Properties[
DeclarePublicApiAnalyzer
.ApiNameWithNullabilityPropertyBagKey];
146
bool isShipped = diagnostic.Properties[
DeclarePublicApiAnalyzer
.ApiIsShippedPropertyBagKey] == "true";
147
string fileName = diagnostic.Properties[
DeclarePublicApiAnalyzer
.FileName];
DeclarePublicApiFix.cs (11)
43
string minimalSymbolName = diagnostic.Properties[
DeclarePublicApiAnalyzer
.MinimalNamePropertyBagKey];
44
string publicSurfaceAreaSymbolName = diagnostic.Properties[
DeclarePublicApiAnalyzer
.ApiNamePropertyBagKey];
45
ImmutableHashSet<string> siblingSymbolNamesToRemove = diagnostic.Properties[
DeclarePublicApiAnalyzer
.ApiNamesOfSiblingsToRemovePropertyBagKey]
46
.Split(
DeclarePublicApiAnalyzer
.ApiNamesOfSiblingsToRemovePropertyBagValueSeparator.ToCharArray())
105
project = AddAdditionalDocument(project, isPublic ?
DeclarePublicApiAnalyzer
.PublicShippedFileName :
DeclarePublicApiAnalyzer
.InternalShippedFileName, SourceText.From(string.Empty));
106
project = AddAdditionalDocument(project, isPublic ?
DeclarePublicApiAnalyzer
.PublicUnshippedFileName :
DeclarePublicApiAnalyzer
.InternalUnshippedFileName, unshippedText);
272
string publicSurfaceAreaSymbolName = diagnostic.Properties[
DeclarePublicApiAnalyzer
.ApiNamePropertyBagKey];
276
string siblingNamesToRemove = diagnostic.Properties[
DeclarePublicApiAnalyzer
.ApiNamesOfSiblingsToRemovePropertyBagKey];
279
var namesToRemove = siblingNamesToRemove.Split(
DeclarePublicApiAnalyzer
.ApiNamesOfSiblingsToRemovePropertyBagValueSeparator.ToCharArray());
PublicApiFixHelpers.cs (2)
61
=> project.GetPublicApiDocument(isPublic ?
DeclarePublicApiAnalyzer
.PublicShippedFileName :
DeclarePublicApiAnalyzer
.InternalShippedFileName);
Microsoft.CodeAnalysis.PublicApiAnalyzers.UnitTests (64)
AnnotatePublicApiAnalyzerTestsBase.cs (7)
32
var test = new CSharpCodeFixTest<
DeclarePublicApiAnalyzer
, AnnotatePublicApiFix, DefaultVerifier>
63
var test = new CSharpCodeFixTest<
DeclarePublicApiAnalyzer
, AnnotatePublicApiFix, DefaultVerifier>();
134
var test = new CSharpCodeFixTest<
DeclarePublicApiAnalyzer
, AnnotatePublicApiFix, DefaultVerifier>
143
(UnshippedFileNamePrefix + "test" +
DeclarePublicApiAnalyzer
.Extension, unshippedText2),
393
var test = new CSharpCodeFixTest<
DeclarePublicApiAnalyzer
, AnnotatePublicApiFix, DefaultVerifier>();
399
test.TestState.AdditionalFiles.Add((UnshippedFileNamePrefix + "test" +
DeclarePublicApiAnalyzer
.Extension, unshippedText));
403
test.FixedState.AdditionalFiles.Add((UnshippedFileNamePrefix + "test" +
DeclarePublicApiAnalyzer
.Extension, fixedUnshippedText));
AnnotatePublicApiAnalyzerTestsInternal.cs (3)
14
protected override string ShippedFileName =>
DeclarePublicApiAnalyzer
.InternalShippedFileName;
15
protected override string UnshippedFileName =>
DeclarePublicApiAnalyzer
.InternalUnshippedFileName;
16
protected override string UnshippedFileNamePrefix =>
DeclarePublicApiAnalyzer
.InternalUnshippedFileNamePrefix;
AnnotatePublicApiAnalyzerTestsPublic.cs (3)
14
protected override string ShippedFileName =>
DeclarePublicApiAnalyzer
.PublicShippedFileName;
15
protected override string UnshippedFileName =>
DeclarePublicApiAnalyzer
.PublicUnshippedFileName;
16
protected override string UnshippedFileNamePrefix =>
DeclarePublicApiAnalyzer
.PublicUnshippedFileNamePrefix;
DeclarePublicAPIAnalyzerTestsBase.cs (19)
77
var test = new VisualBasicCodeFixTest<
DeclarePublicApiAnalyzer
, DeclarePublicApiFix, DefaultVerifier>
103
var test = new CSharpCodeFixTest<
DeclarePublicApiAnalyzer
, DeclarePublicApiFix, DefaultVerifier>
129
var test = new CSharpCodeFixVerifier<
DeclarePublicApiAnalyzer
, DeclarePublicApiFix>.Test
156
var test = new CSharpCodeFixVerifier<
DeclarePublicApiAnalyzer
, DeclarePublicApiFix>.Test
184
var test = new CSharpCodeFixTest<
DeclarePublicApiAnalyzer
, DeclarePublicApiFix, DefaultVerifier>
227
? new CSharpCodeFixTest<
DeclarePublicApiAnalyzer
, DeclarePublicApiFix, DefaultVerifier>()
228
: (CodeFixTest<DefaultVerifier>)new VisualBasicCodeFixTest<
DeclarePublicApiAnalyzer
, DeclarePublicApiFix, DefaultVerifier>();
755
{
DeclarePublicApiAnalyzer
.RemovedApiPrefix}C.Method() -> void
791
{
DeclarePublicApiAnalyzer
.RemovedApiPrefix}C.Method() -> void
796
GetAdditionalFileResultAt(2, 1, UnshippedFileName,
DeclarePublicApiAnalyzer
.RemovedApiIsNotActuallyRemovedRule, "C.Method() -> void")
828
{
DeclarePublicApiAnalyzer
.RemovedApiPrefix}C.Method() -> void
834
.WithArguments(
DeclarePublicApiAnalyzer
.InvalidReasonShippedCantHaveRemoved);
1201
, GetCSharpResultAt(2, 12,
DeclarePublicApiAnalyzer
.ShouldAnnotatePublicApiFilesRule)
1234
, GetCSharpResultAt(2, 12,
DeclarePublicApiAnalyzer
.ShouldAnnotatePublicApiFilesRule)
2273
var unshippedTextName2 = UnshippedFileNamePrefix + "test" +
DeclarePublicApiAnalyzer
.Extension;
2275
var test = new CSharpCodeFixTest<
DeclarePublicApiAnalyzer
, DeclarePublicApiFix, DefaultVerifier>();
2528
.WithArguments(
DeclarePublicApiAnalyzer
.InvalidReasonMisplacedNullableEnable);
2550
.WithArguments(
DeclarePublicApiAnalyzer
.InvalidReasonMisplacedNullableEnable);
3271
var test = new CSharpCodeFixTest<
DeclarePublicApiAnalyzer
, DeclarePublicApiFix, DefaultVerifier>()
DeclarePublicAPIAnalyzerTestsInternal.cs (12)
17
protected override string ShippedFileName =>
DeclarePublicApiAnalyzer
.InternalShippedFileName;
18
protected override string UnshippedFileName =>
DeclarePublicApiAnalyzer
.InternalUnshippedFileName;
19
protected override string UnshippedFileNamePrefix =>
DeclarePublicApiAnalyzer
.InternalUnshippedFileNamePrefix;
25
protected override DiagnosticDescriptor DeclareNewApiRule =>
DeclarePublicApiAnalyzer
.DeclareNewInternalApiRule;
26
protected override DiagnosticDescriptor RemoveDeletedApiRule =>
DeclarePublicApiAnalyzer
.RemoveDeletedInternalApiRule;
27
protected override DiagnosticDescriptor DuplicateSymbolInApiFiles =>
DeclarePublicApiAnalyzer
.DuplicateSymbolInInternalApiFiles;
28
protected override DiagnosticDescriptor AvoidMultipleOverloadsWithOptionalParameters =>
DeclarePublicApiAnalyzer
.AvoidMultipleOverloadsWithOptionalParametersInternal;
29
protected override DiagnosticDescriptor OverloadWithOptionalParametersShouldHaveMostParameters =>
DeclarePublicApiAnalyzer
.OverloadWithOptionalParametersShouldHaveMostParametersInternal;
30
protected override DiagnosticDescriptor AnnotateApiRule =>
DeclarePublicApiAnalyzer
.AnnotateInternalApiRule;
31
protected override DiagnosticDescriptor ObliviousApiRule =>
DeclarePublicApiAnalyzer
.ObliviousInternalApiRule;
32
protected override DiagnosticDescriptor ApiFilesInvalid =>
DeclarePublicApiAnalyzer
.InternalApiFilesInvalid;
33
protected override DiagnosticDescriptor ApiFileMissing =>
DeclarePublicApiAnalyzer
.InternalApiFileMissing;
DeclarePublicAPIAnalyzerTestsPublic.cs (12)
17
protected override string ShippedFileName =>
DeclarePublicApiAnalyzer
.PublicShippedFileName;
18
protected override string UnshippedFileName =>
DeclarePublicApiAnalyzer
.PublicUnshippedFileName;
19
protected override string UnshippedFileNamePrefix =>
DeclarePublicApiAnalyzer
.PublicUnshippedFileNamePrefix;
25
protected override DiagnosticDescriptor DeclareNewApiRule =>
DeclarePublicApiAnalyzer
.DeclareNewPublicApiRule;
26
protected override DiagnosticDescriptor RemoveDeletedApiRule =>
DeclarePublicApiAnalyzer
.RemoveDeletedPublicApiRule;
27
protected override DiagnosticDescriptor DuplicateSymbolInApiFiles =>
DeclarePublicApiAnalyzer
.DuplicateSymbolInPublicApiFiles;
28
protected override DiagnosticDescriptor AvoidMultipleOverloadsWithOptionalParameters =>
DeclarePublicApiAnalyzer
.AvoidMultipleOverloadsWithOptionalParametersPublic;
29
protected override DiagnosticDescriptor OverloadWithOptionalParametersShouldHaveMostParameters =>
DeclarePublicApiAnalyzer
.OverloadWithOptionalParametersShouldHaveMostParametersPublic;
30
protected override DiagnosticDescriptor AnnotateApiRule =>
DeclarePublicApiAnalyzer
.AnnotatePublicApiRule;
31
protected override DiagnosticDescriptor ObliviousApiRule =>
DeclarePublicApiAnalyzer
.ObliviousPublicApiRule;
32
protected override DiagnosticDescriptor ApiFilesInvalid =>
DeclarePublicApiAnalyzer
.PublicApiFilesInvalid;
33
protected override DiagnosticDescriptor ApiFileMissing =>
DeclarePublicApiAnalyzer
.PublicApiFileMissing;
NullableEnablePublicApiAnalyzerTests.cs (8)
19
var test = new CSharpCodeFixTest<
DeclarePublicApiAnalyzer
, NullableEnablePublicApiFix, DefaultVerifier>
30
test.TestState.AdditionalFiles.Add((
DeclarePublicApiAnalyzer
.PublicShippedFileName, shippedApiText));
35
test.TestState.AdditionalFiles.Add((
DeclarePublicApiAnalyzer
.PublicUnshippedFileName, unshippedApiText));
49
var test = new CSharpCodeFixTest<
DeclarePublicApiAnalyzer
, NullableEnablePublicApiFix, DefaultVerifier>();
52
test.TestState.AdditionalFiles.Add((
DeclarePublicApiAnalyzer
.PublicShippedFileName, oldShippedApiText));
53
test.TestState.AdditionalFiles.Add((
DeclarePublicApiAnalyzer
.PublicUnshippedFileName, oldUnshippedApiText));
56
test.FixedState.AdditionalFiles.Add((
DeclarePublicApiAnalyzer
.PublicShippedFileName, newShippedApiText));
57
test.FixedState.AdditionalFiles.Add((
DeclarePublicApiAnalyzer
.PublicUnshippedFileName, newUnshippedApiText));