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)
49
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, false } },
69
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true } },
94
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true } },
121
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true } },
151
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true } },
181
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true } },
212
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true } },
237
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true } },
256
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true } },
281
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
301
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
326
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
351
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
373
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
391
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
411
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
431
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
455
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
475
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
496
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
517
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
544
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
567
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
590
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
613
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
636
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
658
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
680
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
704
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
728
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
750
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
772
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
794
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
814
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
843
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
872
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
901
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
930
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
959
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
988
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1017
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1046
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1077
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1103
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1134
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1173
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1212
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1255
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1284
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1327
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1368
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1412
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1454
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1486
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1517
Options = { { CSharpCodeStyleOptions.
PreferTopLevelStatements
, true, NotificationOption2.Suggestion } },
1564
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)
116
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));