106 references to PreferTopLevelStatements
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Formatting\CSharpNewDocumentFormattingServiceTests.cs (2)
300
{ CSharpCodeStyleOptions.
PreferTopLevelStatements
, new CodeStyleOption2<bool>(value: true, notification: NotificationOption2.Suggestion) }
324
{ CSharpCodeStyleOptions.
PreferTopLevelStatements
, new CodeStyleOption2<bool>(value: false, notification: NotificationOption2.Suggestion) }
Microsoft.CodeAnalysis.CSharp.Features (3)
src\Analyzers\CSharp\Analyzers\CodeStyle\CSharpAnalyzerOptionsProvider.cs (1)
37
public CodeStyleOption2<bool> PreferTopLevelStatements => GetOption(CSharpCodeStyleOptions.
PreferTopLevelStatements
);
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertToProgramMainDiagnosticAnalyzer.cs (1)
23
CSharpCodeStyleOptions.
PreferTopLevelStatements
,
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertToTopLevelStatementsDiagnosticAnalyzer.cs (1)
25
CSharpCodeStyleOptions.
PreferTopLevelStatements
,
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (96)
ConvertProgram\ConvertToProgramMainAnalyzerTests.cs (25)
30
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true } },
47
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, false } },
71
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Silent } },
97
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Silent } },
125
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Silent } },
136
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Silent } },
148
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.None } },
169
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion } },
193
{ CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion },
219
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion } },
248
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion } },
285
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion } },
311
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion } },
341
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion } },
368
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion } },
397
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion } },
423
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion } },
450
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion } },
473
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion } },
495
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion } },
528
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion } },
565
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion } },
597
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion } },
634
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion } },
669
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion } },
ConvertProgram\ConvertToProgramMainRefactoringTests.cs (4)
107
{ CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion },
122
{ CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion },
137
{ CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Silent },
161
{ CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.None },
ConvertProgram\ConvertToTopLevelStatementsAnalyzerTests.cs (56)
48
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, false } },
68
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true } },
93
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true } },
120
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true } },
150
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true } },
180
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true } },
211
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true } },
236
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true } },
255
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true } },
280
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
300
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
325
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
350
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
372
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
390
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
410
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
430
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
454
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
474
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
495
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
516
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
543
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
566
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
589
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
612
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
635
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
657
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
679
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
703
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
727
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
749
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
771
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
793
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
813
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
842
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
871
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
900
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
929
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
958
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
987
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1016
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1045
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1076
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1102
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1133
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1172
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1211
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1254
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1283
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1326
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1367
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1411
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1453
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1485
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1516
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1563
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
ConvertProgram\ConvertToTopLevelStatementsRefactoringTests.cs (11)
77
{ CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion },
97
{ CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion },
118
{ CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion },
144
{ CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion },
165
{ CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion },
186
{ CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Silent },
211
{ CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.None },
248
{ CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion },
292
{ CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion },
332
{ CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion },
382
{ CSharpCodeStyleOptions.
PreferTopLevelStatements
, false, NotificationOption2.Suggestion },
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpSyntaxFormattingOptions.cs (1)
114
PreferTopLevelStatements = options.GetOption(CSharpCodeStyleOptions.
PreferTopLevelStatements
);
Microsoft.VisualStudio.LanguageServices.CSharp (4)
EditorConfigSettings\DataProvider\CodeStyle\CSharpCodeStyleSettingsProvider.cs (1)
105
yield return CodeStyleSetting.Create(CSharpCodeStyleOptions.
PreferTopLevelStatements
, ServicesVSResources.Prefer_top_level_statements, options, updater);
Options\AutomationObject\AutomationObject.Style.cs (2)
362
get { return GetXmlOption(CSharpCodeStyleOptions.
PreferTopLevelStatements
); }
363
set { SetXmlOption(CSharpCodeStyleOptions.
PreferTopLevelStatements
, value); }
Options\Formatting\StyleViewModel.cs (1)
2272
CodeStyleItems.Add(new BooleanCodeStyleOptionViewModel(CSharpCodeStyleOptions.
PreferTopLevelStatements
, ServicesVSResources.Prefer_top_level_statements, s_preferTopLevelStatements, s_preferProgramMain, this, optionStore, codeBlockPreferencesGroupTitle));