File tree Expand file tree Collapse file tree
IntelliTect.Analyzer.Test
IntelliTect.Analyzer/Analyzers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,6 +77,15 @@ public string MyMethod()
7777 VerifyCSharpDiagnostic ( test ) ;
7878 }
7979
80+ [ TestMethod ]
81+ public void ProperlyNamedMethod_TopLevelStatements_NoDiagnosticInformationReturned ( )
82+ {
83+ string test = @"
84+ Console.WriteLine(""Hello World!"");" ;
85+
86+ VerifyCSharpDiagnostic ( test ) ;
87+ }
88+
8089 [ TestMethod ]
8190 public void AutoProperty_PascalCasedMethod_NoDiagnosticInformationReturned ( )
8291 {
Original file line number Diff line number Diff line change 22using System ;
33using System . Collections . Immutable ;
44using System . Linq ;
5+ using System . Xml . Linq ;
56using IntelliTect . Analyzer . Naming ;
67using Microsoft . CodeAnalysis ;
78using Microsoft . CodeAnalysis . CSharp ;
@@ -77,6 +78,12 @@ private static void AnalyzeSymbol(SymbolAnalysisContext context)
7778 default : return ;
7879 }
7980
81+ // Common symbols for generated code to use, including the main method for top-level statements.
82+ if ( name . Contains ( '<' ) || name . Contains ( '>' ) )
83+ {
84+ return ;
85+ }
86+
8087 if ( Casing . IsPascalCase ( name ) )
8188 {
8289 return ;
You can’t perform that action at this time.
0 commit comments