1419 references to SourceCodeKind
Microsoft.CodeAnalysis (17)
Compilation\Compilation.cs (1)
1078Debug.Assert(tree.Options.Kind != SourceCodeKind.Script);
Compilation\ParseOptions.cs (6)
26public SourceCodeKind Kind { get; protected set; } 30/// the call to the constructor, or modified using the <see cref="WithKind(SourceCodeKind)"/> method. 32public SourceCodeKind SpecifiedKind { get; protected set; } 39internal ParseOptions(SourceCodeKind kind, DocumentationMode documentationMode) 69public ParseOptions WithKind(SourceCodeKind kind) 97public abstract ParseOptions CommonWithKind(SourceCodeKind kind);
SourceCodeKindExtensions.cs (10)
9internal static SourceCodeKind MapSpecifiedToEffectiveKind(this SourceCodeKind kind) 13case SourceCodeKind.Script: 15case SourceCodeKind.Interactive: 17return SourceCodeKind.Script; 19case SourceCodeKind.Regular: 21return SourceCodeKind.Regular; 25internal static bool IsValid(this SourceCodeKind value) 27return value >= SourceCodeKind.Regular && value <= SourceCodeKind.Script;
Microsoft.CodeAnalysis.CodeStyle (11)
src\Compilers\Core\Portable\SourceCodeKindExtensions.cs (10)
9internal static SourceCodeKind MapSpecifiedToEffectiveKind(this SourceCodeKind kind) 13case SourceCodeKind.Script: 15case SourceCodeKind.Interactive: 17return SourceCodeKind.Script; 19case SourceCodeKind.Regular: 21return SourceCodeKind.Regular; 25internal static bool IsValid(this SourceCodeKind value) 27return value >= SourceCodeKind.Regular && value <= SourceCodeKind.Script;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (1)
39=> syntaxTree.Options.Kind != SourceCodeKind.Regular;
Microsoft.CodeAnalysis.CSharp (33)
Binder\Binder_Initializers.cs (1)
195Debug.Assert(syntaxTree.Options.Kind != SourceCodeKind.Regular);
Binder\Binder_Patterns.cs (1)
906Debug.Assert(designation.SyntaxTree.Options.Kind != SourceCodeKind.Regular);
Binder\BinderFactory.BinderFactoryVisitor.cs (1)
441if (node.Parent.Kind() == SyntaxKind.CompilationUnit && syntaxTree.Options.Kind != SourceCodeKind.Regular)
Binder\BinderFactory.cs (1)
94return _syntaxTree.Options.Kind == SourceCodeKind.Script;
CommandLine\CSharpCommandLineParser.cs (2)
1477kind: IsScriptCommandLineParser ? SourceCodeKind.Script : SourceCodeKind.Regular,
CommandLine\CSharpCompiler.cs (1)
49var scriptParseOptions = parseOptions.WithKind(SourceCodeKind.Script);
Compilation\CSharpCompilation.cs (1)
882if (this.IsSubmission && tree.Options.Kind == SourceCodeKind.Regular)
Compilation\SyntaxAndDeclarationManager.cs (4)
167var sourceCodeKind = tree.Options.Kind; 168if (sourceCodeKind == SourceCodeKind.Script) 681var sourceCodeKind = tree.Options.Kind; 682if (sourceCodeKind == SourceCodeKind.Script)
Compilation\SyntaxTreeSemanticModel.cs (2)
1302return this.SyntaxTree.Options.Kind == SourceCodeKind.Regular; 2366if (this.SyntaxTree.Options.Kind != SourceCodeKind.Regular)
CSharpParseOptions.cs (5)
53SourceCodeKind kind = SourceCodeKind.Regular, 66SourceCodeKind kind, 88public new CSharpParseOptions WithKind(SourceCodeKind kind) 145public override ParseOptions CommonWithKind(SourceCodeKind kind)
Declarations\DeclarationTreeBuilder.cs (5)
131(node.Kind() == SyntaxKind.CompilationUnit && _syntaxTree.Options.Kind == SourceCodeKind.Regular)); 141bool acceptSimpleProgram = node.Kind() == SyntaxKind.CompilationUnit && _syntaxTree.Options.Kind == SourceCodeKind.Regular; 267Debug.Assert(_syntaxTree.Options.Kind != SourceCodeKind.Regular); 327Debug.Assert(parent.Kind() == SyntaxKind.CompilationUnit && _syntaxTree.Options.Kind != SourceCodeKind.Regular); 393if (_syntaxTree.Options.Kind != SourceCodeKind.Regular)
Parser\DirectiveParser.cs (3)
502if (Options.Kind == SourceCodeKind.Regular) 522if (Options.Kind == SourceCodeKind.Regular) 688if (lexer.Options.Kind != SourceCodeKind.Script && !lexer.Options.FileBasedProgram)
Parser\SyntaxParser.cs (1)
226get { return Options.Kind == SourceCodeKind.Script; }
Syntax\CSharpSyntaxTree.cs (2)
137return Options.Kind == SourceCodeKind.Script && GetCompilationUnitRoot().HasReferenceDirectives; 147if (Options.Kind == SourceCodeKind.Script)
Syntax\SyntaxFactory.cs (2)
2321if (tree.Options.Kind != SourceCodeKind.Script) 2379if (tree.Options.Kind == SourceCodeKind.Regular ||
Syntax\SyntaxFacts.cs (1)
540return IsTopLevelStatement(syntax) && syntax.SyntaxTree.Options.Kind == SourceCodeKind.Regular;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (1)
411=> IsGlobalStatementContext && SyntaxTree.Options.Kind is SourceCodeKind.Regular;
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (4)
src\Analyzers\CSharp\Tests\DocumentationComments\AddDocCommentNodesCodeFixProviderTests.cs (1)
21private static readonly CSharpParseOptions Regular = new(kind: SourceCodeKind.Regular);
src\Analyzers\CSharp\Tests\DocumentationComments\RemoveDocCommentNodeCodeFixProviderTests.cs (1)
21private static readonly CSharpParseOptions Regular = new(kind: SourceCodeKind.Regular);
src\Analyzers\CSharp\Tests\GenerateMethod\GenerateMethodTests.cs (1)
5305new TestParameters(new CSharpParseOptions(kind: SourceCodeKind.Regular)));
src\Features\CSharpTest\Diagnostics\AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest_NoEditor.cs (1)
17private static readonly CSharpParseOptions Script = new(kind: SourceCodeKind.Script);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
Interactive\CSharpInteractiveEvaluatorLanguageInfoProvider.cs (1)
24new(languageVersion: LanguageVersion.Latest, kind: SourceCodeKind.Script);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (199)
Completion\CompletionProviders\AbstractCSharpCompletionProviderTests.cs (6)
54SourceCodeKind sourceCodeKind, bool usePreviousCharAsTrigger, char? deletedCharTrigger, bool checkForAbsence, 69SourceCodeKind sourceCodeKind, ItemExpectation[] expectedResults, 80SourceCodeKind sourceCodeKind, bool usePreviousCharAsTrigger, char? deletedCharTrigger, 106SourceCodeKind sourceCodeKind, bool checkForAbsence, Glyph? glyph, 125SourceCodeKind sourceCodeKind, bool checkForAbsence, Glyph? glyph, 140SourceCodeKind sourceCodeKind, bool checkForAbsence, Glyph? glyph,
Completion\CompletionProviders\ConversionCompletionProviderTests.cs (6)
43""", SourceCodeKind.Regular)).Single(); 88""", SourceCodeKind.Regular); 249", SourceCodeKind.Regular); 277""", SourceCodeKind.Regular); 453", SourceCodeKind.Regular); 514""", SourceCodeKind.Regular);
Completion\CompletionProviders\CrefCompletionProviderTests.cs (1)
29string expectedDescriptionOrNull, SourceCodeKind sourceCodeKind, bool usePreviousCharAsTrigger, char? deletedCharTrigger,
Completion\CompletionProviders\DeclarationNameCompletionProviderTests.cs (1)
1171var items = await GetCompletionItemsAsync(markup, SourceCodeKind.Regular);
Completion\CompletionProviders\DeclarationNameCompletionProviderTests_NameDeclarationInfoTests.cs (1)
812return (_fixture.UpdateDocument(text, SourceCodeKind.Regular), position);
Completion\CompletionProviders\ExtensionMethodImportCompletionProviderTests.cs (1)
1980await VerifyProviderCommitAsync(markup, "ToInt", expected, commitChar: commitChar, sourceCodeKind: SourceCodeKind.Regular);
Completion\CompletionProviders\KeywordCompletionProviderTests.cs (2)
123await VerifyNoItemsExistAsync(markup, SourceCodeKind.Script); 147await VerifyNoItemsExistAsync(markup, SourceCodeKind.Script);
Completion\CompletionProviders\LoadDirectiveCompletionProviderTests.cs (3)
33SourceCodeKind sourceCodeKind, bool usePreviousCharAsTrigger, char? deletedCharTrigger, bool checkForAbsence, 49await VerifyCommitCharactersAsync("#load \"$$", textTypedSoFar: "", validChars: commitCharacters, sourceCodeKind: SourceCodeKind.Script); 60=> VerifyTextualTriggerCharacter(markup, shouldTriggerWithTriggerOnLettersEnabled: true, shouldTriggerWithTriggerOnLettersDisabled: true, SourceCodeKind.Script);
Completion\CompletionProviders\OperatorCompletionProviderTests.cs (6)
88""", SourceCodeKind.Regular); 224""", SourceCodeKind.Regular); 271""", SourceCodeKind.Regular); 296""", SourceCodeKind.Regular); 350", SourceCodeKind.Regular); 500", SourceCodeKind.Regular);
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (4)
899await BaseVerifyWorkerAsync(code, position, "@class()", "void Base.@class()", SourceCodeKind.Regular, false, deletedCharTrigger: null, false, null, null, null, null, null, null); 900await BaseVerifyWorkerAsync(code, position, "@class()", "void Base.@class()", SourceCodeKind.Script, false, deletedCharTrigger: null, false, null, null, null, null, null, null); 919await BaseVerifyWorkerAsync(code, position, "@class", "int Base.@class { get; set; }", SourceCodeKind.Regular, false, deletedCharTrigger: null, false, null, null, null, null, null, null); 920await BaseVerifyWorkerAsync(code, position, "@class", "int Base.@class { get; set; }", SourceCodeKind.Script, false, deletedCharTrigger: null, false, null, null, null, null, null, null);
Completion\CompletionProviders\ReferenceDirectiveCompletionProviderTests.cs (6)
36SourceCodeKind sourceCodeKind, bool usePreviousCharAsTrigger, char? deletedCharTrigger, bool checkForAbsence, 52await VerifyCommitCharactersAsync("#r \"$$", textTypedSoFar: "", validChars: commitCharacters, sourceCodeKind: SourceCodeKind.Script); 63=> VerifyTextualTriggerCharacter(markup, shouldTriggerWithTriggerOnLettersEnabled: true, shouldTriggerWithTriggerOnLettersDisabled: true, SourceCodeKind.Script); 74=> await VerifyItemExistsAsync("#r \"$$", "System.Windows.Forms", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 81"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 98await VerifyItemExistsAsync(code, windowsFolderName, expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script);
Completion\CompletionProviders\SnippetCompletionProviderTests.cs (16)
37=> await VerifyItemExistsAsync(@"$$", MockSnippetInfoService.SnippetShortcut, sourceCodeKind: SourceCodeKind.Regular); 41=> await VerifyItemExistsAsync(@"$$", MockSnippetInfoService.SnippetShortcut, MockSnippetInfoService.SnippetTitle + Environment.NewLine + MockSnippetInfoService.SnippetDescription + Environment.NewLine + string.Format(FeaturesResources.Note_colon_Tab_twice_to_insert_the_0_snippet, MockSnippetInfoService.SnippetShortcut), SourceCodeKind.Regular); 45=> await VerifyItemExistsAsync(@"namespace NS { $$ }", MockSnippetInfoService.SnippetShortcut, sourceCodeKind: SourceCodeKind.Regular); 49=> await VerifyItemExistsAsync(@"namespace NS { class C { $$ } }", MockSnippetInfoService.SnippetShortcut, sourceCodeKind: SourceCodeKind.Regular); 53=> await VerifyItemExistsAsync(@"namespace NS { class C { void M() { $$ } } }", MockSnippetInfoService.SnippetShortcut, sourceCodeKind: SourceCodeKind.Regular); 57=> await VerifyItemIsAbsentAsync(@"namespace NS { class C { void M() { int $$ } } }", MockSnippetInfoService.SnippetShortcut, sourceCodeKind: SourceCodeKind.Regular); 61=> await VerifyItemIsAbsentAsync(@"namespace NS { enum E { $$ } }", MockSnippetInfoService.SnippetShortcut, sourceCodeKind: SourceCodeKind.Regular); 65=> await VerifyItemExistsAsync(@"namespace NS { class C { void M() { bool b = true && $$ } } }", MockSnippetInfoService.SnippetShortcut, sourceCodeKind: SourceCodeKind.Regular); 69=> await VerifyItemExistsAsync(@"#$$", MockSnippetInfoService.PreProcessorSnippetShortcut[1..], sourceCodeKind: SourceCodeKind.Regular); 73=> await VerifyItemIsAbsentAsync(@"#$$", MockSnippetInfoService.SnippetShortcut, sourceCodeKind: SourceCodeKind.Regular); 77=> await VerifyItemIsAbsentAsync(@"#region $$", MockSnippetInfoService.PreProcessorSnippetShortcut, sourceCodeKind: SourceCodeKind.Regular); 81=> await VerifyItemExistsAsync(@"#r$$", MockSnippetInfoService.PreProcessorSnippetShortcut[1..], sourceCodeKind: SourceCodeKind.Regular); 85=> await VerifyItemIsAbsentAsync(@"#line (1, 2) - (3, 4) $$", MockSnippetInfoService.PreProcessorSnippetShortcut, sourceCodeKind: SourceCodeKind.Regular); 127await VerifyItemIsAbsentAsync(@"#r f$$", MockSnippetInfoService.SnippetShortcut, sourceCodeKind: SourceCodeKind.Script); 128await VerifyItemIsAbsentAsync(@"#load f$$", MockSnippetInfoService.SnippetShortcut, sourceCodeKind: SourceCodeKind.Script); 129await VerifyItemIsAbsentAsync(@"#!$$", MockSnippetInfoService.SnippetShortcut, sourceCodeKind: SourceCodeKind.Script);
Completion\CompletionProviders\SpeculativeTCompletionProviderTests.cs (6)
827await VerifyItemExistsAsync(markup, "T", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 835await VerifyItemIsAbsentAsync(markup, "T", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 843await VerifyItemIsAbsentAsync(markup, "T", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 854await VerifyItemExistsAsync(markup, "T", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 865await VerifyItemExistsAsync(markup, "T", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 876await VerifyItemExistsAsync(markup, "T", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script);
Completion\CompletionProviders\SuggestionModeCompletionProviderTests.cs (2)
1511var document1 = workspaceFixture.UpdateDocument(code, SourceCodeKind.Regular); 1516var document2 = workspaceFixture.UpdateDocument(code, SourceCodeKind.Regular, cleanBeforeUpdate: false);
Completion\CompletionProviders\SymbolCompletionProviderTests.cs (69)
30[InlineData(SourceCodeKind.Regular)] 31[InlineData(SourceCodeKind.Script)] 32public async Task EmptyFile(SourceCodeKind sourceCodeKind) 39[InlineData(SourceCodeKind.Regular)] 40[InlineData(SourceCodeKind.Script)] 41public async Task EmptyFileWithUsing(SourceCodeKind sourceCodeKind) 55=> await VerifyItemIsAbsentAsync(@"#r $$", "@System", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 59=> await VerifyItemIsAbsentAsync(@"#load $$", "@System", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 327sourceCodeKind: SourceCodeKind.Script); 351sourceCodeKind: SourceCodeKind.Script); 469await VerifyItemExistsAsync(source, "System", sourceCodeKind: SourceCodeKind.Regular); 483await VerifyItemExistsAsync(source, "Runtime", sourceCodeKind: SourceCodeKind.Regular); 500sourceCodeKind: SourceCodeKind.Regular); 517sourceCodeKind: SourceCodeKind.Regular); 529await VerifyItemExistsAsync(source, "A", sourceCodeKind: SourceCodeKind.Regular); 542await VerifyNoItemsExistAsync(source, sourceCodeKind: SourceCodeKind.Regular); 562sourceCodeKind: SourceCodeKind.Regular); 570await VerifyItemIsAbsentAsync(source, "NS", sourceCodeKind: SourceCodeKind.Regular); 591sourceCodeKind: SourceCodeKind.Regular); 614sourceCodeKind: SourceCodeKind.Regular); 627sourceCodeKind: SourceCodeKind.Regular); 666SourceCodeKind.Regular); 674await VerifyNoItemsExistAsync(source, sourceCodeKind: SourceCodeKind.Regular); 686await VerifyItemExistsAsync(source, "B", sourceCodeKind: SourceCodeKind.Regular); 698await VerifyItemExistsAsync(source, "B", sourceCodeKind: SourceCodeKind.Regular); 719sourceCodeKind: SourceCodeKind.Regular); 737sourceCodeKind: SourceCodeKind.Regular); 757sourceCodeKind: SourceCodeKind.Regular); 770sourceCodeKind: SourceCodeKind.Regular); 778await VerifyItemExistsAsync(source, "System", sourceCodeKind: SourceCodeKind.Regular); 796sourceCodeKind: SourceCodeKind.Regular); 836SourceCodeKind.Regular); 2098await VerifyItemExistsAsync(prefix + "$$", "args", sourceCodeKind: SourceCodeKind.Regular); 2108await VerifyItemIsAbsentAsync(prefix + "$$", "args", sourceCodeKind: SourceCodeKind.Script); 2121""", "args", sourceCodeKind: SourceCodeKind.Regular); 2133""" + prefix + "$$", "args", sourceCodeKind: SourceCodeKind.Regular); 2148""", "args", sourceCodeKind: SourceCodeKind.Regular); 2158await VerifyItemExistsAsync("call(" + prefix + "$$)", "args", sourceCodeKind: SourceCodeKind.Regular); 2163=> await VerifyItemIsAbsentAsync(@"$$", "args", sourceCodeKind: SourceCodeKind.Regular); 2172""", "args", sourceCodeKind: SourceCodeKind.Regular); 2180""", "args", sourceCodeKind: SourceCodeKind.Regular); 2184=> await VerifyItemExistsAsync(@"string first = $$", "args", sourceCodeKind: SourceCodeKind.Regular); 3199await VerifyItemExistsAsync(markup, "Q", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Regular); 3200await VerifyItemIsAbsentAsync(markup, "R", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Regular); 3215await VerifyItemExistsAsync(markup, "Q", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 3216await VerifyItemIsAbsentAsync(markup, "R", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 3324await VerifyItemExistsAsync(markup, "String", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 3336await VerifyItemExistsAsync(markup, "ElementAt", displayTextSuffix: "<>", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 3397await VerifyItemIsAbsentAsync(markup, "Console", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 3839SourceCodeKind.Regular); 3856SourceCodeKind.Regular); 4517expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 4529expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 4541expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 4553expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 8130await VerifyItemExistsAsync(markup, "CommandLine", sourceCodeKind: SourceCodeKind.Script); 8498await VerifyItemExistsAsync(markup, "ForSchemaSet", displayTextSuffix: "<>", sourceCodeKind: SourceCodeKind.Regular); 8591=> await VerifyItemIsAbsentAsync(@"base.$$", @"ToString", sourceCodeKind: SourceCodeKind.Script); 9711await VerifyItemExistsAsync(markup, "Class1", displayTextSuffix: "<>", sourceCodeKind: SourceCodeKind.Regular); 9736await VerifyItemExistsAsync(markup, "Class1", displayTextSuffix: "<>", sourceCodeKind: SourceCodeKind.Regular); 10852await VerifyItemExistsAsync(markup, "aaa", sourceCodeKind: SourceCodeKind.Script); 10862await VerifyItemExistsAsync(markup, "aaa", sourceCodeKind: SourceCodeKind.Script); 10923await VerifyNoItemsExistAsync("#!$$", sourceCodeKind: SourceCodeKind.Script); 10924await VerifyNoItemsExistAsync("#! S$$", sourceCodeKind: SourceCodeKind.Script, usePreviousCharAsTrigger: true); 11925await VerifyItemExistsAsync(markup, "Length", sourceCodeKind: SourceCodeKind.Regular); 11944await VerifyItemExistsAsync(markup, "Length", sourceCodeKind: SourceCodeKind.Script); 13594await VerifyItemIsAbsentAsync(source, "System", sourceCodeKind: SourceCodeKind.Regular); 13999sourceCodeKind: SourceCodeKind.Regular); 15120sourceCodeKind: SourceCodeKind.Regular,
Completion\CompletionProviders\SymbolCompletionProviderTests_NoInteractive.cs (2)
32SourceCodeKind sourceCodeKind, bool usePreviousCharAsTrigger, char? deletedCharTrigger, bool checkForAbsence, 39SourceCodeKind.Regular, usePreviousCharAsTrigger, deletedCharTrigger, checkForAbsence,
Completion\CompletionProviders\TypeImportCompletionProviderTests.cs (41)
804[InlineData(SourceCodeKind.Regular)] 805[InlineData(SourceCodeKind.Script)] 807public async Task Commit_NoImport_InProject(SourceCodeKind kind) 839[InlineData(SourceCodeKind.Regular)] 840[InlineData(SourceCodeKind.Script)] 842public async Task Commit_TopLevelStatement_NoImport_InProject(SourceCodeKind kind) 864[InlineData(SourceCodeKind.Regular)] 865[InlineData(SourceCodeKind.Script)] 867public async Task Commit_TopLevelStatement_UnrelatedImport_InProject(SourceCodeKind kind) 892[InlineData(SourceCodeKind.Regular)] 893[InlineData(SourceCodeKind.Script)] 895public async Task Commit_NoImport_InVBReference(SourceCodeKind kind) 924[InlineData(SourceCodeKind.Regular)] 925[InlineData(SourceCodeKind.Script)] 927public async Task Commit_NoImport_InPEReference(SourceCodeKind kind) 1063[InlineData(SourceCodeKind.Regular)] 1064[InlineData(SourceCodeKind.Script)] 1067public async Task CommitAttributeTypeInAttributeNameContext(SourceCodeKind kind) 1122[InlineData(SourceCodeKind.Regular)] 1123[InlineData(SourceCodeKind.Script)] 1126public async Task CommitAttributeTypeInNonAttributeNameContext(SourceCodeKind kind) 1181[InlineData(SourceCodeKind.Regular)] 1182[InlineData(SourceCodeKind.Script)] 1185public async Task CommitAttributeTypeWithoutSuffixInAttributeNameContext(SourceCodeKind kind) 1240[InlineData(SourceCodeKind.Regular)] 1241[InlineData(SourceCodeKind.Script)] 1244public async Task CommitAttributeTypeWithoutSuffixInNonAttributeNameContext(SourceCodeKind kind) 1304[InlineData(SourceCodeKind.Regular)] 1305[InlineData(SourceCodeKind.Script)] 1308public async Task CommitTypeInUsingStaticContextShouldUseFullyQualifiedName(SourceCodeKind kind) 1326[InlineData(SourceCodeKind.Regular)] 1327[InlineData(SourceCodeKind.Script)] 1330public async Task CommitGenericTypeParameterInUsingAliasContextShouldUseFullyQualifiedName(SourceCodeKind kind) 1348[InlineData(SourceCodeKind.Regular)] 1349[InlineData(SourceCodeKind.Script)] 1352public async Task CommitGenericTypeParameterInUsingAliasContextShouldUseFullyQualifiedName2(SourceCodeKind kind) 1603await VerifyProviderCommitAsync(markup, "C", expected, commitChar: commitChar, sourceCodeKind: SourceCodeKind.Regular); 1648await VerifyProviderCommitAsync(markup, "C", expected, commitChar: commitChar, sourceCodeKind: SourceCodeKind.Regular); 1651[InlineData(SourceCodeKind.Regular)] 1652[InlineData(SourceCodeKind.Script)] 1655public async Task CommitInLocalFunctionContext(SourceCodeKind kind)
Completion\CompletionProviders\XmlDocumentationCommentCompletionProviderTests.cs (5)
44SourceCodeKind sourceCodeKind, bool usePreviousCharAsTrigger, char? deletedCharTrigger, bool checkForAbsence, 513""", "args", sourceCodeKind: SourceCodeKind.Regular); 527""", "args", sourceCodeKind: SourceCodeKind.Script); 539""", "str", sourceCodeKind: SourceCodeKind.Regular); 550""", "str", sourceCodeKind: SourceCodeKind.Script);
Debugging\LocationInfoGetterTests.cs (3)
529""", "f1", 0, new CSharpParseOptions(kind: SourceCodeKind.Script)); 540""", "M1(int x)", 2, new CSharpParseOptions(kind: SourceCodeKind.Script)); 549""", null, 0, new CSharpParseOptions(kind: SourceCodeKind.Script));
ExtractMethod\ExtractMethodTests.cs (1)
10551await TestExtractMethodAsync(code, expected, parseOptions: new CSharpParseOptions(kind: SourceCodeKind.Script));
ExtractMethod\ExtractMethodTests.LanguageInteraction.cs (1)
1388await TestExtractMethodAsync(code, expected, parseOptions: new CSharpParseOptions(kind: SourceCodeKind.Script));
Formatting\RazorLineFormattingOptionsTests.cs (1)
60sourceCodeKind: SourceCodeKind.Regular,
GoToAdjacentMember\CSharpGoToAdjacentMemberTests.cs (2)
533await AssertNavigatedAsync(code, next: true, sourceCodeKind: SourceCodeKind.Script); 545await AssertNavigatedAsync(code, next: false, sourceCodeKind: SourceCodeKind.Script);
SignatureHelp\GenericNamePartiallyWrittenSignatureHelpProviderTests.cs (2)
145await TestAsync(markup, expectedOrderedItems, usePreviousCharAsTrigger: false, sourceCodeKind: Microsoft.CodeAnalysis.SourceCodeKind.Regular); 337await TestAsync(markup, expectedOrderedItems, sourceCodeKind: SourceCodeKind.Regular);
SignatureHelp\GenericNameSignatureHelpProviderTests.cs (1)
643await TestAsync(markup, expectedOrderedItems, usePreviousCharAsTrigger: false, sourceCodeKind: Microsoft.CodeAnalysis.SourceCodeKind.Regular);
SignatureHelp\InitializerExpressionSignatureHelpProviderTests.cs (1)
194new($"({CSharpFeaturesResources.extension}) void Bar.Add(int i, string s, bool b)", currentParameterIndex: 0)], sourceCodeKind: SourceCodeKind.Regular);
SignatureHelp\InvocationExpressionSignatureHelpProviderTests.cs (4)
376await TestAsync(markup, [new SignatureHelpTestItem($"({CSharpFeaturesResources.extension}) int string.ExtensionMethod(int x)", string.Empty, string.Empty, currentParameterIndex: 0)], sourceCodeKind: SourceCodeKind.Regular); 1664new SignatureHelpTestItem($"({CSharpFeaturesResources.extension}) void IGoo.Bar<T1, T2>()", currentParameterIndex: 0)], sourceCodeKind: SourceCodeKind.Regular); 2673sourceCodeKind: SourceCodeKind.Regular); 2712sourceCodeKind: SourceCodeKind.Regular);
TypeInferrer\TypeInferrerTests.cs (2)
1421@"yield return [|abc|]", "global::System.Object", mode, sourceCodeKind: SourceCodeKind.Script); 1611@"return [|Goo()|];", "global::System.Object", mode, sourceCodeKind: SourceCodeKind.Script);
TypeInferrer\TypeInferrerTests.Delegate.cs (1)
26var document = workspaceFixture.Target.UpdateDocument(text, SourceCodeKind.Regular);
Workspaces\WorkspaceTests_EditorFeatures.cs (2)
213var document1 = new EditorTestHostDocument("var x = 1;", displayName: "Sub1", sourceCodeKind: SourceCodeKind.Script); 216var document2 = new EditorTestHostDocument("var x = 2;", displayName: "Sub2", sourceCodeKind: SourceCodeKind.Script, filePath: "a.csx");
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (731)
Recommendations\AbstractKeywordRecommenderTests.cs (9)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script, 209await VerifyAbsenceAsync(SourceCodeKind.Regular, 219await VerifyAbsenceAsync(SourceCodeKind.Script, 229await VerifyAbsenceAsync(SourceCodeKind.Regular, 239await VerifyAbsenceAsync(SourceCodeKind.Script, 331await VerifyKeywordAsync(SourceCodeKind.Regular, 338await VerifyKeywordAsync(SourceCodeKind.Regular,
Recommendations\AddKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\AliasKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\AnnotationsKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\AscendingKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\AsKeywordRecommenderTests.cs (4)
18await VerifyAbsenceAsync(SourceCodeKind.Script, 25await VerifyAbsenceAsync(SourceCodeKind.Script, 35await VerifyAbsenceAsync(SourceCodeKind.Script, 45await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\AssemblyKeywordRecommenderTests.cs (4)
18await VerifyAbsenceAsync(SourceCodeKind.Script, 25await VerifyAbsenceAsync(SourceCodeKind.Script, 35await VerifyAbsenceAsync(SourceCodeKind.Script, 45await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\AsyncKeywordRecommenderTests.cs (2)
74await VerifyKeywordAsync(SourceCodeKind.Script, text); 81await VerifyKeywordAsync(SourceCodeKind.Script, text);
Recommendations\BaseKeywordRecommenderTests.cs (4)
19await VerifyAbsenceAsync(SourceCodeKind.Script, 26await VerifyAbsenceAsync(SourceCodeKind.Script, 38await VerifyAbsenceAsync(SourceCodeKind.Script, 134SourceCodeKind.Regular,
Recommendations\BoolKeywordRecommenderTests.cs (1)
25await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\BreakKeywordRecommenderTests.cs (1)
24await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\ByKeywordRecommenderTests.cs (1)
24await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\ByteKeywordRecommenderTests.cs (1)
25await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\CaseKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\CatchKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\CharKeywordRecommenderTests.cs (3)
17await VerifyKeywordAsync(SourceCodeKind.Script, 24await VerifyKeywordAsync(SourceCodeKind.Script, 44await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\CheckedKeywordRecommenderTests.cs (3)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\ChecksumKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\ClassKeywordRecommenderTests.cs (11)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script, 209await VerifyAbsenceAsync(SourceCodeKind.Regular, 219await VerifyAbsenceAsync(SourceCodeKind.Script, 229await VerifyAbsenceAsync(SourceCodeKind.Regular, 239await VerifyAbsenceAsync(SourceCodeKind.Script, 355await VerifyKeywordAsync(SourceCodeKind.Regular, 409await VerifyAbsenceAsync(SourceCodeKind.Regular, 421await VerifyAbsenceAsync(SourceCodeKind.Regular, 433await VerifyAbsenceAsync(SourceCodeKind.Regular,
Recommendations\ConstKeywordRecommenderTests.cs (14)
151[InlineData(SourceCodeKind.Regular)] 152[InlineData(SourceCodeKind.Script, Skip = "https://github.com/dotnet/roslyn/issues/9880")] 153public async Task TestNotBeforeUsing(SourceCodeKind sourceCodeKind) 163[InlineData(SourceCodeKind.Regular)] 164[InlineData(SourceCodeKind.Script, Skip = "https://github.com/dotnet/roslyn/issues/9880")] 165public async Task TestNotBeforeGlobalUsing(SourceCodeKind sourceCodeKind) 186await VerifyKeywordAsync(SourceCodeKind.Regular, """ 195await VerifyKeywordAsync(SourceCodeKind.Script, """ 260=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"internal $$"); 264=> await VerifyKeywordAsync(SourceCodeKind.Script, @"internal $$"); 278=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"public $$"); 282=> await VerifyKeywordAsync(SourceCodeKind.Script, @"public $$"); 297await VerifyAbsenceAsync(SourceCodeKind.Regular, 304await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\ContinueKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\DecimalKeywordRecommenderTests.cs (3)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\DefaultKeywordRecommenderTests.cs (3)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\DefineKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\DelegateKeywordRecommenderTests.cs (13)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script, 213await VerifyAbsenceAsync(SourceCodeKind.Regular, 223await VerifyAbsenceAsync(SourceCodeKind.Script, 233await VerifyAbsenceAsync(SourceCodeKind.Regular, 243await VerifyAbsenceAsync(SourceCodeKind.Script, 353await VerifyKeywordAsync(SourceCodeKind.Regular, @"static $$"); 354await VerifyKeywordAsync(SourceCodeKind.Script, @"static $$"); 361await VerifyKeywordAsync(SourceCodeKind.Regular, AddInsideMethod(@$"{keyword} $$")); 362await VerifyKeywordAsync(SourceCodeKind.Script, AddInsideMethod(@$"{keyword} $$")); 368await VerifyAbsenceAsync(SourceCodeKind.Regular, @"static public $$"); 369await VerifyKeywordAsync(SourceCodeKind.Script, @"static public $$");
Recommendations\DescendingKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\DisableKeywordRecommenderTests.cs (4)
32await VerifyAbsenceAsync(SourceCodeKind.Script, 39await VerifyAbsenceAsync(SourceCodeKind.Script, 49await VerifyAbsenceAsync(SourceCodeKind.Script, 59await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\DoKeywordRecommenderTests.cs (3)
17await VerifyKeywordAsync(SourceCodeKind.Script, 24await VerifyKeywordAsync(SourceCodeKind.Script, 44await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\DoubleKeywordRecommenderTests.cs (3)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\DynamicKeywordRecommenderTests.cs (3)
29await VerifyKeywordAsync(SourceCodeKind.Script, 36await VerifyKeywordAsync(SourceCodeKind.Script, 56await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\ElifKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\ElseKeywordRecommenderTests.cs (4)
18await VerifyAbsenceAsync(SourceCodeKind.Script, 25await VerifyAbsenceAsync(SourceCodeKind.Script, 35await VerifyAbsenceAsync(SourceCodeKind.Script, 45await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\EnableKeywordRecommenderTests.cs (4)
35=> await VerifyAbsenceAsync(SourceCodeKind.Script, @"$$"); 40await VerifyAbsenceAsync(SourceCodeKind.Script, 50await VerifyAbsenceAsync(SourceCodeKind.Script, 60await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\EndIfKeywordRecommenderTests.cs (4)
18await VerifyAbsenceAsync(SourceCodeKind.Script, 25await VerifyAbsenceAsync(SourceCodeKind.Script, 35await VerifyAbsenceAsync(SourceCodeKind.Script, 45await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\EndRegionKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\EnumKeywordRecommenderTests.cs (7)
17await VerifyKeywordAsync(SourceCodeKind.Script, 24await VerifyKeywordAsync(SourceCodeKind.Script, 44await VerifyKeywordAsync(SourceCodeKind.Script, 175await VerifyAbsenceAsync(SourceCodeKind.Regular, 185await VerifyAbsenceAsync(SourceCodeKind.Script, 195await VerifyAbsenceAsync(SourceCodeKind.Regular, 205await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\EqualsKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\ErrorKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\EventKeywordRecommenderTests.cs (32)
19await VerifyKeywordAsync(SourceCodeKind.Script, 26await VerifyKeywordAsync(SourceCodeKind.Script, 36await VerifyKeywordAsync(SourceCodeKind.Script, 46await VerifyKeywordAsync(SourceCodeKind.Script, 76=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"$$"); 81await VerifyAbsenceAsync(SourceCodeKind.Regular, """ 90await VerifyKeywordAsync(SourceCodeKind.Script, """ 99await VerifyAbsenceAsync(SourceCodeKind.Regular, """ 108await VerifyKeywordAsync(SourceCodeKind.Script, """ 117await VerifyAbsenceAsync(SourceCodeKind.Regular, """ 126await VerifyKeywordAsync(SourceCodeKind.Script, """ 135await VerifyAbsenceAsync(SourceCodeKind.Regular, """ 144await VerifyAbsenceAsync(SourceCodeKind.Regular, """ 153await VerifyAbsenceAsync(SourceCodeKind.Regular, """ 195await VerifyAbsenceAsync(SourceCodeKind.Regular, 205await VerifyAbsenceAsync(SourceCodeKind.Script, 215await VerifyAbsenceAsync(SourceCodeKind.Regular, 225await VerifyAbsenceAsync(SourceCodeKind.Script, 235await VerifyAbsenceAsync(SourceCodeKind.Regular, """ 244await VerifyKeywordAsync(SourceCodeKind.Script, """ 253await VerifyAbsenceAsync(SourceCodeKind.Regular, """ 262await VerifyKeywordAsync(SourceCodeKind.Script, """ 342=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"internal $$"); 346=> await VerifyKeywordAsync(SourceCodeKind.Script, @"internal $$"); 360=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"public $$"); 364=> await VerifyKeywordAsync(SourceCodeKind.Script, @"public $$"); 379await VerifyAbsenceAsync(SourceCodeKind.Regular, 386await VerifyKeywordAsync(SourceCodeKind.Script, 443=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"static $$"); 447=> await VerifyKeywordAsync(SourceCodeKind.Script, @"static $$"); 461=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"static public $$"); 465=> await VerifyKeywordAsync(SourceCodeKind.Script, @"static public $$");
Recommendations\ExplicitKeywordRecommenderTests.cs (4)
18await VerifyAbsenceAsync(SourceCodeKind.Script, 25await VerifyAbsenceAsync(SourceCodeKind.Script, 35await VerifyAbsenceAsync(SourceCodeKind.Script, 45await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\FalseKeywordRecommenderTests.cs (3)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\FieldKeywordRecommenderTests.cs (4)
19await VerifyAbsenceAsync(SourceCodeKind.Script, 26await VerifyAbsenceAsync(SourceCodeKind.Script, 36await VerifyAbsenceAsync(SourceCodeKind.Script, 46await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\FinallyKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\FixedKeywordRecommenderTests.cs (4)
18await VerifyAbsenceAsync(SourceCodeKind.Script, 25await VerifyAbsenceAsync(SourceCodeKind.Script, 35await VerifyAbsenceAsync(SourceCodeKind.Script, 45await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\FloatKeywordRecommenderTests.cs (3)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\ForEachKeywordRecommenderTests.cs (3)
17await VerifyKeywordAsync(SourceCodeKind.Script, 31await VerifyKeywordAsync(SourceCodeKind.Script, 61await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\ForKeywordRecommenderTests.cs (3)
17await VerifyKeywordAsync(SourceCodeKind.Script, 24await VerifyKeywordAsync(SourceCodeKind.Script, 44await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\FromKeywordRecommenderTests.cs (3)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\GetKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\GlobalKeywordRecommenderTests.cs (2)
287await VerifyAbsenceAsync(SourceCodeKind.Regular, 297await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\GotoKeywordRecommenderTests.cs (3)
17await VerifyKeywordAsync(SourceCodeKind.Script, 24await VerifyKeywordAsync(SourceCodeKind.Script, 44await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\GroupKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\HiddenKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\IfKeywordRecommenderTests.cs (3)
17await VerifyKeywordAsync(SourceCodeKind.Script, 24await VerifyKeywordAsync(SourceCodeKind.Script, 44await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\ImplicitKeywordRecommenderTests.cs (4)
18await VerifyAbsenceAsync(SourceCodeKind.Script, 25await VerifyAbsenceAsync(SourceCodeKind.Script, 35await VerifyAbsenceAsync(SourceCodeKind.Script, 45await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\InitKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\InKeywordRecommenderTests.cs (5)
18await VerifyAbsenceAsync(SourceCodeKind.Script, 25await VerifyAbsenceAsync(SourceCodeKind.Script, 35await VerifyAbsenceAsync(SourceCodeKind.Script, 45await VerifyAbsenceAsync(SourceCodeKind.Script, 437await VerifyAbsenceAsync(SourceCodeKind.Script, """
Recommendations\InterfaceKeywordRecommenderTests.cs (7)
17await VerifyKeywordAsync(SourceCodeKind.Script, 24await VerifyKeywordAsync(SourceCodeKind.Script, 44await VerifyKeywordAsync(SourceCodeKind.Script, 185await VerifyAbsenceAsync(SourceCodeKind.Regular, 195await VerifyAbsenceAsync(SourceCodeKind.Script, 205await VerifyAbsenceAsync(SourceCodeKind.Regular, 215await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\InternalKeywordRecommenderTests.cs (7)
17await VerifyKeywordAsync(SourceCodeKind.Script, 24await VerifyKeywordAsync(SourceCodeKind.Script, 44await VerifyKeywordAsync(SourceCodeKind.Script, 185await VerifyAbsenceAsync(SourceCodeKind.Regular, 195await VerifyAbsenceAsync(SourceCodeKind.Script, 205await VerifyAbsenceAsync(SourceCodeKind.Regular, 215await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\IntKeywordRecommenderTests.cs (6)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script, 55await VerifyKeywordAsync(SourceCodeKind.Script, 62await VerifyKeywordAsync(SourceCodeKind.Script, 801await VerifyKeywordAsync(SourceCodeKind.Script, """
Recommendations\IntoKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\IsKeywordRecommenderTests.cs (4)
18await VerifyAbsenceAsync(SourceCodeKind.Script, 25await VerifyAbsenceAsync(SourceCodeKind.Script, 35await VerifyAbsenceAsync(SourceCodeKind.Script, 45await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\JoinKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\LetKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\LineKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\LockKeywordRecommenderTests.cs (3)
17await VerifyKeywordAsync(SourceCodeKind.Script, 24await VerifyKeywordAsync(SourceCodeKind.Script, 44await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\LongKeywordRecommenderTests.cs (3)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\MethodKeywordRecommenderTests.cs (4)
18await VerifyAbsenceAsync(SourceCodeKind.Script, 25await VerifyAbsenceAsync(SourceCodeKind.Script, 35await VerifyAbsenceAsync(SourceCodeKind.Script, 45await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\ModuleKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\NameOfKeywordRecommenderTests.cs (3)
22await VerifyKeywordAsync(SourceCodeKind.Script, 29await VerifyKeywordAsync(SourceCodeKind.Script, 49await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\NamespaceKeywordRecommenderTests.cs (36)
31await VerifyAbsenceAsync(SourceCodeKind.Script, 41await VerifyAbsenceAsync(SourceCodeKind.Script, 51await VerifyAbsenceAsync(SourceCodeKind.Script, 68await VerifyKeywordAsync(SourceCodeKind.Regular, 75await VerifyAbsenceAsync(SourceCodeKind.Script, 86await VerifyKeywordAsync(SourceCodeKind.Regular, 96await VerifyAbsenceAsync(SourceCodeKind.Regular, 106await VerifyAbsenceAsync(SourceCodeKind.Regular, 117await VerifyKeywordAsync(SourceCodeKind.Regular, 130await VerifyAbsenceAsync(SourceCodeKind.Script, 140await VerifyKeywordAsync(SourceCodeKind.Regular, 150await VerifyAbsenceAsync(SourceCodeKind.Script, 160await VerifyAbsenceAsync(SourceCodeKind.Regular, 171await VerifyKeywordAsync(SourceCodeKind.Regular, 184await VerifyKeywordAsync(SourceCodeKind.Regular, 194await VerifyKeywordAsync(SourceCodeKind.Regular, 204await VerifyAbsenceAsync(SourceCodeKind.Script, 214await VerifyAbsenceAsync(SourceCodeKind.Script, 224await VerifyKeywordAsync(SourceCodeKind.Regular, 234await VerifyAbsenceAsync(SourceCodeKind.Script, 244await VerifyKeywordAsync(SourceCodeKind.Regular, 254await VerifyAbsenceAsync(SourceCodeKind.Script, 264await VerifyKeywordAsync(SourceCodeKind.Regular, 274await VerifyAbsenceAsync(SourceCodeKind.Script, 284await VerifyKeywordAsync(SourceCodeKind.Regular, 294await VerifyAbsenceAsync(SourceCodeKind.Script, 325await VerifyKeywordAsync(SourceCodeKind.Regular, 335await VerifyAbsenceAsync(SourceCodeKind.Script, 354await VerifyKeywordAsync(SourceCodeKind.Regular, 365await VerifyAbsenceAsync(SourceCodeKind.Script, 386await VerifyKeywordAsync(SourceCodeKind.Regular, 397await VerifyAbsenceAsync(SourceCodeKind.Script, 479await VerifyKeywordAsync(SourceCodeKind.Regular, 489await VerifyAbsenceAsync(SourceCodeKind.Script, 520await VerifyKeywordAsync(SourceCodeKind.Regular, 535await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\NewKeywordRecommenderTests.cs (18)
729await VerifyAbsenceAsync(SourceCodeKind.Regular, 739await VerifyAbsenceAsync(SourceCodeKind.Script, 749await VerifyAbsenceAsync(SourceCodeKind.Regular, 759await VerifyAbsenceAsync(SourceCodeKind.Script, 778await VerifyKeywordAsync(SourceCodeKind.Regular, """ 788await VerifyKeywordAsync(SourceCodeKind.Script, """ 845=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"internal $$"); 849=> await VerifyKeywordAsync(SourceCodeKind.Script, @"internal $$"); 853=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"public $$"); 857=> await VerifyKeywordAsync(SourceCodeKind.Script, @"public $$"); 861=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"static internal $$"); 865=> await VerifyKeywordAsync(SourceCodeKind.Script, @"static internal $$"); 869=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"internal static $$"); 873=> await VerifyKeywordAsync(SourceCodeKind.Script, @"internal static $$"); 886await VerifyAbsenceAsync(SourceCodeKind.Regular, 893await VerifyKeywordAsync(SourceCodeKind.Script, 903=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"static $$"); 907=> await VerifyKeywordAsync(SourceCodeKind.Script, @"static $$");
Recommendations\NotnullKeywordRecommenderTests.cs (1)
28await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\NullableKeywordRecommenderTests.cs (4)
18await VerifyAbsenceAsync(SourceCodeKind.Script, 25await VerifyAbsenceAsync(SourceCodeKind.Script, 35await VerifyAbsenceAsync(SourceCodeKind.Script, 45await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\NullKeywordRecommenderTests.cs (3)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\ObjectKeywordRecommenderTests.cs (3)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\OnKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\OperatorKeywordRecommenderTests.cs (4)
18await VerifyAbsenceAsync(SourceCodeKind.Script, 25await VerifyAbsenceAsync(SourceCodeKind.Script, 35await VerifyAbsenceAsync(SourceCodeKind.Script, 45await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\OrderByKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\OutKeywordRecommenderTests.cs (4)
18await VerifyAbsenceAsync(SourceCodeKind.Script, 25await VerifyAbsenceAsync(SourceCodeKind.Script, 35await VerifyAbsenceAsync(SourceCodeKind.Script, 45await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\OverrideKeywordRecommenderTests.cs (9)
18await VerifyAbsenceAsync(SourceCodeKind.Script, 25await VerifyAbsenceAsync(SourceCodeKind.Script, 35await VerifyAbsenceAsync(SourceCodeKind.Script, 45await VerifyAbsenceAsync(SourceCodeKind.Script, 75=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"$$"); 178await VerifyAbsenceAsync(SourceCodeKind.Regular, 188await VerifyAbsenceAsync(SourceCodeKind.Script, 198await VerifyAbsenceAsync(SourceCodeKind.Regular, 208await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\ParamKeywordRecommenderTests.cs (4)
26await VerifyAbsenceAsync(SourceCodeKind.Script, 33await VerifyAbsenceAsync(SourceCodeKind.Script, 43await VerifyAbsenceAsync(SourceCodeKind.Script, 53await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\ParamsKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\PartialKeywordRecommenderTests.cs (10)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script, 197await VerifyAbsenceAsync(SourceCodeKind.Regular, 207await VerifyAbsenceAsync(SourceCodeKind.Script, 217await VerifyAbsenceAsync(SourceCodeKind.Regular, 227await VerifyAbsenceAsync(SourceCodeKind.Script, 402await VerifyAbsenceAsync(SourceCodeKind.Regular, 414await VerifyAbsenceAsync(SourceCodeKind.Regular, 426await VerifyAbsenceAsync(SourceCodeKind.Regular,
Recommendations\PragmaKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\PrivateKeywordRecommenderTests.cs (25)
17await VerifyKeywordAsync(SourceCodeKind.Script, 24await VerifyKeywordAsync(SourceCodeKind.Script, 34await VerifyKeywordAsync(SourceCodeKind.Script, 44await VerifyKeywordAsync(SourceCodeKind.Script, 74=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"$$"); 79await VerifyAbsenceAsync(SourceCodeKind.Regular, """ 88await VerifyKeywordAsync(SourceCodeKind.Script, """ 97await VerifyAbsenceAsync(SourceCodeKind.Regular, """ 106await VerifyKeywordAsync(SourceCodeKind.Script, """ 115await VerifyAbsenceAsync(SourceCodeKind.Regular, """ 124await VerifyKeywordAsync(SourceCodeKind.Script, """ 133await VerifyAbsenceAsync(SourceCodeKind.Regular, """ 142await VerifyAbsenceAsync(SourceCodeKind.Regular, 152await VerifyAbsenceAsync(SourceCodeKind.Regular, """ 161await VerifyAbsenceAsync(SourceCodeKind.Regular, """ 203await VerifyAbsenceAsync(SourceCodeKind.Regular, """ 212await VerifyAbsenceAsync(SourceCodeKind.Script, """ 221await VerifyAbsenceAsync(SourceCodeKind.Regular, 231await VerifyAbsenceAsync(SourceCodeKind.Script, 241await VerifyAbsenceAsync(SourceCodeKind.Regular, """ 250await VerifyKeywordAsync(SourceCodeKind.Script, """ 259await VerifyAbsenceAsync(SourceCodeKind.Regular, """ 268await VerifyKeywordAsync(SourceCodeKind.Script, """ 382=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"static $$"); 386=> await VerifyKeywordAsync(SourceCodeKind.Script, @"static $$");
Recommendations\PropertyKeywordRecommenderTests.cs (4)
18await VerifyAbsenceAsync(SourceCodeKind.Script, 25await VerifyAbsenceAsync(SourceCodeKind.Script, 35await VerifyAbsenceAsync(SourceCodeKind.Script, 45await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\ProtectedKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\PublicKeywordRecommenderTests.cs (10)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script, 186await VerifyAbsenceAsync(SourceCodeKind.Regular, 196await VerifyAbsenceAsync(SourceCodeKind.Script, 206await VerifyAbsenceAsync(SourceCodeKind.Regular, 216await VerifyAbsenceAsync(SourceCodeKind.Script, 364await VerifyAbsenceAsync(SourceCodeKind.Regular, 376await VerifyAbsenceAsync(SourceCodeKind.Regular, 388await VerifyAbsenceAsync(SourceCodeKind.Regular,
Recommendations\ReadOnlyKeywordRecommenderTests.cs (6)
196await VerifyAbsenceAsync(SourceCodeKind.Regular, 206await VerifyAbsenceAsync(SourceCodeKind.Script, 216await VerifyAbsenceAsync(SourceCodeKind.Regular, 226await VerifyAbsenceAsync(SourceCodeKind.Script, 328=> await VerifyKeywordAsync(SourceCodeKind.Regular, @"file $$"); 690@"ref int x = ref $$", topLevelStatement: true), options: CSharp9ParseOptions.WithKind(SourceCodeKind.Script));
Recommendations\RecommenderTests.cs (6)
175protected async Task VerifyKeywordAsync(SourceCodeKind kind, string text) 179case SourceCodeKind.Regular: 183case SourceCodeKind.Script: 200SourceCodeKind kind, 205case SourceCodeKind.Regular: 208case SourceCodeKind.Script:
Recommendations\RecordKeywordRecommenderTests.cs (11)
19await VerifyKeywordAsync(SourceCodeKind.Script, 26await VerifyKeywordAsync(SourceCodeKind.Script, 46await VerifyKeywordAsync(SourceCodeKind.Script, 210await VerifyAbsenceAsync(SourceCodeKind.Regular, 220await VerifyAbsenceAsync(SourceCodeKind.Script, 230await VerifyAbsenceAsync(SourceCodeKind.Regular, 240await VerifyAbsenceAsync(SourceCodeKind.Script, 368await VerifyKeywordAsync(SourceCodeKind.Regular, 454await VerifyAbsenceAsync(SourceCodeKind.Regular, 466await VerifyAbsenceAsync(SourceCodeKind.Regular, 478await VerifyAbsenceAsync(SourceCodeKind.Regular,
Recommendations\ReferenceKeywordRecommenderTests.cs (9)
75await VerifyAbsenceAsync(SourceCodeKind.Regular, 82await VerifyKeywordAsync(SourceCodeKind.Script, 89await VerifyAbsenceAsync(SourceCodeKind.Regular, 96await VerifyKeywordAsync(SourceCodeKind.Script, 103await VerifyKeywordAsync(SourceCodeKind.Script, 114await VerifyKeywordAsync(SourceCodeKind.Script, 124await VerifyKeywordAsync(SourceCodeKind.Script, 134await VerifyAbsenceAsync(SourceCodeKind.Script, 144await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\RefKeywordRecommenderTests.cs (13)
603=> await VerifyKeywordAsync(SourceCodeKind.Regular, @"file $$"); 855[InlineData(SourceCodeKind.Regular, true)] 856[InlineData(SourceCodeKind.Regular, false)] 857[InlineData(SourceCodeKind.Script, true, Skip = "https://github.com/dotnet/roslyn/issues/44630")] 858[InlineData(SourceCodeKind.Script, false)] 859public async Task TestInConditionalExpressionTrueBranch(SourceCodeKind sourceCodeKind, bool topLevelStatement) 866options: sourceCodeKind == SourceCodeKind.Script ? Options.Script : CSharp9ParseOptions); 870[InlineData(SourceCodeKind.Regular, true)] 871[InlineData(SourceCodeKind.Regular, false)] 872[InlineData(SourceCodeKind.Script, true, Skip = "https://github.com/dotnet/roslyn/issues/44630")] 873[InlineData(SourceCodeKind.Script, false)] 874public async Task TestInConditionalExpressionFalseBranch(SourceCodeKind sourceCodeKind, bool topLevelStatement) 882options: sourceCodeKind == SourceCodeKind.Script ? Options.Script : CSharp9ParseOptions);
Recommendations\RegionKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\RemoveKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\RestoreKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\ReturnKeywordRecommenderTests.cs (10)
18await VerifyAbsenceAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Regular, 32await VerifyAbsenceAsync(SourceCodeKind.Script, 42await VerifyKeywordAsync(SourceCodeKind.Regular, 52await VerifyAbsenceAsync(SourceCodeKind.Script, 62await VerifyKeywordAsync(SourceCodeKind.Regular, 72await VerifyAbsenceAsync(SourceCodeKind.Script, 82await VerifyKeywordAsync(SourceCodeKind.Regular, 287await VerifyAbsenceAsync(SourceCodeKind.Regular, 294await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\SByteKeywordRecommenderTests.cs (3)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\ScopedKeywordRecommenderTests.cs (3)
26await VerifyKeywordAsync(SourceCodeKind.Script, 33await VerifyKeywordAsync(SourceCodeKind.Script, 53await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\SealedKeywordRecommenderTests.cs (8)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script, 209await VerifyAbsenceAsync(SourceCodeKind.Regular, 219await VerifyAbsenceAsync(SourceCodeKind.Script, 229await VerifyAbsenceAsync(SourceCodeKind.Regular, 239await VerifyAbsenceAsync(SourceCodeKind.Script, 331await VerifyKeywordAsync(SourceCodeKind.Regular,
Recommendations\SelectKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\SetKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\ShortKeywordRecommenderTests.cs (3)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\SizeOfKeywordRecommenderTests.cs (3)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\StackAllocKeywordRecommenderTests.cs (3)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\StaticKeywordRecommenderTests.cs (8)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script, 209await VerifyAbsenceAsync(SourceCodeKind.Regular, 219await VerifyAbsenceAsync(SourceCodeKind.Script, 229await VerifyAbsenceAsync(SourceCodeKind.Regular, 239await VerifyAbsenceAsync(SourceCodeKind.Script, 332await VerifyKeywordAsync(SourceCodeKind.Regular,
Recommendations\StringKeywordRecommenderTests.cs (3)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\StructKeywordRecommenderTests.cs (17)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script, 209await VerifyAbsenceAsync(SourceCodeKind.Regular, 219await VerifyAbsenceAsync(SourceCodeKind.Regular, 229await VerifyKeywordAsync(SourceCodeKind.Regular, 236await VerifyKeywordAsync(SourceCodeKind.Regular, 243await VerifyKeywordAsync(SourceCodeKind.Regular, 250await VerifyKeywordAsync(SourceCodeKind.Regular, 257await VerifyKeywordAsync(SourceCodeKind.Regular, 264await VerifyKeywordAsync(SourceCodeKind.Regular, 271await VerifyAbsenceAsync(SourceCodeKind.Regular, 278await VerifyAbsenceAsync(SourceCodeKind.Regular, 285await VerifyAbsenceAsync(SourceCodeKind.Script, 295await VerifyAbsenceAsync(SourceCodeKind.Script, 390await VerifyKeywordAsync(SourceCodeKind.Regular, 411await VerifyKeywordAsync(SourceCodeKind.Regular,
Recommendations\SwitchKeywordRecommenderTests.cs (3)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\ThisKeywordRecommenderTests.cs (4)
18await VerifyAbsenceAsync(SourceCodeKind.Script, 25await VerifyAbsenceAsync(SourceCodeKind.Script, 35await VerifyAbsenceAsync(SourceCodeKind.Script, 45await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\ThrowKeywordRecommenderTests.cs (3)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\TrueKeywordRecommenderTests.cs (3)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\TryKeywordRecommenderTests.cs (3)
17await VerifyKeywordAsync(SourceCodeKind.Script, 24await VerifyKeywordAsync(SourceCodeKind.Script, 44await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\TypeKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\TypeOfKeywordRecommenderTests.cs (3)
22await VerifyKeywordAsync(SourceCodeKind.Script, 29await VerifyKeywordAsync(SourceCodeKind.Script, 49await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\TypeVarKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\UIntKeywordRecommenderTests.cs (3)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\ULongKeywordRecommenderTests.cs (3)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\UncheckedKeywordRecommenderTests.cs (3)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\UndefKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\UnmanagedKeywordRecommenderTests.cs (1)
17await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\UnsafeKeywordRecommenderTests.cs (8)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script, 209await VerifyAbsenceAsync(SourceCodeKind.Regular, 219await VerifyAbsenceAsync(SourceCodeKind.Script, 229await VerifyAbsenceAsync(SourceCodeKind.Regular, 239await VerifyAbsenceAsync(SourceCodeKind.Script, 348await VerifyKeywordAsync(SourceCodeKind.Regular,
Recommendations\UShortKeywordRecommenderTests.cs (3)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\UsingKeywordRecommenderTests.cs (5)
51await VerifyKeywordAsync(SourceCodeKind.Script, 293await VerifyAbsenceAsync(SourceCodeKind.Regular, 303await VerifyAbsenceAsync(SourceCodeKind.Script, 313await VerifyAbsenceAsync(SourceCodeKind.Regular, 323await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\VarKeywordRecommenderTests.cs (3)
29await VerifyKeywordAsync(SourceCodeKind.Script, 36await VerifyKeywordAsync(SourceCodeKind.Script, 56await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\VirtualKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\VoidKeywordRecommenderTests.cs (13)
45await VerifyKeywordAsync(SourceCodeKind.Script, 192await VerifyAbsenceAsync(SourceCodeKind.Regular, 202await VerifyAbsenceAsync(SourceCodeKind.Script, 212await VerifyAbsenceAsync(SourceCodeKind.Regular, 222await VerifyAbsenceAsync(SourceCodeKind.Script, 327=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"internal $$"); 331=> await VerifyKeywordAsync(SourceCodeKind.Script, @"internal $$"); 345=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"public $$"); 349=> await VerifyKeywordAsync(SourceCodeKind.Script, @"public $$"); 364await VerifyAbsenceAsync(SourceCodeKind.Regular, 371await VerifyKeywordAsync(SourceCodeKind.Script, 432=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"static public $$"); 436=> await VerifyKeywordAsync(SourceCodeKind.Script, @"static public $$");
Recommendations\VolatileKeywordRecommenderTests.cs (32)
17await VerifyKeywordAsync(SourceCodeKind.Script, 24await VerifyKeywordAsync(SourceCodeKind.Script, 34await VerifyKeywordAsync(SourceCodeKind.Script, 44await VerifyKeywordAsync(SourceCodeKind.Script, 74=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"$$"); 79await VerifyAbsenceAsync(SourceCodeKind.Regular, """ 88await VerifyKeywordAsync(SourceCodeKind.Script, """ 97await VerifyAbsenceAsync(SourceCodeKind.Regular, """ 106await VerifyKeywordAsync(SourceCodeKind.Script, """ 115await VerifyAbsenceAsync(SourceCodeKind.Regular, """ 124await VerifyKeywordAsync(SourceCodeKind.Script, """ 133await VerifyAbsenceAsync(SourceCodeKind.Regular, """ 142await VerifyAbsenceAsync(SourceCodeKind.Regular, """ 151await VerifyAbsenceAsync(SourceCodeKind.Regular, """ 193await VerifyAbsenceAsync(SourceCodeKind.Regular, 203await VerifyAbsenceAsync(SourceCodeKind.Script, 213await VerifyAbsenceAsync(SourceCodeKind.Regular, 223await VerifyAbsenceAsync(SourceCodeKind.Script, 233await VerifyAbsenceAsync(SourceCodeKind.Regular, """ 242await VerifyKeywordAsync(SourceCodeKind.Script, """ 251await VerifyAbsenceAsync(SourceCodeKind.Regular, """ 260await VerifyKeywordAsync(SourceCodeKind.Script, """ 325=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"internal $$"); 329=> await VerifyKeywordAsync(SourceCodeKind.Script, @"internal $$"); 343=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"public $$"); 347=> await VerifyKeywordAsync(SourceCodeKind.Script, @"public $$"); 362await VerifyAbsenceAsync(SourceCodeKind.Regular, 369await VerifyKeywordAsync(SourceCodeKind.Script, 416=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"static $$"); 420=> await VerifyKeywordAsync(SourceCodeKind.Script, @"static $$"); 434=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"static public $$"); 438=> await VerifyKeywordAsync(SourceCodeKind.Script, @"static public $$");
Recommendations\WarningKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\WarningsKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\WhereKeywordRecommenderTests.cs (4)
18await VerifyAbsenceAsync(SourceCodeKind.Script, 25await VerifyAbsenceAsync(SourceCodeKind.Script, 35await VerifyAbsenceAsync(SourceCodeKind.Script, 45await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\WhileKeywordRecommenderTests.cs (3)
17await VerifyKeywordAsync(SourceCodeKind.Script, 24await VerifyKeywordAsync(SourceCodeKind.Script, 44await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\WithKeywordRecommenderTests.cs (4)
25await VerifyAbsenceAsync(SourceCodeKind.Script, 32await VerifyAbsenceAsync(SourceCodeKind.Script, 42await VerifyAbsenceAsync(SourceCodeKind.Script, 52await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\YieldKeywordRecommenderTests.cs (4)
17await VerifyAbsenceAsync(SourceCodeKind.Script, 24await VerifyAbsenceAsync(SourceCodeKind.Script, 34await VerifyAbsenceAsync(SourceCodeKind.Script, 44await VerifyAbsenceAsync(SourceCodeKind.Script,
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
PDB\CSharpDeterministicBuildCompilationTests.cs (1)
354kind: SourceCodeKind.Regular);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (16)
Attributes\AttributeTests_Dynamic.cs (15)
1293[InlineData(SourceCodeKind.Regular)] 1294[InlineData(SourceCodeKind.Script)] 1295public void TestNoCS1980WhenNotInContextWhichNeedsDynamicAttribute(SourceCodeKind sourceCodeKind) 1303[InlineData(SourceCodeKind.Regular)] 1304[InlineData(SourceCodeKind.Script)] 1305public void TestNoCS1980WhenNotInContextWhichNeedsDynamicAttribute_Errors(SourceCodeKind sourceCodeKind) 1341[InlineData(SourceCodeKind.Regular)] 1342[InlineData(SourceCodeKind.Script)] 1343public void TestDynamicAttributeInAliasContext1(SourceCodeKind sourceCodeKind) 1355[InlineData(SourceCodeKind.Regular)] 1356[InlineData(SourceCodeKind.Script)] 1357public void TestDynamicAttributeInAliasContext2(SourceCodeKind sourceCodeKind) 1369[InlineData(SourceCodeKind.Regular)] 1370[InlineData(SourceCodeKind.Script)] 1371public void TestDynamicAttributeInAliasContext_Errors(SourceCodeKind sourceCodeKind)
Diagnostics\GetDiagnosticsTests.cs (1)
522var compilation = CreateCompilationWithMscorlib461(string.Empty, parseOptions: new CSharpParseOptions().WithKind(SourceCodeKind.Interactive));
Microsoft.CodeAnalysis.CSharp.Features (3)
ExtractMethod\CSharpSelectionValidator.cs (2)
108if (!localFunction && options is { Kind: SourceCodeKind.Regular }) 112if (localFunction && options is { Kind: SourceCodeKind.Script })
GenerateType\CSharpGenerateTypeService.cs (1)
234document.Document.SourceCodeKind == SourceCodeKind.Regular)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (4)
Diagnostics\AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest_NoEditor.cs (1)
17private static readonly CSharpParseOptions Script = new(kind: SourceCodeKind.Script);
src\Analyzers\CSharp\Tests\DocumentationComments\AddDocCommentNodesCodeFixProviderTests.cs (1)
21private static readonly CSharpParseOptions Regular = new(kind: SourceCodeKind.Regular);
src\Analyzers\CSharp\Tests\DocumentationComments\RemoveDocCommentNodeCodeFixProviderTests.cs (1)
21private static readonly CSharpParseOptions Regular = new(kind: SourceCodeKind.Regular);
src\Analyzers\CSharp\Tests\GenerateMethod\GenerateMethodTests.cs (1)
5305new TestParameters(new CSharpParseOptions(kind: SourceCodeKind.Regular)));
Microsoft.CodeAnalysis.CSharp.Scripting (1)
CSharpScriptCompiler.cs (1)
18internal static readonly CSharpParseOptions DefaultParseOptions = new CSharpParseOptions(kind: SourceCodeKind.Script, languageVersion: LanguageVersion.Latest);
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
ScriptOptionsTests.cs (1)
36var options = ScriptOptions.Default.WithParseOptions(new VisualBasicParseOptions(kind: SourceCodeKind.Script, languageVersion: VisualBasic.LanguageVersion.Latest));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (15)
Semantics\DelegateTypeTests.cs (2)
10349var comp = CreateCompilation(source, parseOptions: TestOptions.Regular9.WithKind(SourceCodeKind.Script)); 10361comp = CreateCompilation(source, parseOptions: TestOptions.Regular10.WithKind(SourceCodeKind.Script));
Semantics\InterpolationTests.cs (2)
1157kind: SourceCodeKind.Regular 1368kind: SourceCodeKind.Regular
Semantics\ScriptSemanticsTests.cs (11)
1179var compilationUnit = CSharp.SyntaxFactory.ParseCompilationUnit(code, options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1207syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1216syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1225syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1237syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1249syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1267var compilationUnit = CSharp.SyntaxFactory.ParseCompilationUnit("\nSystem.Console.WriteLine(1);", options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1269var syntaxTree2 = SyntaxFactory.ParseSyntaxTree("System.Console.WriteLine(2);", options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1306var compilationUnit = CSharp.SyntaxFactory.ParseCompilationUnit(code, options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1336syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1351syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (54)
LexicalAndXml\PreprocessorTests.cs (13)
75private CSharpParseOptions GetOptions(SourceCodeKind kind, string[] defines) 82return Parse(text, SourceCodeKind.Regular, defines); 85private CompilationUnitSyntax Parse(string text, SourceCodeKind kind, params string[] defines) 99var options = this.GetOptions(SourceCodeKind.Regular, defines); 3255var node = Parse(text, SourceCodeKind.Regular); 3278var node = Parse(text, SourceCodeKind.Regular); 4300var node = Parse(text, SourceCodeKind.Script); 4315var node = Parse(text, SourceCodeKind.Script); 4388var node = Parse(text, SourceCodeKind.Script); 4403var node = Parse(text, SourceCodeKind.Script); 4417var node = Parse(text, SourceCodeKind.Script); 4432var node = Parse(text, SourceCodeKind.Script); 4447var node = Parse(text, SourceCodeKind.Script);
Parsing\CSharpParseOptionsTests.cs (25)
44TestProperty((old, value) => old.WithKind(value), opt => opt.Kind, SourceCodeKind.Script); 79Assert.Equal(SourceCodeKind.Regular, options.Kind); 80Assert.Equal(SourceCodeKind.Regular, options.SpecifiedKind); 84options = new CSharpParseOptions(kind: SourceCodeKind.Regular); 85Assert.Equal(SourceCodeKind.Regular, options.Kind); 86Assert.Equal(SourceCodeKind.Regular, options.SpecifiedKind); 90options = new CSharpParseOptions(kind: SourceCodeKind.Script); 91Assert.Equal(SourceCodeKind.Script, options.Kind); 92Assert.Equal(SourceCodeKind.Script, options.SpecifiedKind); 97options = new CSharpParseOptions(kind: SourceCodeKind.Interactive); 98Assert.Equal(SourceCodeKind.Script, options.Kind); 99Assert.Equal(SourceCodeKind.Interactive, options.SpecifiedKind); 106options = new CSharpParseOptions(kind: (SourceCodeKind)int.MinValue); 107Assert.Equal(SourceCodeKind.Regular, options.Kind); 108Assert.Equal((SourceCodeKind)int.MinValue, options.SpecifiedKind); 118var options1 = new CSharpParseOptions(kind: SourceCodeKind.Script); 119var options2 = new CSharpParseOptions(kind: SourceCodeKind.Script); 125options1 = new CSharpParseOptions(kind: SourceCodeKind.Script); 126options2 = new CSharpParseOptions(kind: SourceCodeKind.Interactive); 135var options1 = new CSharpParseOptions(kind: SourceCodeKind.Script); 136var options2 = new CSharpParseOptions(kind: SourceCodeKind.Script); 142options1 = new CSharpParseOptions(kind: SourceCodeKind.Script); 143options2 = new CSharpParseOptions(kind: SourceCodeKind.Interactive); 153var options = new CSharpParseOptions(kind: SourceCodeKind.Interactive); 195var options = new CSharpParseOptions().WithKind(SourceCodeKind.Interactive);
Parsing\MemberDeclarationParsingTests.cs (1)
2228bool isScript = parseOptions.Kind == SourceCodeKind.Script;
Syntax\SyntaxRewriterTests.cs (15)
368Assert.Equal(SourceCodeKind.Script, newTree.Options.Kind); 377Assert.Equal(SourceCodeKind.Script, tree.Options.Kind); 387Assert.Equal(SourceCodeKind.Script, newTree.Options.Kind); 396Assert.Equal(SourceCodeKind.Script, tree.Options.Kind); 407Assert.Equal(SourceCodeKind.Script, newTree.Options.Kind); 414Assert.Equal(SourceCodeKind.Script, newTree2.Options.Kind); 423Assert.Equal(SourceCodeKind.Script, tree.Options.Kind); 434Assert.Equal(SourceCodeKind.Script, newTree.Options.Kind); 451Assert.Equal(SourceCodeKind.Script, newTree.Options.Kind); 457Assert.Equal(SourceCodeKind.Script, newTree2.Options.Kind); 478Assert.Equal(SourceCodeKind.Script, newTree.Options.Kind); 484Assert.Equal(SourceCodeKind.Script, newTree2.Options.Kind); 506Assert.Equal(SourceCodeKind.Script, newTree.Options.Kind); 519Assert.Equal(SourceCodeKind.Script, newTree.Options.Kind); 532Assert.Equal(SourceCodeKind.Script, newTree.Options.Kind);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (3)
TestOptions.cs (3)
19public static readonly CSharpParseOptions Regular = new CSharpParseOptions(kind: SourceCodeKind.Regular, documentationMode: DocumentationMode.Parse); 20public static readonly CSharpParseOptions Script = Regular.WithKind(SourceCodeKind.Script); 58new CSharpParseOptions(kind: SourceCodeKind.Regular, documentationMode: DocumentationMode.None, languageVersion: LanguageVersion.Preview).WithFeatures(s_experimentalFeatures);
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (1)
636if (((CSharpParseOptions)container.SyntaxTree.Options).Kind == SourceCodeKind.Script)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (1)
411=> IsGlobalStatementContext && SyntaxTree.Options.Kind is SourceCodeKind.Regular;
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (75)
Completion\AbstractArgumentProviderTests`1.cs (1)
59var document = workspaceFixture.Target.UpdateDocument(code, SourceCodeKind.Regular);
Completion\AbstractCompletionProviderTests.cs (49)
114=> document.SourceCodeKind == SourceCodeKind.Regular ? [] : [PredefinedInteractiveTextViewRoles.InteractiveTextViewRole]; 122SourceCodeKind sourceCodeKind, bool usePreviousCharAsTrigger, char? deletedCharTrigger, bool checkForAbsence, 130SourceCodeKind sourceCodeKind, ItemExpectation[] expectedResults, 283SourceCodeKind? SourceCodeKind = null) 314SourceCodeKind? sourceCodeKind, bool usePreviousCharAsTrigger, char? deletedCharTrigger, bool checkForAbsence, 319SourceCodeKind[] evaluatedSourceCodeKinds = sourceCodeKind.HasValue ? [sourceCodeKind.Value] : [SourceCodeKind.Regular, SourceCodeKind.Script]; 320foreach (var sourceKind in evaluatedSourceCodeKinds) 341string markup, SourceCodeKind? sourceCodeKind, char? deletedCharTrigger, bool usePreviousCharAsTrigger, 345SourceCodeKind[] evaluatedSourceCodeKinds = sourceCodeKind.HasValue ? [sourceCodeKind.Value] : [SourceCodeKind.Regular, SourceCodeKind.Script]; 346foreach (var sourceKind in evaluatedSourceCodeKinds) 378protected async Task VerifyCustomCommitProviderAsync(string markupBeforeCommit, string itemToCommit, string expectedCodeAfterCommit, SourceCodeKind? sourceCodeKind = null, char? commitChar = null) 392await VerifyCustomCommitProviderWorkerAsync(code, position, itemToCommit, expectedCodeAfterCommit, SourceCodeKind.Regular, commitChar); 393await VerifyCustomCommitProviderWorkerAsync(code, position, itemToCommit, expectedCodeAfterCommit, SourceCodeKind.Script, commitChar); 403SourceCodeKind? sourceCodeKind = null) 419await VerifyProviderCommitWorkerAsync(code, position, itemToCommit, expectedCodeAfterCommit, commitChar, SourceCodeKind.Regular); 420await VerifyProviderCommitWorkerAsync(code, position, itemToCommit, expectedCodeAfterCommit, commitChar, SourceCodeKind.Script); 432SourceCodeKind? sourceCodeKind = null, bool usePreviousCharAsTrigger = false, char? deletedCharTrigger = null, 449SourceCodeKind? sourceCodeKind = null, bool usePreviousCharAsTrigger = false, char? deletedCharTrigger = null, 463string markup, SourceCodeKind? sourceCodeKind = null, bool usePreviousCharAsTrigger = false, 472string markup, SourceCodeKind? sourceCodeKind = null, 483SourceCodeKind? sourceCodeKind = null, 507SourceCodeKind sourceCodeKind, 541char? deletedCharTrigger, bool? hasSuggestionModeItem, SourceCodeKind sourceCodeKind, 575bool? hasSuggestionModeItem, SourceCodeKind sourceCodeKind, 593protected virtual async Task VerifyCustomCommitProviderWorkerAsync(string codeBeforeCommit, int position, string itemToCommit, string expectedCodeAfterCommit, SourceCodeKind sourceCodeKind, char? commitChar = null) 721char? commitChar, SourceCodeKind sourceCodeKind) 1068string code, int position, string insertText, bool usePreviousCharAsTrigger, char? deletedCharTrigger, bool? hasSuggestionItem, SourceCodeKind sourceCodeKind, 1082SourceCodeKind sourceCodeKind, ItemExpectation[] expectedResults, 1092SourceCodeKind sourceCodeKind, ItemExpectation[] expectedResults, string partialItem, 1103SourceCodeKind sourceCodeKind, bool checkForAbsence, 1121SourceCodeKind sourceCodeKind, bool checkForAbsence, Glyph? glyph, 1136SourceCodeKind sourceCodeKind, bool checkForAbsence, Glyph? glyph, 1152SourceCodeKind sourceCodeKind, ItemExpectation[] expectedResults, 1171SourceCodeKind sourceCodeKind, ItemExpectation[] expectedResults, 1181SourceCodeKind sourceCodeKind, ItemExpectation[] expectedResults, 1192SourceCodeKind sourceCodeKind, bool checkForAbsence, Glyph? glyph, 1217SourceCodeKind sourceCodeKind, bool checkForAbsence, Glyph? glyph, 1231SourceCodeKind sourceCodeKind, ItemExpectation[] expectedResults, string partialItem, 1243SourceCodeKind sourceCodeKind, bool checkForAbsence, Glyph? glyph, 1260SourceCodeKind sourceCodeKind = SourceCodeKind.Regular, 1271SourceCodeKind sourceCodeKind, 1318protected async Task VerifyCommitCharactersAsync(string initialMarkup, string textTypedSoFar, char[] validChars, char[] invalidChars = null, SourceCodeKind sourceCodeKind = SourceCodeKind.Regular) 1350string markup, SourceCodeKind sourceCodeKind, bool usePreviousCharAsTrigger = false)
GoToAdjacentMember\AbstractGoToAdjacentMemberTests.cs (3)
24protected async Task AssertNavigatedAsync(string code, bool next, SourceCodeKind? sourceCodeKind = null) 28: [SourceCodeKind.Regular, SourceCodeKind.Script];
RefactoringHelpers\RefactoringHelpersTestBase.cs (1)
106var document = workspaceFixture.Target.UpdateDocument(text, SourceCodeKind.Regular);
SignatureHelp\AbstractSignatureHelpProviderTests.cs (8)
51SourceCodeKind? sourceCodeKind = null, 62await TestSignatureHelpWorkerAsync(markup, SourceCodeKind.Regular, experimental, expectedOrderedItemsOrNull, usePreviousCharAsTrigger); 63await TestSignatureHelpWorkerAsync(markup, SourceCodeKind.Script, experimental, expectedOrderedItemsOrNull, usePreviousCharAsTrigger); 69SourceCodeKind sourceCodeKind, 143protected virtual async Task VerifyCurrentParameterNameAsync(string markup, string expectedParameterName, SourceCodeKind? sourceCodeKind = null) 153await VerifyCurrentParameterNameWorkerAsync(markup, expectedParameterName, SourceCodeKind.Regular); 154await VerifyCurrentParameterNameWorkerAsync(markup, expectedParameterName, SourceCodeKind.Script); 164private async Task VerifyCurrentParameterNameWorkerAsync(string markup, string expectedParameterName, SourceCodeKind sourceCodeKind)
TypeInferrer\TypeInferrerTestBase.cs (2)
51SourceCodeKind sourceCodeKind = SourceCodeKind.Regular)
Workspaces\CSharpTestWorkspaceFixture.cs (1)
19parseOptions: new CSharpParseOptions(kind: SourceCodeKind.Regular),
Workspaces\EditorTestHostDocument.cs (4)
54SourceCodeKind sourceCodeKind = SourceCodeKind.Regular, 87SourceCodeKind sourceCodeKind = SourceCodeKind.Regular,
Workspaces\EditorTestWorkspace.cs (4)
56SourceCodeKind sourceCodeKind = SourceCodeKind.Regular, 72SourceCodeKind sourceCodeKind = SourceCodeKind.Regular,
Workspaces\TestWorkspaceFixture.cs (1)
78public Document UpdateDocument(string text, SourceCodeKind sourceCodeKind, bool cleanBeforeUpdate = true)
Workspaces\VisualBasicTestWorkspaceFixture.cs (1)
19parseOptions: new VisualBasicParseOptions(kind: SourceCodeKind.Regular),
Microsoft.CodeAnalysis.ExternalAccess.FSharp (2)
VS\IFSharpWorkspaceProjectContextFactory.cs (2)
35void AddSourceFile(string path, SourceCodeKind kind); 190public void AddSourceFile(string path, SourceCodeKind kind)
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (6)
RazorDynamicFileInfo.cs (2)
17public RazorDynamicFileInfo(string filePath, SourceCodeKind sourceCodeKind, TextLoader textLoader, IRazorDocumentServiceProvider documentServiceProvider) 33public SourceCodeKind SourceCodeKind { get; }
Testing\AbstractRazorLanguageServerFactoryWrapper.cs (2)
24SourceCodeKind sourceCodeKind = SourceCodeKind.Regular,
Testing\RazorTestLanguageServerFactory.cs (2)
50SourceCodeKind sourceCodeKind = SourceCodeKind.Regular,
Microsoft.CodeAnalysis.Features (7)
ExtractMethod\Extensions.cs (1)
68return node.SyntaxTree.Options.Kind != SourceCodeKind.Regular;
GenerateType\AbstractGenerateTypeService.Editor.cs (2)
332SourceCodeKind.Regular, 343SourceCodeKind sourceCodeKind,
IntroduceVariable\AbstractIntroduceVariableService.State.cs (1)
311if (Document.Document.SourceCodeKind != SourceCodeKind.Regular)
Workspace\MiscellaneousFileUtilities.cs (3)
45parseOptions = parseOptions.WithKind(SourceCodeKind.Script); 52var sourceCodeKind = parseOptions?.Kind ?? SourceCodeKind.Regular; 75hasAllInformation: sourceCodeKind == SourceCodeKind.Script),
Microsoft.CodeAnalysis.Features.Test.Utilities (3)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (1)
411sourceCodeKind: SourceCodeKind.Regular,
Utils\Options.cs (2)
13internal static readonly CSharpParseOptions Script = new CSharpParseOptions(kind: SourceCodeKind.Script); 14internal static readonly CSharpParseOptions Regular = new CSharpParseOptions(kind: SourceCodeKind.Regular);
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
Miscellaneous\LspMiscellaneousFilesWorkspaceTests.cs (1)
168sourceCodeKind: SourceCodeKind.Regular,
Microsoft.CodeAnalysis.Rebuild.UnitTests (3)
DeterministicKeyBuilderTests.cs (3)
417SourceCodeKind sourceCodeKind, 425if (sourceCodeKind == SourceCodeKind.Interactive) 427sourceCodeKind = SourceCodeKind.Script;
Microsoft.CodeAnalysis.Test.Utilities (1)
Compilation\CompilationExtensions.cs (1)
367if (blockOperation.Syntax.SyntaxTree.Options.Kind != SourceCodeKind.Script)
Microsoft.CodeAnalysis.UnitTests (1)
Diagnostics\AnalysisContextInfoTests.cs (1)
26var parseOptions = new CSharpParseOptions(kind: SourceCodeKind.Regular, documentationMode: DocumentationMode.None)
Microsoft.CodeAnalysis.VisualBasic (17)
Binding\BinderFactory.vb (2)
36Return _tree.Options.Kind = SourceCodeKind.Script 165If node.Kind <> SyntaxKind.CompilationUnit OrElse _tree.Options.Kind = SourceCodeKind.Regular Then
CommandLine\VisualBasicCommandLineParser.vb (2)
1417kind:=If(IsScriptCommandLineParser, SourceCodeKind.Script, SourceCodeKind.Regular),
CommandLine\VisualBasicCompiler.vb (1)
95Dim scriptParseOptions = parseOptions.WithKind(SourceCodeKind.Script)
Declarations\DeclarationTreeBuilder.vb (2)
132Debug.Assert(parent.Kind = SyntaxKind.CompilationUnit AndAlso _syntaxTree.Options.Kind <> SourceCodeKind.Regular) 175If _syntaxTree.Options.Kind <> SourceCodeKind.Regular Then
Parser\Parser.vb (1)
75Return _scanner.Options.Kind = SourceCodeKind.Script
Parser\ParseStatement.vb (1)
1868If lookahead.Kind <> SyntaxKind.EndOfFileToken OrElse _scanner.Options.Kind = SourceCodeKind.Regular Then
Syntax\SyntaxFactory.vb (1)
1068If options.Kind = SourceCodeKind.Regular Then
Syntax\VisualBasicSyntaxTree.vb (1)
88Return Options.Kind = SourceCodeKind.Script AndAlso GetCompilationUnitRoot().GetReferenceDirectives().Count > 0
VisualBasicParseOptions.vb (6)
33''' <param name="kind">The kind of source code.<see cref="SourceCodeKind"/></param> 38Optional kind As SourceCodeKind = SourceCodeKind.Regular, 51kind As SourceCodeKind, 148Public Shadows Function WithKind(kind As SourceCodeKind) As VisualBasicParseOptions 210Public Overrides Function CommonWithKind(kind As SourceCodeKind) As ParseOptions
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (2)
GenerateVariable\GenerateVariableTests.vb (2)
1354parseOptions:=New VisualBasicParseOptions(kind:=SourceCodeKind.Script)) 1364parseOptions:=New VisualBasicParseOptions(kind:=SourceCodeKind.Script),
Microsoft.CodeAnalysis.VisualBasic.Scripting (1)
VisualBasicScriptCompiler.vb (1)
18Private Shared ReadOnly s_defaultOptions As VisualBasicParseOptions = New VisualBasicParseOptions(kind:=SourceCodeKind.Script, languageVersion:=LanguageVersion.Latest)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (10)
Compilation\VisualBasicCompilationOptionsTests.vb (1)
103New VisualBasicParseOptions(kind:=SourceCodeKind.Script))
Diagnostics\GetDiagnosticsTests.vb (1)
247Dim compilation = CreateCompilationWithMscorlib461(String.Empty, parseOptions:=New VisualBasicParseOptions().WithKind(SourceCodeKind.Interactive))
Semantics\ScriptSemanticsTests.vb (8)
42Dim compilationUnit = VisualBasic.SyntaxFactory.ParseCompilationUnit(code, options:=New VisualBasicParseOptions(kind:=SourceCodeKind.Script)) 74syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options:=New VisualBasicParseOptions(kind:=SourceCodeKind.Script)) 83syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options:=New VisualBasicParseOptions(kind:=SourceCodeKind.Script)) 92syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options:=New VisualBasicParseOptions(kind:=SourceCodeKind.Script)) 105syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options:=New VisualBasicParseOptions(kind:=SourceCodeKind.Script)) 118syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options:=New VisualBasicParseOptions(kind:=SourceCodeKind.Script)) 133Dim compilationUnit = VisualBasic.SyntaxFactory.ParseCompilationUnit("System.Console.WriteLine(1)", options:=New VisualBasicParseOptions(kind:=SourceCodeKind.Script)) 135Dim syntaxTree2 = SyntaxFactory.ParseSyntaxTree("System.Console.WriteLine(2)", options:=New VisualBasicParseOptions(kind:=SourceCodeKind.Script))
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (41)
Parser\VisualBasicParseOptionsTests.vb (25)
23TestProperty(Function(old, value) old.WithKind(value), Function(opt) opt.Kind, SourceCodeKind.Script) 246Assert.Equal(SourceCodeKind.Regular, options.Kind) 247Assert.Equal(SourceCodeKind.Regular, options.SpecifiedKind) 251options = New VisualBasicParseOptions(kind:=SourceCodeKind.Regular) 252Assert.Equal(SourceCodeKind.Regular, options.Kind) 253Assert.Equal(SourceCodeKind.Regular, options.SpecifiedKind) 257options = New VisualBasicParseOptions(kind:=SourceCodeKind.Script) 258Assert.Equal(SourceCodeKind.Script, options.Kind) 259Assert.Equal(SourceCodeKind.Script, options.SpecifiedKind) 264options = New VisualBasicParseOptions(kind:=SourceCodeKind.Interactive) 265Assert.Equal(SourceCodeKind.Script, options.Kind) 266Assert.Equal(SourceCodeKind.Interactive, options.SpecifiedKind) 271options = New VisualBasicParseOptions(kind:=CType(Int32.MinValue, SourceCodeKind)) 272Assert.Equal(SourceCodeKind.Regular, options.Kind) 273Assert.Equal(CType(Int32.MinValue, SourceCodeKind), options.SpecifiedKind) 280Dim options1 = New VisualBasicParseOptions(kind:=SourceCodeKind.Script) 281Dim options2 = New VisualBasicParseOptions(kind:=SourceCodeKind.Script) 287options1 = New VisualBasicParseOptions(kind:=SourceCodeKind.Script) 288options2 = New VisualBasicParseOptions(kind:=SourceCodeKind.Interactive) 296Dim options1 = New VisualBasicParseOptions(kind:=SourceCodeKind.Script) 297Dim options2 = New VisualBasicParseOptions(kind:=SourceCodeKind.Script) 303options1 = New VisualBasicParseOptions(kind:=SourceCodeKind.Script) 304options2 = New VisualBasicParseOptions(kind:=SourceCodeKind.Interactive) 313Dim options = New VisualBasicParseOptions(kind:=SourceCodeKind.Interactive) 346Dim options = New VisualBasicParseOptions().WithKind(SourceCodeKind.Interactive)
Syntax\SyntaxRewriterTests.vb (16)
529Assert.Equal(SourceCodeKind.Script, tree.Options.Kind) 537Assert.Equal(SourceCodeKind.Script, newTree.Options.Kind) 546Assert.Equal(SourceCodeKind.Script, tree.Options.Kind) 556Assert.Equal(SourceCodeKind.Script, newTree.Options.Kind) 565Assert.Equal(SourceCodeKind.Script, tree.Options.Kind) 576Assert.Equal(SourceCodeKind.Script, newTree.Options.Kind) 583Assert.Equal(SourceCodeKind.Script, newTree2.Options.Kind) 592Assert.Equal(SourceCodeKind.Script, tree.Options.Kind) 603Assert.Equal(SourceCodeKind.Script, newTree.Options.Kind) 621Assert.Equal(SourceCodeKind.Script, newTree.Options.Kind) 627Assert.Equal(SourceCodeKind.Script, newTree2.Options.Kind) 648Assert.Equal(SourceCodeKind.Script, newTree.Options.Kind) 654Assert.Equal(SourceCodeKind.Script, newTree2.Options.Kind) 676Assert.Equal(SourceCodeKind.Script, newTree.Options.Kind) 689Assert.Equal(SourceCodeKind.Script, newTree.Options.Kind) 702Assert.Equal(SourceCodeKind.Script, newTree.Options.Kind)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (2)
TestOptions.vb (2)
12Public Shared ReadOnly Script As New VisualBasicParseOptions(kind:=SourceCodeKind.Script) 13Public Shared ReadOnly Regular As New VisualBasicParseOptions(kind:=SourceCodeKind.Regular)
Microsoft.CodeAnalysis.Workspaces (50)
Serialization\AbstractOptionsSerializationService.cs (3)
206protected static (SourceCodeKind kind, DocumentationMode documentationMode, IEnumerable<KeyValuePair<string, string>> features) ReadParseOptionsPieces( 212var kind = (SourceCodeKind)reader.ReadInt32();
src\Compilers\Core\Portable\SourceCodeKindExtensions.cs (10)
9internal static SourceCodeKind MapSpecifiedToEffectiveKind(this SourceCodeKind kind) 13case SourceCodeKind.Script: 15case SourceCodeKind.Interactive: 17return SourceCodeKind.Script; 19case SourceCodeKind.Regular: 21return SourceCodeKind.Regular; 25internal static bool IsValid(this SourceCodeKind value) 27return value >= SourceCodeKind.Regular && value <= SourceCodeKind.Script;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (1)
39=> syntaxTree.Options.Kind != SourceCodeKind.Regular;
Workspace\CommandLineProject.cs (2)
167sourceCodeKind: fileArg.IsScript ? SourceCodeKind.Script : SourceCodeKind.Regular,
Workspace\Host\SourceFiles\DynamicFileInfo.cs (3)
13internal sealed class DynamicFileInfo(string filePath, SourceCodeKind sourceCodeKind, TextLoader textLoader, bool designTimeOnly, IDocumentServiceProvider? documentServiceProvider) 22/// return <see cref="SourceCodeKind"/> for this file 24public SourceCodeKind SourceCodeKind { get; } = sourceCodeKind;
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (2)
87public DocumentId AddFile(string fullPath, SourceCodeKind sourceCodeKind, ImmutableArray<string> folders) 134SourceCodeKind sourceCodeKind,
Workspace\ProjectSystem\ProjectSystemProject.cs (7)
858public void AddSourceFile(string fullPath, SourceCodeKind sourceCodeKind = SourceCodeKind.Regular, ImmutableArray<string> folders = default) 873SourceCodeKind sourceCodeKind = SourceCodeKind.Regular, 895public void AddAdditionalFile(string fullPath, SourceCodeKind sourceCodeKind = SourceCodeKind.Regular, ImmutableArray<string> folders = default) 911_analyzerConfigFiles.AddFile(fullPath, SourceCodeKind.Regular, folders: default);
Workspace\Solution\Document.cs (2)
55public SourceCodeKind SourceCodeKind => DocumentState.SourceCodeKind; 384public Document WithSourceCodeKind(SourceCodeKind kind)
Workspace\Solution\DocumentInfo.cs (8)
41public SourceCodeKind SourceCodeKind => Attributes.SourceCodeKind; 80SourceCodeKind sourceCodeKind = SourceCodeKind.Regular, 126public DocumentInfo WithSourceCodeKind(SourceCodeKind kind) 152SourceCodeKind sourceCodeKind, 177public SourceCodeKind SourceCodeKind { get; } = sourceCodeKind; 199Optional<SourceCodeKind> sourceCodeKind = default, 250var sourceCodeKind = (SourceCodeKind)reader.ReadByte();
Workspace\Solution\DocumentState.cs (2)
96public SourceCodeKind SourceCodeKind 384public DocumentState UpdateSourceCodeKind(SourceCodeKind kind)
Workspace\Solution\ProjectChanges.cs (1)
124/// otherwise get documents with any changes i.e. <see cref="ParseOptions"/>, <see cref="SourceCodeKind"/> and file path.
Workspace\Solution\Solution.cs (5)
933private static SourceCodeKind GetSourceCodeKind(ProjectState project) 934=> project.ParseOptions != null ? project.ParseOptions.Kind : SourceCodeKind.Regular; 1411public Solution WithDocumentSourceCodeKind(DocumentId documentId, SourceCodeKind sourceCodeKind) 1416if (sourceCodeKind == SourceCodeKind.Interactive) 1418sourceCodeKind = SourceCodeKind.Script;
Workspace\Solution\SolutionCompilationState.cs (1)
1042DocumentId documentId, SourceCodeKind sourceCodeKind)
Workspace\Solution\SolutionState.cs (1)
1090public StateChange WithDocumentSourceCodeKind(DocumentId documentId, SourceCodeKind sourceCodeKind)
Workspace\Workspace.cs (2)
1376protected internal void OnDocumentSourceCodeKindChanged(DocumentId documentId, SourceCodeKind sourceCodeKind) 2079doc is Document sourceDoc ? sourceDoc.SourceCodeKind : SourceCodeKind.Regular,
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
MSBuild\MSBuildProjectLoader.Worker.cs (1)
448SourceCodeKind.Regular,
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (26)
TestDynamicFileInfoProviderThatProducesFiles.cs (1)
34SourceCodeKind.Regular,
WorkspaceExtensions.cs (2)
15public static DocumentId AddDocument(this Workspace workspace, ProjectId projectId, IEnumerable<string> folders, string name, SourceText initialText, SourceCodeKind sourceCodeKind = SourceCodeKind.Regular)
Workspaces\TestHostDocument.cs (5)
62public SourceCodeKind SourceCodeKind { get; } 95SourceCodeKind sourceCodeKind = SourceCodeKind.Regular, 132SourceCodeKind sourceCodeKind = SourceCodeKind.Regular,
Workspaces\TestWorkspace.cs (4)
36SourceCodeKind sourceCodeKind = SourceCodeKind.Regular, 52SourceCodeKind sourceCodeKind = SourceCodeKind.Regular,
Workspaces\TestWorkspace_XmlConsumption.cs (5)
616var codeKind = SourceCodeKind.Regular; 621? SourceCodeKind.Regular 622: (SourceCodeKind)Enum.Parse(typeof(SourceCodeKind), attr.Value);
Workspaces\TestWorkspace`1.cs (9)
173SourceCodeKind sourceCodeKind = SourceCodeKind.Regular, 188SourceCodeKind sourceCodeKind = SourceCodeKind.Regular, 219return parseOptions.Kind == SourceCodeKind.Regular 225return parseOptions.Kind == SourceCodeKind.Regular 297public new void OnDocumentSourceCodeKindChanged(DocumentId documentId, SourceCodeKind sourceCodeKind) 725var document = CreateDocument(exportProvider, languageServices, code, submissionName, submissionName, cursorPosition, spans, SourceCodeKind.Script); 751var parseOptions = syntaxFactory.GetDefaultParseOptions().WithKind(SourceCodeKind.Script);
Microsoft.CodeAnalysis.Workspaces.UnitTests (54)
SolutionTests\DocumentInfoTests.cs (11)
39sourceCodeKind: SourceCodeKind.Script, 45Assert.Equal(SourceCodeKind.Script, info.SourceCodeKind); 58sourceCodeKind: SourceCodeKind.Script, 64Assert.Equal(SourceCodeKind.Script, info.SourceCodeKind); 88[InlineData(SourceCodeKind.Script, null, "")] 89[InlineData(SourceCodeKind.Script, "", "")] 90[InlineData(SourceCodeKind.Script, "path", "path")] 91[InlineData(SourceCodeKind.Regular, null, "doc_name")] 92[InlineData(SourceCodeKind.Regular, "", "")] 93[InlineData(SourceCodeKind.Regular, "path", "path")] 94public void Create_FilePath(SourceCodeKind kind, string path, string expectedSyntaxTreeFilePath)
SolutionTests\SolutionTests.cs (36)
253Assert.Same(solution, solution.WithDocumentSourceCodeKind(documentId, SourceCodeKind.Regular)); 255var newSolution1 = solution.WithDocumentSourceCodeKind(documentId, SourceCodeKind.Script); 256Assert.Equal(SourceCodeKind.Script, newSolution1.GetRequiredDocument(documentId).SourceCodeKind); 258Assert.Throws<ArgumentOutOfRangeException>(() => solution.WithDocumentSourceCodeKind(documentId, (SourceCodeKind)(-1))); 260Assert.Throws<ArgumentNullException>(() => solution.WithDocumentSourceCodeKind(null!, SourceCodeKind.Script)); 261Assert.Throws<InvalidOperationException>(() => solution.WithDocumentSourceCodeKind(s_unrelatedDocumentId, SourceCodeKind.Script)); 273solution = solution.WithProjectParseOptions(projectId, CSharpParseOptions.Default.WithKind(SourceCodeKind.Script)); 276Assert.Equal(SourceCodeKind.Script, document1.DocumentState.ParseOptions?.Kind); 277Assert.Equal(SourceCodeKind.Script, document1.SourceCodeKind); 279var document2 = document1.WithSourceCodeKind(SourceCodeKind.Regular); 280Assert.Equal(SourceCodeKind.Regular, document2.DocumentState.ParseOptions?.Kind); 281Assert.Equal(SourceCodeKind.Regular, document2.SourceCodeKind); 291var newSolution = solution.WithDocumentSourceCodeKind(documentId, SourceCodeKind.Interactive); 292Assert.Equal(SourceCodeKind.Script, newSolution.GetDocument(documentId)!.SourceCodeKind); 1105sourceCodeKind: SourceCodeKind.Script, 1114sourceCodeKind: SourceCodeKind.Regular, 1124sourceCodeKind: SourceCodeKind.Script, 1133sourceCodeKind: SourceCodeKind.Regular, 1143sourceCodeKind: SourceCodeKind.Script, 1152sourceCodeKind: SourceCodeKind.Regular, 2361WithProjectParseOptions(projectId, new CSharpParseOptions(kind: SourceCodeKind.Script)); 2370Assert.Equal(SourceCodeKind.Script, document.SourceCodeKind); 2387WithProjectParseOptions(projectId, new CSharpParseOptions(kind: SourceCodeKind.Script)); 2402Assert.Equal(SourceCodeKind.Script, document.SourceCodeKind); 2417WithProjectParseOptions(projectId, new CSharpParseOptions(kind: SourceCodeKind.Script)); 2430Assert.Equal(SourceCodeKind.Script, document.SourceCodeKind); 2446WithProjectParseOptions(projectId, new CSharpParseOptions(kind: SourceCodeKind.Script)); 2459Assert.Equal(SourceCodeKind.Script, document2.SourceCodeKind); 2475WithProjectParseOptions(projectId, new CSharpParseOptions(kind: SourceCodeKind.Script)); 2495Assert.Equal(SourceCodeKind.Script, document2.SourceCodeKind); 2506WithProjectParseOptions(projectId, new CSharpParseOptions(kind: SourceCodeKind.Script)); 3818var newOptions = tree.Options.WithKind(SourceCodeKind.Script); 4918.AddDocument(DocumentInfo.Create(documentId, "Test", sourceCodeKind: SourceCodeKind.Script)); 4921Assert.Equal(SourceCodeKind.Script, document1.SourceCodeKind); 4924var document2 = document1.WithSourceCodeKind(SourceCodeKind.Regular); 4925Assert.Equal(SourceCodeKind.Regular, document2.SourceCodeKind);
WorkspaceTests\AdhocWorkspaceTests.cs (4)
515Assert.Equal(SourceCodeKind.Regular, originalDoc.SourceCodeKind); 517var changedDoc = originalDoc.WithSourceCodeKind(SourceCodeKind.Script); 518Assert.Equal(SourceCodeKind.Script, changedDoc.SourceCodeKind); 533Assert.Equal(SourceCodeKind.Script, appliedDoc.SourceCodeKind);
WorkspaceTests\WorkspaceTests.cs (3)
91Assert.Equal(SourceCodeKind.Regular, originalDoc.SourceCodeKind); 93var changedDoc = originalDoc.WithSourceCodeKind(SourceCodeKind.Script); 94Assert.Equal(SourceCodeKind.Script, changedDoc.SourceCodeKind);
Microsoft.VisualStudio.LanguageServices (8)
ExternalAccess\VSTypeScript\Api\VSTypeScriptVisualStudioProjectWrapper.cs (2)
25=> Project.AddSourceFile(fullPath, SourceCodeKind.Regular); 30return Project.AddSourceTextContainer(sourceTextContainer, fullPath, SourceCodeKind.Regular, documentServiceProvider: documentServiceProvider);
ProjectSystem\CPS\IWorkspaceProjectContext.cs (2)
56void AddSourceFile(string filePath, bool isInCurrentContext = true, IEnumerable<string>? folderNames = null, SourceCodeKind sourceCodeKind = SourceCodeKind.Regular);
ProjectSystem\Legacy\AbstractLegacyProject.cs (2)
178SourceCodeKind sourceCodeKind) 198SourceCodeKind sourceCodeKind)
ProjectSystem\Legacy\AbstractLegacyProject_IProjectSiteEx.cs (1)
33AddFile(filePath, linkMetadata, SourceCodeKind.Regular);
Venus\ContainedLanguage.cs (1)
105sourceCodeKind: SourceCodeKind.Regular,
Microsoft.VisualStudio.LanguageServices.CSharp (2)
ProjectSystemShim\CSharpProjectShim.ICSharpProjectSite.cs (1)
49AddFile(filename, SourceCodeKind.Regular);
ProjectSystemShim\CSharpProjectShim.OptionsProcessor.cs (1)
229return ((CSharpParseOptions)parseOptions).WithKind(SourceCodeKind.Regular)
Microsoft.VisualStudio.LanguageServices.UnitTests (6)
LanguageBlockTests.vb (6)
216", LanguageNames.CSharp, SourceCodeKind.Script) 221", LanguageNames.CSharp, SourceCodeKind.Regular) 229", LanguageNames.VisualBasic, SourceCodeKind.Script) 234", LanguageNames.VisualBasic, SourceCodeKind.Regular) 237Private Shared Sub VerifyNoBlock(markup As String, languageName As String, Optional sourceCodeKind As SourceCodeKind = SourceCodeKind.Regular)
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
ProjectSystemShim\VisualBasicProject.vb (1)
101MyBase.AddFile(wszFileName, SourceCodeKind.Regular)
Roslyn.VisualStudio.Next.UnitTests (1)
Services\SolutionServiceTests.cs (1)
318document = document.WithSourceCodeKind(SourceCodeKind.Script);
StackDepthTest (1)
Program.cs (1)
77var parseOptions = new CSharpParseOptions(kind: SourceCodeKind.Regular, documentationMode: DocumentationMode.None);