File tree Expand file tree Collapse file tree 2 files changed +36
-11
lines changed
DocumentationAnalyzers.Test/PortabilityRules
DocumentationAnalyzers/PortabilityRules Expand file tree Collapse file tree 2 files changed +36
-11
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,40 @@ public async Task TestEmptyAndFullElementsValidatedAsync()
8383class TestClass
8484{
8585}
86+ " ;
87+
88+ await Verify . VerifyAnalyzerAsync ( testCode ) ;
89+ }
90+
91+ [ Fact ]
92+ public async Task TestOtherAttributesIgnoredAsync ( )
93+ {
94+ var testCode = @"
95+ /// <summary>
96+ /// <see Langword=""not a keyword""/>
97+ /// <see x:langword=""not a keyword""/>
98+ /// <see name=""not a keyword""/>
99+ /// <see cref=""System.String""/>
100+ /// </summary>
101+ class TestClass
102+ {
103+ }
104+ " ;
105+
106+ await Verify . VerifyAnalyzerAsync ( testCode ) ;
107+ }
108+
109+ [ Fact ]
110+ public async Task TestOtherElementsIgnoredAsync ( )
111+ {
112+ var testCode = @"
113+ /// <summary>
114+ /// <p:see langword=""not a keyword""/>
115+ /// </summary>
116+ ///
117+ class TestClass
118+ {
119+ }
86120" ;
87121
88122 await Verify . VerifyAnalyzerAsync ( testCode ) ;
Original file line number Diff line number Diff line change @@ -59,13 +59,9 @@ private static void HandleXmlNodeSyntax(SyntaxNodeAnalysisContext context)
5959 {
6060 attributes = xmlEmptyElement . Attributes ;
6161 }
62- else if ( xmlNodeSyntax is XmlElementSyntax xmlElement )
63- {
64- attributes = xmlElement . StartTag . Attributes ;
65- }
6662 else
6763 {
68- return ;
64+ attributes = ( ( XmlElementSyntax ) xmlNodeSyntax ) . StartTag . Attributes ;
6965 }
7066
7167 foreach ( var attribute in attributes )
@@ -80,12 +76,7 @@ private static void HandleXmlNodeSyntax(SyntaxNodeAnalysisContext context)
8076 continue ;
8177 }
8278
83- if ( ! ( attribute is XmlTextAttributeSyntax xmlTextAttribute ) )
84- {
85- continue ;
86- }
87-
88- var text = xmlTextAttribute . TextTokens ;
79+ var text = ( ( XmlTextAttributeSyntax ) attribute ) . TextTokens ;
8980 string valueText ;
9081 if ( text . Count == 1 )
9182 {
You can’t perform that action at this time.
0 commit comments