1470 references to SourceCodeKind
Microsoft.CodeAnalysis (17)
Compilation\Compilation.cs (1)
1076Debug.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)
37=> 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)
1299return this.SyntaxTree.Options.Kind == SourceCodeKind.Regular; 2310if (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)
130(node.Kind() == SyntaxKind.CompilationUnit && _syntaxTree.Options.Kind == SourceCodeKind.Regular)); 140bool acceptSimpleProgram = node.Kind() == SyntaxKind.CompilationUnit && _syntaxTree.Options.Kind == SourceCodeKind.Regular; 266Debug.Assert(_syntaxTree.Options.Kind != SourceCodeKind.Regular); 326Debug.Assert(parent.Kind() == SyntaxKind.CompilationUnit && _syntaxTree.Options.Kind != SourceCodeKind.Regular); 392if (_syntaxTree.Options.Kind != SourceCodeKind.Regular)
Parser\DirectiveParser.cs (3)
111if (lexer.Options.Kind == SourceCodeKind.Script && contextualKind == SyntaxKind.ExclamationToken && hashPosition == 0 && !hash.HasTrailingTrivia) 492if (Options.Kind == SourceCodeKind.Regular) 512if (Options.Kind == SourceCodeKind.Regular)
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)
427=> 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)
5304new TestParameters(new CSharpParseOptions(kind: SourceCodeKind.Regular)));
src\Features\CSharpTest\Diagnostics\AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest_NoEditor.cs (1)
16private 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 (196)
Completion\CompletionProviders\AbstractCSharpCompletionProviderTests.cs (6)
52SourceCodeKind sourceCodeKind, bool usePreviousCharAsTrigger, char? deletedCharTrigger, bool checkForAbsence, 67SourceCodeKind sourceCodeKind, ItemExpectation[] expectedResults, 78SourceCodeKind sourceCodeKind, bool usePreviousCharAsTrigger, char? deletedCharTrigger, 104SourceCodeKind sourceCodeKind, bool checkForAbsence, int? glyph, 123SourceCodeKind sourceCodeKind, bool checkForAbsence, int? glyph, 138SourceCodeKind sourceCodeKind, bool checkForAbsence, int? 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)
31string 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)
1981await 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 (4)
88""", SourceCodeKind.Regular); 224""", SourceCodeKind.Regular); 301", SourceCodeKind.Regular); 451", SourceCodeKind.Regular);
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (4)
836await BaseVerifyWorkerAsync(code, position, "@class()", "void Base.@class()", SourceCodeKind.Regular, false, deletedCharTrigger: null, false, null, null, null, null, null, null); 837await BaseVerifyWorkerAsync(code, position, "@class()", "void Base.@class()", SourceCodeKind.Script, false, deletedCharTrigger: null, false, null, null, null, null, null, null); 854await BaseVerifyWorkerAsync(code, position, "@class", "int Base.@class { get; set; }", SourceCodeKind.Regular, false, deletedCharTrigger: null, false, null, null, null, null, null, null); 855await 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)
1512var document1 = workspaceFixture.UpdateDocument(code, SourceCodeKind.Regular); 1517var document2 = workspaceFixture.UpdateDocument(code, SourceCodeKind.Regular, cleanBeforeUpdate: false);
Completion\CompletionProviders\SymbolCompletionProviderTests.cs (68)
28[InlineData(SourceCodeKind.Regular)] 29[InlineData(SourceCodeKind.Script)] 30public async Task EmptyFile(SourceCodeKind sourceCodeKind) 37[InlineData(SourceCodeKind.Regular)] 38[InlineData(SourceCodeKind.Script)] 39public async Task EmptyFileWithUsing(SourceCodeKind sourceCodeKind) 53=> await VerifyItemIsAbsentAsync(@"#r $$", "@System", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 57=> await VerifyItemIsAbsentAsync(@"#load $$", "@System", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 325sourceCodeKind: SourceCodeKind.Script); 349sourceCodeKind: SourceCodeKind.Script); 467await VerifyItemExistsAsync(source, "System", sourceCodeKind: SourceCodeKind.Regular); 481await VerifyItemExistsAsync(source, "Runtime", sourceCodeKind: SourceCodeKind.Regular); 498sourceCodeKind: SourceCodeKind.Regular); 515sourceCodeKind: SourceCodeKind.Regular); 527await VerifyItemExistsAsync(source, "A", sourceCodeKind: SourceCodeKind.Regular); 540await VerifyNoItemsExistAsync(source, sourceCodeKind: SourceCodeKind.Regular); 560sourceCodeKind: SourceCodeKind.Regular); 568await VerifyItemIsAbsentAsync(source, "NS", sourceCodeKind: SourceCodeKind.Regular); 589sourceCodeKind: SourceCodeKind.Regular); 612sourceCodeKind: SourceCodeKind.Regular); 625sourceCodeKind: SourceCodeKind.Regular); 664SourceCodeKind.Regular); 672await VerifyNoItemsExistAsync(source, sourceCodeKind: SourceCodeKind.Regular); 684await VerifyItemExistsAsync(source, "B", sourceCodeKind: SourceCodeKind.Regular); 696await VerifyItemExistsAsync(source, "B", sourceCodeKind: SourceCodeKind.Regular); 717sourceCodeKind: SourceCodeKind.Regular); 735sourceCodeKind: SourceCodeKind.Regular); 755sourceCodeKind: SourceCodeKind.Regular); 768sourceCodeKind: SourceCodeKind.Regular); 776await VerifyItemExistsAsync(source, "System", sourceCodeKind: SourceCodeKind.Regular); 794sourceCodeKind: SourceCodeKind.Regular); 834SourceCodeKind.Regular); 2096await VerifyItemExistsAsync(prefix + "$$", "args", sourceCodeKind: SourceCodeKind.Regular); 2106await VerifyItemIsAbsentAsync(prefix + "$$", "args", sourceCodeKind: SourceCodeKind.Script); 2119""", "args", sourceCodeKind: SourceCodeKind.Regular); 2131""" + prefix + "$$", "args", sourceCodeKind: SourceCodeKind.Regular); 2146""", "args", sourceCodeKind: SourceCodeKind.Regular); 2156await VerifyItemExistsAsync("call(" + prefix + "$$)", "args", sourceCodeKind: SourceCodeKind.Regular); 2161=> await VerifyItemIsAbsentAsync(@"$$", "args", sourceCodeKind: SourceCodeKind.Regular); 2170""", "args", sourceCodeKind: SourceCodeKind.Regular); 2178""", "args", sourceCodeKind: SourceCodeKind.Regular); 2182=> await VerifyItemExistsAsync(@"string first = $$", "args", sourceCodeKind: SourceCodeKind.Regular); 3197await VerifyItemExistsAsync(markup, "Q", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Regular); 3198await VerifyItemIsAbsentAsync(markup, "R", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Regular); 3213await VerifyItemExistsAsync(markup, "Q", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 3214await VerifyItemIsAbsentAsync(markup, "R", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 3322await VerifyItemExistsAsync(markup, "String", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 3334await VerifyItemExistsAsync(markup, "ElementAt", displayTextSuffix: "<>", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 3395await VerifyItemIsAbsentAsync(markup, "Console", expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 3837SourceCodeKind.Regular); 3854SourceCodeKind.Regular); 4515expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 4527expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 4539expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 4551expectedDescriptionOrNull: null, sourceCodeKind: SourceCodeKind.Script); 8128await VerifyItemExistsAsync(markup, "CommandLine", sourceCodeKind: SourceCodeKind.Script); 8496await VerifyItemExistsAsync(markup, "ForSchemaSet", displayTextSuffix: "<>", sourceCodeKind: SourceCodeKind.Regular); 8589=> await VerifyItemIsAbsentAsync(@"base.$$", @"ToString", sourceCodeKind: SourceCodeKind.Script); 9709await VerifyItemExistsAsync(markup, "Class1", displayTextSuffix: "<>", sourceCodeKind: SourceCodeKind.Regular); 9734await VerifyItemExistsAsync(markup, "Class1", displayTextSuffix: "<>", sourceCodeKind: SourceCodeKind.Regular); 10850await VerifyItemExistsAsync(markup, "aaa", sourceCodeKind: SourceCodeKind.Script); 10860await VerifyItemExistsAsync(markup, "aaa", sourceCodeKind: SourceCodeKind.Script); 10921await VerifyNoItemsExistAsync("#!$$", sourceCodeKind: SourceCodeKind.Script); 10922await VerifyNoItemsExistAsync("#! S$$", sourceCodeKind: SourceCodeKind.Script, usePreviousCharAsTrigger: true); 11923await VerifyItemExistsAsync(markup, "Length", sourceCodeKind: SourceCodeKind.Regular); 11942await VerifyItemExistsAsync(markup, "Length", sourceCodeKind: SourceCodeKind.Script); 13503await VerifyItemIsAbsentAsync(source, "System", sourceCodeKind: SourceCodeKind.Regular); 13908sourceCodeKind: 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)
10420await 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)
61sourceCodeKind: 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)
233await TestAsync(markup, expectedOrderedItems, 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)
214var document1 = new EditorTestHostDocument("var x = 1;", displayName: "Sub1", sourceCodeKind: SourceCodeKind.Script); 217var document2 = new EditorTestHostDocument("var x = 2;", displayName: "Sub2", sourceCodeKind: SourceCodeKind.Script, filePath: "a.csx");
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (783)
Recommendations\AbstractKeywordRecommenderTests.cs (10)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await 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 (4)
17await VerifyKeywordAsync(SourceCodeKind.Script, 24await VerifyKeywordAsync(SourceCodeKind.Script, 34await VerifyKeywordAsync(SourceCodeKind.Script, 44await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\CheckedKeywordRecommenderTests.cs (4)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await 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 (12)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await 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 (4)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\DefaultKeywordRecommenderTests.cs (4)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await 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 (14)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await 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 (4)
17await VerifyKeywordAsync(SourceCodeKind.Script, 24await VerifyKeywordAsync(SourceCodeKind.Script, 34await VerifyKeywordAsync(SourceCodeKind.Script, 44await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\DoubleKeywordRecommenderTests.cs (4)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\DynamicKeywordRecommenderTests.cs (4)
29await VerifyKeywordAsync(SourceCodeKind.Script, 36await VerifyKeywordAsync(SourceCodeKind.Script, 46await 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 (8)
17await VerifyKeywordAsync(SourceCodeKind.Script, 24await VerifyKeywordAsync(SourceCodeKind.Script, 34await 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, """ 331=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"internal $$"); 335=> await VerifyKeywordAsync(SourceCodeKind.Script, @"internal $$"); 349=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"public $$"); 353=> await VerifyKeywordAsync(SourceCodeKind.Script, @"public $$"); 368await VerifyAbsenceAsync(SourceCodeKind.Regular, 375await VerifyKeywordAsync(SourceCodeKind.Script, 432=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"static $$"); 436=> await VerifyKeywordAsync(SourceCodeKind.Script, @"static $$"); 450=> await VerifyAbsenceAsync(SourceCodeKind.Regular, @"static public $$"); 454=> 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 (4)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await 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 (4)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\ForEachKeywordRecommenderTests.cs (4)
17await VerifyKeywordAsync(SourceCodeKind.Script, 31await VerifyKeywordAsync(SourceCodeKind.Script, 41await VerifyKeywordAsync(SourceCodeKind.Script, 61await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\ForKeywordRecommenderTests.cs (4)
17await VerifyKeywordAsync(SourceCodeKind.Script, 24await VerifyKeywordAsync(SourceCodeKind.Script, 34await VerifyKeywordAsync(SourceCodeKind.Script, 44await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\FromKeywordRecommenderTests.cs (4)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await 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)
288await VerifyAbsenceAsync(SourceCodeKind.Regular, 298await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\GotoKeywordRecommenderTests.cs (4)
17await VerifyKeywordAsync(SourceCodeKind.Script, 24await VerifyKeywordAsync(SourceCodeKind.Script, 34await 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 (4)
17await VerifyKeywordAsync(SourceCodeKind.Script, 24await VerifyKeywordAsync(SourceCodeKind.Script, 34await 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 (8)
17await VerifyKeywordAsync(SourceCodeKind.Script, 24await VerifyKeywordAsync(SourceCodeKind.Script, 34await 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 (8)
17await VerifyKeywordAsync(SourceCodeKind.Script, 24await VerifyKeywordAsync(SourceCodeKind.Script, 34await 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 (7)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await 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 (4)
17await VerifyKeywordAsync(SourceCodeKind.Script, 24await VerifyKeywordAsync(SourceCodeKind.Script, 34await VerifyKeywordAsync(SourceCodeKind.Script, 44await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\LongKeywordRecommenderTests.cs (4)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await 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 (4)
22await VerifyKeywordAsync(SourceCodeKind.Script, 29await VerifyKeywordAsync(SourceCodeKind.Script, 39await 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 (4)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\ObjectKeywordRecommenderTests.cs (4)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await 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 (11)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await 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 (11)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await 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)
172protected async Task VerifyKeywordAsync(SourceCodeKind kind, string text) 176case SourceCodeKind.Regular: 180case SourceCodeKind.Script: 197SourceCodeKind kind, 202case SourceCodeKind.Regular: 205case SourceCodeKind.Script:
Recommendations\RecordKeywordRecommenderTests.cs (12)
19await VerifyKeywordAsync(SourceCodeKind.Script, 26await VerifyKeywordAsync(SourceCodeKind.Script, 36await 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 (4)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\ScopedKeywordRecommenderTests.cs (4)
26await VerifyKeywordAsync(SourceCodeKind.Script, 33await VerifyKeywordAsync(SourceCodeKind.Script, 43await VerifyKeywordAsync(SourceCodeKind.Script, 53await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\SealedKeywordRecommenderTests.cs (9)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await 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 (4)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\SizeOfKeywordRecommenderTests.cs (4)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\StackAllocKeywordRecommenderTests.cs (4)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\StaticKeywordRecommenderTests.cs (9)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await 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 (4)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\StructKeywordRecommenderTests.cs (18)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await 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 (4)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await 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 (4)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\TrueKeywordRecommenderTests.cs (4)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\TryKeywordRecommenderTests.cs (4)
17await VerifyKeywordAsync(SourceCodeKind.Script, 24await VerifyKeywordAsync(SourceCodeKind.Script, 34await 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 (4)
22await VerifyKeywordAsync(SourceCodeKind.Script, 29await VerifyKeywordAsync(SourceCodeKind.Script, 39await 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 (4)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\ULongKeywordRecommenderTests.cs (4)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\UncheckedKeywordRecommenderTests.cs (4)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await 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 (9)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await 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 (4)
18await VerifyKeywordAsync(SourceCodeKind.Script, 25await VerifyKeywordAsync(SourceCodeKind.Script, 35await VerifyKeywordAsync(SourceCodeKind.Script, 45await VerifyKeywordAsync(SourceCodeKind.Script,
Recommendations\UsingKeywordRecommenderTests.cs (6)
41await VerifyKeywordAsync(SourceCodeKind.Script, 51await VerifyKeywordAsync(SourceCodeKind.Script, 293await VerifyAbsenceAsync(SourceCodeKind.Regular, 303await VerifyAbsenceAsync(SourceCodeKind.Script, 313await VerifyAbsenceAsync(SourceCodeKind.Regular, 323await VerifyAbsenceAsync(SourceCodeKind.Script,
Recommendations\VarKeywordRecommenderTests.cs (4)
29await VerifyKeywordAsync(SourceCodeKind.Script, 36await VerifyKeywordAsync(SourceCodeKind.Script, 46await 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 (14)
35await VerifyKeywordAsync(SourceCodeKind.Script, 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 (4)
17await VerifyKeywordAsync(SourceCodeKind.Script, 24await VerifyKeywordAsync(SourceCodeKind.Script, 34await 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)
397var compilation = CreateCompilationWithMscorlib461(string.Empty, parseOptions: new CSharpParseOptions().WithKind(SourceCodeKind.Interactive));
Microsoft.CodeAnalysis.CSharp.Features (3)
ExtractMethod\CSharpSelectionValidator.cs (2)
96if (!localFunction && options is { Kind: SourceCodeKind.Regular }) 100if (localFunction && options is { Kind: SourceCodeKind.Script })
GenerateType\CSharpGenerateTypeService.cs (1)
235document.Document.SourceCodeKind == SourceCodeKind.Regular)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (4)
Diagnostics\AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest_NoEditor.cs (1)
16private 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)
5304new 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)
10251var comp = CreateCompilation(source, parseOptions: TestOptions.Regular9.WithKind(SourceCodeKind.Script)); 10263comp = 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); 78Assert.Equal(SourceCodeKind.Regular, options.Kind); 79Assert.Equal(SourceCodeKind.Regular, options.SpecifiedKind); 83options = new CSharpParseOptions(kind: SourceCodeKind.Regular); 84Assert.Equal(SourceCodeKind.Regular, options.Kind); 85Assert.Equal(SourceCodeKind.Regular, options.SpecifiedKind); 89options = new CSharpParseOptions(kind: SourceCodeKind.Script); 90Assert.Equal(SourceCodeKind.Script, options.Kind); 91Assert.Equal(SourceCodeKind.Script, options.SpecifiedKind); 96options = new CSharpParseOptions(kind: SourceCodeKind.Interactive); 97Assert.Equal(SourceCodeKind.Script, options.Kind); 98Assert.Equal(SourceCodeKind.Interactive, options.SpecifiedKind); 105options = new CSharpParseOptions(kind: (SourceCodeKind)int.MinValue); 106Assert.Equal(SourceCodeKind.Regular, options.Kind); 107Assert.Equal((SourceCodeKind)int.MinValue, options.SpecifiedKind); 117var options1 = new CSharpParseOptions(kind: SourceCodeKind.Script); 118var options2 = new CSharpParseOptions(kind: SourceCodeKind.Script); 124options1 = new CSharpParseOptions(kind: SourceCodeKind.Script); 125options2 = new CSharpParseOptions(kind: SourceCodeKind.Interactive); 134var options1 = new CSharpParseOptions(kind: SourceCodeKind.Script); 135var options2 = new CSharpParseOptions(kind: SourceCodeKind.Script); 141options1 = new CSharpParseOptions(kind: SourceCodeKind.Script); 142options2 = new CSharpParseOptions(kind: SourceCodeKind.Interactive); 152var options = new CSharpParseOptions(kind: SourceCodeKind.Interactive); 194var options = new CSharpParseOptions().WithKind(SourceCodeKind.Interactive);
Parsing\MemberDeclarationParsingTests.cs (1)
2256bool 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)
630if (((CSharpParseOptions)container.SyntaxTree.Options).Kind == SourceCodeKind.Script)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (1)
427=> 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)
113=> document.SourceCodeKind == SourceCodeKind.Regular ? ImmutableHashSet<string>.Empty : ImmutableHashSet.Create(PredefinedInteractiveTextViewRoles.InteractiveTextViewRole); 121SourceCodeKind sourceCodeKind, bool usePreviousCharAsTrigger, char? deletedCharTrigger, bool checkForAbsence, 129SourceCodeKind sourceCodeKind, ItemExpectation[] expectedResults, 282SourceCodeKind? SourceCodeKind = null) 313SourceCodeKind? sourceCodeKind, bool usePreviousCharAsTrigger, char? deletedCharTrigger, bool checkForAbsence, 318SourceCodeKind[] evaluatedSourceCodeKinds = sourceCodeKind.HasValue ? [sourceCodeKind.Value] : [SourceCodeKind.Regular, SourceCodeKind.Script]; 319foreach (var sourceKind in evaluatedSourceCodeKinds) 340string markup, SourceCodeKind? sourceCodeKind, char? deletedCharTrigger, bool usePreviousCharAsTrigger, 344SourceCodeKind[] evaluatedSourceCodeKinds = sourceCodeKind.HasValue ? [sourceCodeKind.Value] : [SourceCodeKind.Regular, SourceCodeKind.Script]; 345foreach (var sourceKind in evaluatedSourceCodeKinds) 377protected async Task VerifyCustomCommitProviderAsync(string markupBeforeCommit, string itemToCommit, string expectedCodeAfterCommit, SourceCodeKind? sourceCodeKind = null, char? commitChar = null) 391await VerifyCustomCommitProviderWorkerAsync(code, position, itemToCommit, expectedCodeAfterCommit, SourceCodeKind.Regular, commitChar); 392await VerifyCustomCommitProviderWorkerAsync(code, position, itemToCommit, expectedCodeAfterCommit, SourceCodeKind.Script, commitChar); 402SourceCodeKind? sourceCodeKind = null) 418await VerifyProviderCommitWorkerAsync(code, position, itemToCommit, expectedCodeAfterCommit, commitChar, SourceCodeKind.Regular); 419await VerifyProviderCommitWorkerAsync(code, position, itemToCommit, expectedCodeAfterCommit, commitChar, SourceCodeKind.Script); 431SourceCodeKind? sourceCodeKind = null, bool usePreviousCharAsTrigger = false, char? deletedCharTrigger = null, 448SourceCodeKind? sourceCodeKind = null, bool usePreviousCharAsTrigger = false, char? deletedCharTrigger = null, 462string markup, SourceCodeKind? sourceCodeKind = null, bool usePreviousCharAsTrigger = false, 471string markup, SourceCodeKind? sourceCodeKind = null, 482SourceCodeKind? sourceCodeKind = null, 506SourceCodeKind sourceCodeKind, 540char? deletedCharTrigger, bool? hasSuggestionModeItem, SourceCodeKind sourceCodeKind, 574bool? hasSuggestionModeItem, SourceCodeKind sourceCodeKind, 592protected virtual async Task VerifyCustomCommitProviderWorkerAsync(string codeBeforeCommit, int position, string itemToCommit, string expectedCodeAfterCommit, SourceCodeKind sourceCodeKind, char? commitChar = null) 715char? commitChar, SourceCodeKind sourceCodeKind) 1062string code, int position, string insertText, bool usePreviousCharAsTrigger, char? deletedCharTrigger, bool? hasSuggestionItem, SourceCodeKind sourceCodeKind, 1076SourceCodeKind sourceCodeKind, ItemExpectation[] expectedResults, 1086SourceCodeKind sourceCodeKind, ItemExpectation[] expectedResults, string partialItem, 1097SourceCodeKind sourceCodeKind, bool checkForAbsence, 1115SourceCodeKind sourceCodeKind, bool checkForAbsence, int? glyph, 1130SourceCodeKind sourceCodeKind, bool checkForAbsence, int? glyph, 1146SourceCodeKind sourceCodeKind, ItemExpectation[] expectedResults, 1165SourceCodeKind sourceCodeKind, ItemExpectation[] expectedResults, 1175SourceCodeKind sourceCodeKind, ItemExpectation[] expectedResults, 1186SourceCodeKind sourceCodeKind, bool checkForAbsence, int? glyph, 1211SourceCodeKind sourceCodeKind, bool checkForAbsence, int? glyph, 1225SourceCodeKind sourceCodeKind, ItemExpectation[] expectedResults, string partialItem, 1237SourceCodeKind sourceCodeKind, bool checkForAbsence, int? glyph, 1254SourceCodeKind sourceCodeKind = SourceCodeKind.Regular, 1265SourceCodeKind sourceCodeKind, 1312protected async Task VerifyCommitCharactersAsync(string initialMarkup, string textTypedSoFar, char[] validChars, char[] invalidChars = null, SourceCodeKind sourceCodeKind = SourceCodeKind.Regular) 1344string 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)
52SourceCodeKind? sourceCodeKind = null, 63await TestSignatureHelpWorkerAsync(markup, SourceCodeKind.Regular, experimental, expectedOrderedItemsOrNull, usePreviousCharAsTrigger); 64await TestSignatureHelpWorkerAsync(markup, SourceCodeKind.Script, experimental, expectedOrderedItemsOrNull, usePreviousCharAsTrigger); 70SourceCodeKind sourceCodeKind, 144protected virtual async Task VerifyCurrentParameterNameAsync(string markup, string expectedParameterName, SourceCodeKind? sourceCodeKind = null) 154await VerifyCurrentParameterNameWorkerAsync(markup, expectedParameterName, SourceCodeKind.Regular); 155await VerifyCurrentParameterNameWorkerAsync(markup, expectedParameterName, SourceCodeKind.Script); 165private 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)
52SourceCodeKind sourceCodeKind = SourceCodeKind.Regular, 85SourceCodeKind sourceCodeKind = SourceCodeKind.Regular,
Workspaces\EditorTestWorkspace.cs (4)
52SourceCodeKind sourceCodeKind = SourceCodeKind.Regular, 68SourceCodeKind 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 (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)
49SourceCodeKind sourceCodeKind = SourceCodeKind.Regular,
Microsoft.CodeAnalysis.Features (7)
ExtractMethod\Extensions.cs (1)
69return node.SyntaxTree.Options.Kind != SourceCodeKind.Regular;
GenerateType\AbstractGenerateTypeService.Editor.cs (2)
333SourceCodeKind.Regular, 344SourceCodeKind sourceCodeKind,
IntroduceVariable\AbstractIntroduceVariableService.State.cs (1)
311if (Document.Document.SourceCodeKind != SourceCodeKind.Regular)
Workspace\MiscellaneousFileUtilities.cs (3)
41parseOptions = parseOptions.WithKind(SourceCodeKind.Script); 48var sourceCodeKind = parseOptions?.Kind ?? SourceCodeKind.Regular; 71hasAllInformation: sourceCodeKind == SourceCodeKind.Script),
Microsoft.CodeAnalysis.Features.Test.Utilities (3)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (1)
372sourceCodeKind: 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 (2)
HostWorkspace\Razor\RazorDynamicFileInfoProvider.cs (2)
96SourceCodeKind.Regular, 104SourceCodeKind.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)
1353parseOptions:=New VisualBasicParseOptions(kind:=SourceCodeKind.Script)) 1363parseOptions:=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)
37=> 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)
830public void AddSourceFile(string fullPath, SourceCodeKind sourceCodeKind = SourceCodeKind.Regular, ImmutableArray<string> folders = default) 845SourceCodeKind sourceCodeKind = SourceCodeKind.Regular, 867public void AddAdditionalFile(string fullPath, SourceCodeKind sourceCodeKind = SourceCodeKind.Regular, ImmutableArray<string> folders = default) 883_analyzerConfigFiles.AddFile(fullPath, SourceCodeKind.Regular, folders: default);
Workspace\Solution\Document.cs (2)
56public SourceCodeKind SourceCodeKind => DocumentState.SourceCodeKind; 385public 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)
98public SourceCodeKind SourceCodeKind 386public 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)
922private static SourceCodeKind GetSourceCodeKind(ProjectState project) 923=> project.ParseOptions != null ? project.ParseOptions.Kind : SourceCodeKind.Regular; 1396public Solution WithDocumentSourceCodeKind(DocumentId documentId, SourceCodeKind sourceCodeKind) 1401if (sourceCodeKind == SourceCodeKind.Interactive) 1403sourceCodeKind = SourceCodeKind.Script;
Workspace\Solution\SolutionCompilationState.cs (1)
975DocumentId documentId, SourceCodeKind sourceCodeKind)
Workspace\Solution\SolutionState.cs (1)
1059public StateChange WithDocumentSourceCodeKind(DocumentId documentId, SourceCodeKind sourceCodeKind)
Workspace\Workspace.cs (2)
1348protected internal void OnDocumentSourceCodeKindChanged(DocumentId documentId, SourceCodeKind sourceCodeKind) 2051doc 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)
38SourceCodeKind sourceCodeKind = SourceCodeKind.Regular, 54SourceCodeKind sourceCodeKind = SourceCodeKind.Regular,
Workspaces\TestWorkspace_XmlConsumption.cs (5)
618var codeKind = SourceCodeKind.Regular; 623? SourceCodeKind.Regular 624: (SourceCodeKind)Enum.Parse(typeof(SourceCodeKind), attr.Value);
Workspaces\TestWorkspace`1.cs (9)
180SourceCodeKind sourceCodeKind = SourceCodeKind.Regular, 195SourceCodeKind sourceCodeKind = SourceCodeKind.Regular, 226return parseOptions.Kind == SourceCodeKind.Regular 232return parseOptions.Kind == SourceCodeKind.Regular 304public new void OnDocumentSourceCodeKindChanged(DocumentId documentId, SourceCodeKind sourceCodeKind) 752var document = CreateDocument(exportProvider, languageServices, code, submissionName, submissionName, cursorPosition, spans, SourceCodeKind.Script); 778var 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)
255Assert.Same(solution, solution.WithDocumentSourceCodeKind(documentId, SourceCodeKind.Regular)); 257var newSolution1 = solution.WithDocumentSourceCodeKind(documentId, SourceCodeKind.Script); 258Assert.Equal(SourceCodeKind.Script, newSolution1.GetRequiredDocument(documentId).SourceCodeKind); 260Assert.Throws<ArgumentOutOfRangeException>(() => solution.WithDocumentSourceCodeKind(documentId, (SourceCodeKind)(-1))); 262Assert.Throws<ArgumentNullException>(() => solution.WithDocumentSourceCodeKind(null!, SourceCodeKind.Script)); 263Assert.Throws<InvalidOperationException>(() => solution.WithDocumentSourceCodeKind(s_unrelatedDocumentId, SourceCodeKind.Script)); 275solution = solution.WithProjectParseOptions(projectId, CSharpParseOptions.Default.WithKind(SourceCodeKind.Script)); 278Assert.Equal(SourceCodeKind.Script, document1.DocumentState.ParseOptions?.Kind); 279Assert.Equal(SourceCodeKind.Script, document1.SourceCodeKind); 281var document2 = document1.WithSourceCodeKind(SourceCodeKind.Regular); 282Assert.Equal(SourceCodeKind.Regular, document2.DocumentState.ParseOptions?.Kind); 283Assert.Equal(SourceCodeKind.Regular, document2.SourceCodeKind); 293var newSolution = solution.WithDocumentSourceCodeKind(documentId, SourceCodeKind.Interactive); 294Assert.Equal(SourceCodeKind.Script, newSolution.GetDocument(documentId)!.SourceCodeKind); 1107sourceCodeKind: SourceCodeKind.Script, 1116sourceCodeKind: SourceCodeKind.Regular, 1126sourceCodeKind: SourceCodeKind.Script, 1135sourceCodeKind: SourceCodeKind.Regular, 1145sourceCodeKind: SourceCodeKind.Script, 1154sourceCodeKind: SourceCodeKind.Regular, 2363WithProjectParseOptions(projectId, new CSharpParseOptions(kind: SourceCodeKind.Script)); 2372Assert.Equal(SourceCodeKind.Script, document.SourceCodeKind); 2389WithProjectParseOptions(projectId, new CSharpParseOptions(kind: SourceCodeKind.Script)); 2404Assert.Equal(SourceCodeKind.Script, document.SourceCodeKind); 2419WithProjectParseOptions(projectId, new CSharpParseOptions(kind: SourceCodeKind.Script)); 2432Assert.Equal(SourceCodeKind.Script, document.SourceCodeKind); 2448WithProjectParseOptions(projectId, new CSharpParseOptions(kind: SourceCodeKind.Script)); 2461Assert.Equal(SourceCodeKind.Script, document2.SourceCodeKind); 2477WithProjectParseOptions(projectId, new CSharpParseOptions(kind: SourceCodeKind.Script)); 2497Assert.Equal(SourceCodeKind.Script, document2.SourceCodeKind); 2508WithProjectParseOptions(projectId, new CSharpParseOptions(kind: SourceCodeKind.Script)); 3817var newOptions = tree.Options.WithKind(SourceCodeKind.Script); 4902.AddDocument(DocumentInfo.Create(documentId, "Test", sourceCodeKind: SourceCodeKind.Script)); 4905Assert.Equal(SourceCodeKind.Script, document1.SourceCodeKind); 4908var document2 = document1.WithSourceCodeKind(SourceCodeKind.Regular); 4909Assert.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)
36AddFile(filePath, linkMetadata, SourceCodeKind.Regular);
Venus\ContainedLanguage.cs (1)
106sourceCodeKind: 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)
319document = document.WithSourceCodeKind(SourceCodeKind.Script);
StackDepthTest (1)
Program.cs (1)
77var parseOptions = new CSharpParseOptions(kind: SourceCodeKind.Regular, documentationMode: DocumentationMode.None);