3 writes to Kind
Microsoft.CodeAnalysis (1)
Compilation\ParseOptions.cs (1)
42this.Kind = kind.MapSpecifiedToEffectiveKind();
Microsoft.CodeAnalysis.CSharp (1)
CSharpParseOptions.cs (1)
96return new CSharpParseOptions(this) { SpecifiedKind = kind, Kind = effectiveKind };
Microsoft.CodeAnalysis.VisualBasic (1)
VisualBasicParseOptions.vb (1)
154Return New VisualBasicParseOptions(Me) With {.SpecifiedKind = kind, .Kind = effectiveKind}
87 references to Kind
Microsoft.CodeAnalysis (2)
Compilation\Compilation.cs (1)
1076Debug.Assert(tree.Options.Kind != SourceCodeKind.Script);
Compilation\DeterministicKeyBuilder.cs (1)
518writer.Write("kind", parseOptions.Kind);
Microsoft.CodeAnalysis.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (1)
37=> syntaxTree.Options.Kind != SourceCodeKind.Regular;
Microsoft.CodeAnalysis.CSharp (22)
Binder\Binder_Initializers.cs (1)
195Debug.Assert(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;
Compilation\CSharpCompilation.cs (1)
882if (this.IsSubmission && tree.Options.Kind == SourceCodeKind.Regular)
Compilation\SyntaxAndDeclarationManager.cs (2)
167var sourceCodeKind = tree.Options.Kind; 681var sourceCodeKind = tree.Options.Kind;
Compilation\SyntaxTreeSemanticModel.cs (2)
1299return this.SyntaxTree.Options.Kind == SourceCodeKind.Regular; 2310if (this.SyntaxTree.Options.Kind != SourceCodeKind.Regular)
CSharpParseOptions.cs (1)
80kind: other.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 ||
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.Features (2)
ExtractMethod\CSharpSelectionValidator.cs (2)
95if (localFunction && options is { Kind: SourceCodeKind.Script }) 101if (!localFunction && options is { Kind: SourceCodeKind.Regular })
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (22)
Parsing\CSharpParseOptionsTests.cs (6)
44TestProperty((old, value) => old.WithKind(value), opt => opt.Kind, SourceCodeKind.Script); 78Assert.Equal(SourceCodeKind.Regular, options.Kind); 84Assert.Equal(SourceCodeKind.Regular, options.Kind); 90Assert.Equal(SourceCodeKind.Script, options.Kind); 97Assert.Equal(SourceCodeKind.Script, options.Kind); 106Assert.Equal(SourceCodeKind.Regular, options.Kind);
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.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.Features (1)
ExtractMethod\Extensions.cs (1)
69return node.SyntaxTree.Options.Kind != SourceCodeKind.Regular;
Microsoft.CodeAnalysis.Test.Utilities (1)
Compilation\CompilationExtensions.cs (1)
367if (blockOperation.Syntax.SyntaxTree.Options.Kind != SourceCodeKind.Script)
Microsoft.CodeAnalysis.VisualBasic (9)
Binding\BinderFactory.vb (2)
36Return _tree.Options.Kind = SourceCodeKind.Script 165If node.Kind <> SyntaxKind.CompilationUnit OrElse _tree.Options.Kind = SourceCodeKind.Regular Then
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 (1)
67kind:=other.Kind,
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (16)
Parser\VisualBasicParseOptionsTests.vb (5)
246Assert.Equal(SourceCodeKind.Regular, options.Kind) 252Assert.Equal(SourceCodeKind.Regular, options.Kind) 258Assert.Equal(SourceCodeKind.Script, options.Kind) 265Assert.Equal(SourceCodeKind.Script, options.Kind) 272Assert.Equal(SourceCodeKind.Regular, options.Kind)
Syntax\SyntaxRewriterTests.vb (11)
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) 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) 689Assert.Equal(SourceCodeKind.Script, newTree.Options.Kind) 702Assert.Equal(SourceCodeKind.Script, newTree.Options.Kind)
Microsoft.CodeAnalysis.Workspaces (5)
Serialization\AbstractOptionsSerializationService.cs (1)
193writer.WriteInt32((int)options.Kind);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (1)
37=> syntaxTree.Options.Kind != SourceCodeKind.Regular;
Workspace\Solution\DocumentState.cs (2)
99=> ParseOptions?.Kind ?? Attributes.SourceCodeKind; 379Attributes.With(sourceCodeKind: options.Kind),
Workspace\Solution\SourceGeneratedDocumentState.cs (1)
87parseOptions.Kind,
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (3)
Workspaces\TestWorkspace_XmlCreation.cs (1)
221new XAttribute(KindAttributeName, parseOptions.Kind));
Workspaces\TestWorkspace`1.cs (2)
226return parseOptions.Kind == SourceCodeKind.Regular 232return parseOptions.Kind == SourceCodeKind.Regular