1 write to CodeWriter
Microsoft.CodeAnalysis.Razor.Compiler (1)
Language\CodeGeneration\CodeRenderingContext.cs (1)
63CodeWriter = new CodeWriter(options);
638 references to CodeWriter
Microsoft.AspNetCore.Mvc.Razor.Extensions.UnitTests (4)
InjectTargetExtensionTest.cs (2)
40context.CodeWriter.GetText().ToString()); 93context.CodeWriter.GetText().ToString());
ViewComponentTagHelperTargetExtensionTest.cs (2)
34var csharp = context.CodeWriter.GetText().ToString(); 92var csharp = context.CodeWriter.GetText().ToString();
Microsoft.AspNetCore.Razor.Language.UnitTests (91)
CodeGeneration\DesignTimeNodeWriterTest.cs (17)
36var csharp = context.CodeWriter.GetText().ToString(); 67var csharp = context.CodeWriter.GetText().ToString(); 104var csharp = context.CodeWriter.GetText().ToString(); 134var csharp = context.CodeWriter.GetText().ToString(); 162var csharp = context.CodeWriter.GetText().ToString(); 197var csharp = context.CodeWriter.GetText().ToString(); 229var csharp = context.CodeWriter.GetText().ToString(); 264var csharp = context.CodeWriter.GetText().ToString(); 294var csharp = context.CodeWriter.GetText().ToString(); 321var csharp = context.CodeWriter.GetText().ToString(); 355var csharp = context.CodeWriter.GetText().ToString(); 388var csharp = context.CodeWriter.GetText().ToString(); 420var csharp = context.CodeWriter.GetText().ToString(); 452var csharp = context.CodeWriter.GetText().ToString(); 502var csharp = context.CodeWriter.GetText().ToString(); 545var csharp = context.CodeWriter.GetText().ToString(); 576context.CodeWriter.WriteLine("MyExtensionNode");
CodeGeneration\LiteralRuntimeNodeWriterTest.cs (2)
26var csharp = context.CodeWriter.GetText().ToString(); 59var csharp = context.CodeWriter.GetText().ToString();
CodeGeneration\RuntimeNodeWriterTest.cs (23)
37var csharp = context.CodeWriter.GetText().ToString(); 62var csharp = context.CodeWriter.GetText().ToString(); 94var csharp = context.CodeWriter.GetText().ToString(); 126var csharp = context.CodeWriter.GetText().ToString(); 150var csharp = context.CodeWriter.GetText().ToString(); 186var csharp = context.CodeWriter.GetText().ToString(); 215var csharp = context.CodeWriter.GetText().ToString(); 254var csharp = context.CodeWriter.GetText().ToString(); 273var csharp = context.CodeWriter.GetText().ToString(); 296var csharp = context.CodeWriter.GetText().ToString(); 327var csharp = context.CodeWriter.GetText().ToString(); 354var csharp = context.CodeWriter.GetText().ToString(); 373var csharp = context.CodeWriter.GetText().ToString(); 393var csharp = context.CodeWriter.GetText().ToString(); 413var csharp = context.CodeWriter.GetText().ToString(); 438var csharp = context.CodeWriter.GetText().ToString(); 460var csharp = context.CodeWriter.GetText().ToString(); 488var csharp = context.CodeWriter.GetText().ToString(); 517var csharp = context.CodeWriter.GetText().ToString(); 543var csharp = context.CodeWriter.GetText().ToString(); 578var csharp = context.CodeWriter.GetText().ToString(); 609var csharp = context.CodeWriter.GetText().ToString(); 629var csharp = context.CodeWriter.GetText().ToString();
CodeGeneration\TagHelperHtmlAttributeRuntimeNodeWriterTest.cs (3)
38var csharp = context.CodeWriter.GetText().ToString(); 63var csharp = context.CodeWriter.GetText().ToString(); 97var csharp = context.CodeWriter.GetText().ToString();
Extensions\DefaultTagHelperTargetExtensionTest.cs (25)
83var csharp = context.CodeWriter.GetText().ToString(); 120var csharp = context.CodeWriter.GetText().ToString(); 156var csharp = context.CodeWriter.GetText().ToString(); 189var csharp = context.CodeWriter.GetText().ToString(); 219var csharp = context.CodeWriter.GetText().ToString(); 248var csharp = context.CodeWriter.GetText().ToString(); 298var csharp = context.CodeWriter.GetText().ToString(); 339var csharp = context.CodeWriter.GetText().ToString(); 386var csharp = context.CodeWriter.GetText().ToString(); 501var csharp = context.CodeWriter.GetText().ToString(); 546var csharp = context.CodeWriter.GetText().ToString(); 592var csharp = context.CodeWriter.GetText().ToString(); 647var csharp = context.CodeWriter.GetText().ToString(); 691var csharp = context.CodeWriter.GetText().ToString(); 736var csharp = context.CodeWriter.GetText().ToString(); 787var csharp = context.CodeWriter.GetText().ToString(); 831var csharp = context.CodeWriter.GetText().ToString(); 881var csharp = context.CodeWriter.GetText().ToString(); 938var csharp = context.CodeWriter.GetText().ToString(); 982var csharp = context.CodeWriter.GetText().ToString(); 1027var csharp = context.CodeWriter.GetText().ToString(); 1101var csharp = context.CodeWriter.GetText().ToString(); 1154var csharp = context.CodeWriter.GetText().ToString(); 1180var csharp = context.CodeWriter.GetText().ToString(); 1205var csharp = context.CodeWriter.GetText().ToString();
Extensions\DesignTimeDirectiveTargetExtensionTest.cs (7)
27var csharp = context.CodeWriter.GetText().ToString(); 58var csharp = context.CodeWriter.GetText().ToString(); 99var csharp = context.CodeWriter.GetText().ToString(); 140var csharp = context.CodeWriter.GetText().ToString(); 188var csharp = context.CodeWriter.GetText().ToString(); 239var csharp = context.CodeWriter.GetText().ToString(); 279var csharp = context.CodeWriter.GetText().ToString();
Extensions\MetadataAttributeTargetExtensionTest.cs (4)
35var csharp = context.CodeWriter.GetText().ToString(); 64var csharp = context.CodeWriter.GetText().ToString(); 92var csharp = context.CodeWriter.GetText().ToString().Trim(); 119var csharp = context.CodeWriter.GetText().ToString().Trim();
Extensions\PreallocatedAttributeTargetExtensionTest.cs (7)
32var csharp = context.CodeWriter.GetText().ToString(); 59var csharp = context.CodeWriter.GetText().ToString(); 91var csharp = context.CodeWriter.GetText().ToString(); 118var csharp = context.CodeWriter.GetText().ToString(); 165var csharp = context.CodeWriter.GetText().ToString(); 215var csharp = context.CodeWriter.GetText().ToString(); 280var csharp = context.CodeWriter.GetText().ToString();
Extensions\SectionTargetExtensionTest.cs (2)
44var output = context.CodeWriter.GetText().ToString(); 78var output = context.CodeWriter.GetText().ToString();
Extensions\TemplateTargetExtensionTest.cs (1)
45var output = context.CodeWriter.GetText().ToString();
Microsoft.AspNetCore.Razor.Test.Common (2)
Language\CodeGeneration\TestCodeRenderingContext.cs (2)
25context.SetVisitor(new RenderChildrenVisitor(context.CodeWriter)); 43context.SetVisitor(new RenderChildrenVisitor(context.CodeWriter));
Microsoft.CodeAnalysis.Razor.Compiler (541)
Language\CodeGeneration\CodeRenderingContext.cs (4)
75CodeWriter.Dispose(); 133var currentLocation = CodeWriter.Location with 135AbsoluteIndex = CodeWriter.Location.AbsoluteIndex + offset, 136CharacterIndex = CodeWriter.Location.CharacterIndex + offset
Language\CodeGeneration\CodeRenderingContextExtensions.cs (3)
58var writer = context.CodeWriter; 70var writer = context.CodeWriter; 121var writer = _context.CodeWriter;
Language\CodeGeneration\CodeWriterExtensions.cs (2)
692Debug.Assert(context == null || context.CodeWriter == writer); 798var writer = context.CodeWriter;
Language\CodeGeneration\DesignTimeNodeWriter.cs (20)
26context.CodeWriter.WriteUsing(node.Content); 31context.CodeWriter.WriteUsing(node.Content); 35context.CodeWriter.WriteLine("#line default"); 36context.CodeWriter.WriteLine("#line hidden"); 63context.CodeWriter.WritePadding(offset, node.Source, context); 64context.CodeWriter.WriteStartAssignment(DesignTimeDirectivePass.DesignTimeVariable); 71context.CodeWriter.Write(token.Content); 80context.CodeWriter.WriteLine(";"); 85context.CodeWriter.WriteStartAssignment(DesignTimeDirectivePass.DesignTimeVariable); 91context.CodeWriter.Write(token.Content); 100context.CodeWriter.WriteLine(";"); 106var writer = context.CodeWriter; 156context.CodeWriter.WritePadding(offset, firstChild.Source, context); 157context.CodeWriter.WriteStartAssignment(DesignTimeDirectivePass.DesignTimeVariable); 164context.CodeWriter.Write(token.Content); 173context.CodeWriter.WriteLine(";"); 178context.CodeWriter.WriteStartAssignment(DesignTimeDirectivePass.DesignTimeVariable); 188context.CodeWriter.Write(token.Content); 196context.CodeWriter.WriteLine(";"); 202var writer = context.CodeWriter;
Language\CodeGeneration\IntermediateNodeWriter.cs (1)
93var writer = context.CodeWriter;
Language\CodeGeneration\RuntimeNodeWriter.cs (28)
43context.CodeWriter.WriteUsing(node.Content, endLine: node.HasExplicitSemicolon); 47context.CodeWriter.WriteLine(";"); 51context.CodeWriter.WriteLine("#line default"); 52context.CodeWriter.WriteLine("#line hidden"); 57context.CodeWriter.WriteUsing(node.Content); 61context.CodeWriter.WriteLine("#line default"); 62context.CodeWriter.WriteLine("#line hidden"); 96context.CodeWriter.WriteStartMethodInvocation(WriteCSharpExpressionMethod); 100context.CodeWriter.Write(firstCSharpChild.Content); 117context.CodeWriter.Write(csharpToken.Content); 127context.CodeWriter.WriteEndMethodInvocation(); 149context.CodeWriter.WriteLine(); 160context.CodeWriter.Write(token.Content); 183context.CodeWriter 200context.CodeWriter 210context.CodeWriter 222context.CodeWriter.WriteStringLiteral(token.Content); 231context.CodeWriter 244context.CodeWriter 255context.CodeWriter 272context.CodeWriter 279context.CodeWriter.WriteStartNewObject(TemplateTypeName); 281using (context.CodeWriter.BuildAsyncLambda(ValueWriterName)) 288context.CodeWriter.WriteEndMethodInvocation(false); 290context.CodeWriter 354context.CodeWriter 363context.CodeWriter.WriteMethodInvocation(PushWriterMethod, writer); 368context.CodeWriter.WriteMethodInvocation(PopWriterMethod);
Language\Components\ComponentDesignTimeNodeWriter.cs (136)
75context.CodeWriter.WriteUsing(node.Content); 80context.CodeWriter.WriteUsing(node.Content); 84context.CodeWriter.WriteLine("#line default"); 85context.CodeWriter.WriteLine("#line hidden"); 123context.CodeWriter.WritePadding(offset, node.Source, context); 124context.CodeWriter.WriteStartAssignment(DesignTimeVariable); 128context.CodeWriter.Write("("); 129TypeNameHelper.WriteGloballyQualifiedName(context.CodeWriter, type); 130context.CodeWriter.Write(")"); 138context.CodeWriter.Write(token.Content); 147context.CodeWriter.WriteLine(";"); 152context.CodeWriter.WriteStartAssignment(DesignTimeVariable); 158context.CodeWriter.Write(token.Content); 167context.CodeWriter.WriteLine(";"); 190var writer = context.CodeWriter; 263context.CodeWriter.WriteStartAssignment(DesignTimeVariable); 278context.CodeWriter.WriteLine(";"); 308context.CodeWriter 317context.CodeWriter.WriteStartMethodInvocation($"{BuilderVariableName}.{ComponentsApi.RenderTreeBuilder.AddAttribute}"); 318context.CodeWriter.Write("-1"); 319context.CodeWriter.WriteParameterSeparator(); 420typeInferenceCaptureScope = context.CodeWriter.BuildScope(); 421context.CodeWriter.Write("global::"); 422context.CodeWriter.Write(node.TypeInferenceNode.FullTypeName); 423context.CodeWriter.Write("."); 424context.CodeWriter.Write(node.TypeInferenceNode.MethodName); 425context.CodeWriter.Write("_CaptureParameters("); 435context.CodeWriter.Write(", "); 439context.CodeWriter.Write(", out var "); 442context.CodeWriter.Write(variableName); 446context.CodeWriter.WriteLine(");"); 462context.CodeWriter.Write("var "); 463context.CodeWriter.Write(typeInferenceLocalName); 464context.CodeWriter.Write(" = "); 466context.CodeWriter.Write("global::"); 467context.CodeWriter.Write(node.TypeInferenceNode.FullTypeName); 468context.CodeWriter.Write("."); 469context.CodeWriter.Write(node.TypeInferenceNode.MethodName); 470context.CodeWriter.Write("("); 472context.CodeWriter.Write(BuilderVariableName); 473context.CodeWriter.Write(", "); 475context.CodeWriter.Write("-1"); 479context.CodeWriter.Write(", "); 483context.CodeWriter.Write("-1"); 484context.CodeWriter.Write(", "); 490context.CodeWriter.Write(");"); 491context.CodeWriter.WriteLine(); 519context.CodeWriter.WriteLine("#pragma warning restore BL0005"); 531context.CodeWriter.Write(DesignTimeVariable); 532context.CodeWriter.Write(" = "); 533context.CodeWriter.Write("typeof("); 534context.CodeWriter.Write("global::"); 537context.CodeWriter.Write(node.Component.Name); 547context.CodeWriter.Write(node.Component.TypeNamespace.AssumeNotNull()); 548context.CodeWriter.Write("."); 550context.CodeWriter.Write(node.TagName); 551context.CodeWriter.Write("<"); 555context.CodeWriter.Write(","); 557context.CodeWriter.Write(">"); 559context.CodeWriter.Write(");"); 560context.CodeWriter.WriteLine(); 597writeableValue.WriteTo(context.CodeWriter); 602context.CodeWriter.Write(valueExpression); 606context.CodeWriter.Write("!"); 613context.CodeWriter.Write(capturedVariable.VariableName); 643context.CodeWriter.Write(DesignTimeVariable); 644context.CodeWriter.Write(" = "); 649context.CodeWriter.Write(";"); 650context.CodeWriter.WriteLine(); 687context.CodeWriter.WriteLine("#pragma warning disable BL0005"); 695context.CodeWriter.Write("(("); 696TypeNameHelper.WriteGloballyQualifiedName(context.CodeWriter, componentNode.TypeName); 697context.CodeWriter.Write(")default)"); 708context.CodeWriter.Write(typeInferenceLocalName); 711context.CodeWriter.Write("."); 712context.CodeWriter.WriteLine(); 716context.CodeWriter.WritePadding(0, attributeSourceSpan, context); 717context.CodeWriter.WriteIdentifierEscapeIfNeeded(node.PropertyName); 719context.CodeWriter.WriteLine(node.PropertyName); 722context.CodeWriter.Write(" = default;"); 723context.CodeWriter.WriteLine(); 743context.CodeWriter.Write("true"); 748context.CodeWriter.Write("\"\""); 771context.CodeWriter.Write("new "); 773context.CodeWriter.Write("("); 775context.CodeWriter.WriteLine(); 781context.CodeWriter.Write(")"); 795context.CodeWriter.Write(ComponentsApi.RuntimeHelpers.TypeCheck); 796context.CodeWriter.Write("<"); 797QualifyEventCallback(context.CodeWriter, node.TypeName, explicitType); 798context.CodeWriter.Write(">"); 799context.CodeWriter.Write("("); 805context.CodeWriter.Write("global::"); 806context.CodeWriter.Write(ComponentsApi.EventCallback.FactoryAccessor); 807context.CodeWriter.Write("."); 808context.CodeWriter.Write(ComponentsApi.EventCallbackFactory.CreateMethod); 812context.CodeWriter.Write("<"); 815context.CodeWriter.Write(argument); 819TypeNameHelper.WriteGloballyQualifiedName(context.CodeWriter, argument); 822context.CodeWriter.Write(">"); 825context.CodeWriter.Write("("); 826context.CodeWriter.Write("this"); 827context.CodeWriter.Write(", "); 829context.CodeWriter.WriteLine(); 833context.CodeWriter.Write(")"); 837context.CodeWriter.Write(")"); 847context.CodeWriter.Write(ComponentsApi.RuntimeHelpers.TypeCheck); 848context.CodeWriter.Write("<"); 850context.CodeWriter.Write(">"); 851context.CodeWriter.Write("("); 858context.CodeWriter.Write(")"); 917context.CodeWriter.WriteParameterSeparator(); 918context.CodeWriter.Write("("); 920context.CodeWriter.Write(")("); 924context.CodeWriter.Write(")"); 925context.CodeWriter.WriteEndMethodInvocation(); 961context.CodeWriter.Write(DesignTimeVariable); 962context.CodeWriter.Write(" = "); 963context.CodeWriter.Write("typeof("); 967context.CodeWriter.Write(");"); 968context.CodeWriter.WriteLine(); 998var codeWriter = context.CodeWriter; 1019context.CodeWriter.WriteStartMethodInvocation($"{BuilderVariableName}.{ComponentsApi.RenderTreeBuilder.AddMultipleAttributes}"); 1020context.CodeWriter.Write("-1"); 1021context.CodeWriter.WriteParameterSeparator(); 1025context.CodeWriter.WriteEndMethodInvocation(); 1030var writer = context.CodeWriter; 1057context.CodeWriter.Write(ComponentsApi.RuntimeHelpers.TypeCheck); 1058context.CodeWriter.Write("<string>("); 1062context.CodeWriter.WriteLine(");"); 1116using (context.CodeWriter.BuildLambda(RefCaptureParamName)) 1135context.CodeWriter.Write($"{DesignTimeVariable} = (global::{ComponentsApi.IComponentRenderMode.FullTypeName})("); 1143context.CodeWriter.WriteLine(");"); 1171context.CodeWriter.Write(token.Content); 1177context.CodeWriter.WritePadding(0, token.Source.Value, context); 1179context.CodeWriter.Write(token.Content);
Language\Components\ComponentInjectIntermediateNode.cs (1)
78context.CodeWriter.WriteAutoPropertyDeclaration(
Language\Components\ComponentNodeWriter.cs (57)
111var writer = context.CodeWriter; 165context.CodeWriter.Write(ComponentsApi.RenderTreeBuilder.BuilderParameter); 166context.CodeWriter.Write("."); 167context.CodeWriter.Write(ComponentsApi.RenderTreeBuilder.OpenComponent); 168context.CodeWriter.Write("<"); 174context.CodeWriter.Write(genericTypeParameterList); 178context.CodeWriter.Write(node.Component.TypeName); 181context.CodeWriter.Write(">("); 182context.CodeWriter.Write("seq"); 183context.CodeWriter.Write(");"); 184context.CodeWriter.WriteLine(); 193context.CodeWriter.WriteStartInstanceMethodInvocation(ComponentsApi.RenderTreeBuilder.BuilderParameter, GetAddComponentParameterMethodName(context)); 194context.CodeWriter.Write(parameter.SeqName.AssumeNotNull()); 195context.CodeWriter.Write(", "); 197context.CodeWriter.Write(", "); 201context.CodeWriter.Write("(object)"); 204context.CodeWriter.Write(parameter.ParameterName); 205context.CodeWriter.WriteEndMethodInvocation(); 209context.CodeWriter.WriteStartInstanceMethodInvocation(ComponentsApi.RenderTreeBuilder.BuilderParameter, ComponentsApi.RenderTreeBuilder.AddMultipleAttributes); 210context.CodeWriter.Write(parameter.SeqName.AssumeNotNull()); 211context.CodeWriter.Write(", "); 213context.CodeWriter.Write(parameter.ParameterName); 214context.CodeWriter.WriteEndMethodInvocation(); 218context.CodeWriter.WriteStartInstanceMethodInvocation(ComponentsApi.RenderTreeBuilder.BuilderParameter, GetAddComponentParameterMethodName(context)); 219context.CodeWriter.Write(parameter.SeqName.AssumeNotNull()); 220context.CodeWriter.Write(", "); 222context.CodeWriter.Write($"\"{childContent.AttributeName}\""); 223context.CodeWriter.Write(", "); 227context.CodeWriter.Write("(object)"); 230context.CodeWriter.Write(parameter.ParameterName); 231context.CodeWriter.WriteEndMethodInvocation(); 235context.CodeWriter.WriteStartInstanceMethodInvocation(ComponentsApi.RenderTreeBuilder.BuilderParameter, ComponentsApi.RenderTreeBuilder.SetKey); 236context.CodeWriter.Write(parameter.ParameterName); 237context.CodeWriter.WriteEndMethodInvocation(); 245context.CodeWriter.WriteStartInstanceMethodInvocation(ComponentsApi.RenderTreeBuilder.BuilderParameter, methodName); 246context.CodeWriter.Write(parameter.SeqName.AssumeNotNull()); 247context.CodeWriter.Write(", "); 250context.CodeWriter.Write($"(__value) => {{ {parameter.ParameterName}({cast}__value); }}"); 251context.CodeWriter.WriteEndMethodInvocation(); 272context.CodeWriter.WriteInstanceMethodInvocation(ComponentsApi.RenderTreeBuilder.BuilderParameter, ComponentsApi.RenderTreeBuilder.CloseComponent); 381context.CodeWriter.Write("nameof("); 382TypeNameHelper.WriteGloballyQualifiedName(context.CodeWriter, containingType); 383context.CodeWriter.Write("."); 391context.CodeWriter.WriteIdentifierEscapeIfNeeded(attribute.PropertyName); 392context.CodeWriter.WriteLine(attribute.PropertyName); 397context.CodeWriter.Write(attribute.PropertyName); 399context.CodeWriter.Write(")"); 403context.CodeWriter.WriteStringLiteral(attribute.AttributeName); 513=> context.CodeWriter.WriteLine($"{builderName}.{ComponentsApi.RenderTreeBuilder.AddComponentRenderMode}({renderModeName});"); 519context.CodeWriter.Write(node.TypeName); 523context.CodeWriter.Write(typeName); 527TypeNameHelper.WriteGloballyQualifiedName(context.CodeWriter, node.TypeName); 536context.CodeWriter.Write(typeName); 540TypeNameHelper.WriteGloballyQualifiedName(context.CodeWriter, node.TypeName); 554context.CodeWriter.Write(nonGenericTypeName[0..lastColon]); 566context.CodeWriter.Write(nonGenericTypeName[0..lastDot]); 575context.CodeWriter.Write(nonGenericTypeName);
Language\Components\ComponentRuntimeNodeWriter.cs (133)
60context.CodeWriter.WriteLine(); 93context.CodeWriter 100context.CodeWriter.Write(firstCSharpChild.Content); 125context.CodeWriter.WriteEndMethodInvocation(); 157context.CodeWriter 177context.CodeWriter 223context.CodeWriter.WriteLine($"{BuilderVariableName}.{ComponentsApi.RenderTreeBuilder.AddNamedEvent}(\"onsubmit\", {FormNameVariableName});"); 233context.CodeWriter 254context.CodeWriter 298context.CodeWriter 322context.CodeWriter.WriteUsing(node.Content, endLine: node.HasExplicitSemicolon); 326context.CodeWriter.WriteLine(";"); 330context.CodeWriter.WriteLine("#line default"); 331context.CodeWriter.WriteLine("#line hidden"); 336context.CodeWriter.WriteUsing(node.Content, endLine: true); 340context.CodeWriter.WriteLine("#line default"); 341context.CodeWriter.WriteLine("#line hidden"); 376context.CodeWriter.Write(BuilderVariableName); 377context.CodeWriter.Write("."); 378context.CodeWriter.Write(ComponentsApi.RenderTreeBuilder.OpenComponent); 379context.CodeWriter.Write("<"); 382TypeNameHelper.WriteGlobalPrefixIfNeeded(context.CodeWriter, nonGenericTypeName); 387context.CodeWriter.Write("<"); 394context.CodeWriter.Write(", "); 397context.CodeWriter.Write(">"); 400context.CodeWriter.Write(">("); 401context.CodeWriter.WriteIntegerLiteral(_sourceSequence++); 402context.CodeWriter.Write(");"); 403context.CodeWriter.WriteLine(); 452context.CodeWriter.Write(BuilderVariableName); 453context.CodeWriter.Write("."); 454context.CodeWriter.Write(ComponentsApi.RenderTreeBuilder.CloseComponent); 455context.CodeWriter.Write("();"); 456context.CodeWriter.WriteLine(); 469typeInferenceCaptureScope = context.CodeWriter.BuildScope(); 470TypeNameHelper.WriteGloballyQualifiedName(context.CodeWriter, node.TypeInferenceNode.FullTypeName); 471context.CodeWriter.Write("."); 472context.CodeWriter.Write(node.TypeInferenceNode.MethodName); 473context.CodeWriter.Write("_CaptureParameters("); 483context.CodeWriter.Write(", "); 487context.CodeWriter.Write(", out var "); 490context.CodeWriter.Write(variableName); 494context.CodeWriter.WriteLine(");"); 503TypeNameHelper.WriteGloballyQualifiedName(context.CodeWriter, node.TypeInferenceNode.FullTypeName); 504context.CodeWriter.Write("."); 505context.CodeWriter.Write(node.TypeInferenceNode.MethodName); 506context.CodeWriter.Write("("); 508context.CodeWriter.Write(BuilderVariableName); 509context.CodeWriter.Write(", "); 511context.CodeWriter.WriteIntegerLiteral(_sourceSequence++); 515context.CodeWriter.Write(", "); 519context.CodeWriter.WriteIntegerLiteral(_sourceSequence++); 520context.CodeWriter.Write(", "); 526context.CodeWriter.Write(");"); 527context.CodeWriter.WriteLine(); 535context.CodeWriter.Write(localToClear.VariableName); 536context.CodeWriter.WriteLine(" = default;"); 577writeableValue.WriteTo(context.CodeWriter); 582context.CodeWriter.Write(valueExpression); 586context.CodeWriter.Write("!"); 593context.CodeWriter.Write(capturedVariable.VariableName); 624context.CodeWriter.Write(BuilderVariableName); 625context.CodeWriter.Write("."); 626context.CodeWriter.Write(addAttributeMethod); 627context.CodeWriter.Write("("); 628context.CodeWriter.WriteIntegerLiteral(_sourceSequence++); 629context.CodeWriter.Write(", "); 632context.CodeWriter.Write(", "); 636context.CodeWriter.Write("(object)("); 643context.CodeWriter.Write(")"); 646context.CodeWriter.Write(");"); 647context.CodeWriter.WriteLine(); 656context.CodeWriter.Write(" _ = "); 658context.CodeWriter.WriteLine(";"); 672context.CodeWriter.Write("true"); 678context.CodeWriter.WriteStringLiteral(content); 689context.CodeWriter.Write("("); 691context.CodeWriter.Write(")"); 692context.CodeWriter.Write("("); 699context.CodeWriter.Write(")"); 708context.CodeWriter.Write(ComponentsApi.RuntimeHelpers.TypeCheck); 709context.CodeWriter.Write("<"); 710QualifyEventCallback(context.CodeWriter, node.TypeName, explicitType); 711context.CodeWriter.Write(">"); 712context.CodeWriter.Write("("); 718context.CodeWriter.Write("global::"); 719context.CodeWriter.Write(ComponentsApi.EventCallback.FactoryAccessor); 720context.CodeWriter.Write("."); 721context.CodeWriter.Write(ComponentsApi.EventCallbackFactory.CreateMethod); 725context.CodeWriter.Write("<"); 728context.CodeWriter.Write(argument); 732TypeNameHelper.WriteGloballyQualifiedName(context.CodeWriter, argument); 734context.CodeWriter.Write(">"); 737context.CodeWriter.Write("("); 738context.CodeWriter.Write("this"); 739context.CodeWriter.Write(", "); 743context.CodeWriter.Write(")"); 747context.CodeWriter.Write(")"); 754context.CodeWriter.Write(ComponentsApi.RuntimeHelpers.TypeCheck); 755context.CodeWriter.Write("<"); 757context.CodeWriter.Write(">"); 758context.CodeWriter.Write("("); 765context.CodeWriter.Write(")"); 830context.CodeWriter.WriteParameterSeparator(); 831context.CodeWriter.Write("("); 833context.CodeWriter.Write(")("); 837context.CodeWriter.Write(")"); 838context.CodeWriter.WriteEndMethodInvocation(); 891var codeWriter = context.CodeWriter; 912context.CodeWriter.WriteStartMethodInvocation($"{BuilderVariableName}.{ComponentsApi.RenderTreeBuilder.AddMultipleAttributes}"); 913context.CodeWriter.WriteIntegerLiteral(_sourceSequence++); 914context.CodeWriter.WriteParameterSeparator(); 918context.CodeWriter.WriteEndMethodInvocation(); 923var writer = context.CodeWriter; 949context.CodeWriter.Write($"string {FormNameVariableName} = {ComponentsApi.RuntimeHelpers.TypeCheck}<string>("); 951context.CodeWriter.WriteLine(");"); 961var codeWriter = context.CodeWriter; 986using (context.CodeWriter.BuildLambda(RefCaptureParamName)) 1006context.CodeWriter.Write($"global::{ComponentsApi.IComponentRenderMode.FullTypeName} {RenderModeVariableName} = "); 1014context.CodeWriter.WriteLine(";"); 1023context.CodeWriter.WriteParameterSeparator(); 1030context.CodeWriter.WriteParameterSeparator(); 1031context.CodeWriter.WriteBooleanLiteral(true); 1034context.CodeWriter.WriteEndMethodInvocation(); 1043context.CodeWriter.WriteParameterSeparator(); 1047context.CodeWriter.WriteEndMethodInvocation(); 1052context.CodeWriter 1061context.CodeWriter.WriteStartMethodInvocation($"{BuilderVariableName}.{ComponentsApi.RenderTreeBuilder.AddAttribute}"); 1062context.CodeWriter.WriteIntegerLiteral(_sourceSequence++); 1063context.CodeWriter.WriteParameterSeparator(); 1104var writer = context.CodeWriter; 1225context.CodeWriter.Write(token.Content); 1231context.CodeWriter.Write(token.Content);
Language\Components\RouteAttributeExtensionNode.cs (8)
19context.CodeWriter.Write("[global::"); 20context.CodeWriter.Write(ComponentsApi.RouteAttribute.FullTypeName); 23context.CodeWriter.Write("("); 24context.CodeWriter.Write(Template); 28context.CodeWriter.WriteLine("("); 29context.CodeWriter.WriteLine("// language=Route,Component"); 32context.CodeWriter.WriteLine(Template); 35context.CodeWriter.WriteLine(")]");
Language\Components\ScopeStack.cs (1)
49context.CodeWriter.WriteLambdaHeader(parameterName);
Language\Components\ScopeStack.Entry.cs (1)
30_scope = context.CodeWriter.BuildLambda(BuilderVariableName);
Language\DefaultRazorCSharpLoweringPhase.cs (2)
50var text = context.CodeWriter.GetText(); 69private CodeWriter CodeWriter => _context.CodeWriter;
Language\Extensions\DefaultTagHelperTargetExtension.cs (55)
94context.CodeWriter 104context.CodeWriter.WriteStringLiteral(node.TagName) 111using (context.CodeWriter.BuildAsyncLambda()) 117context.CodeWriter.WriteEndMethodInvocation(); 129context.CodeWriter 136context.CodeWriter.WriteInstanceMethodInvocation( 154context.CodeWriter 166context.CodeWriter 169using (context.CodeWriter.BuildScope()) 171context.CodeWriter 178context.CodeWriter 222context.CodeWriter 235context.CodeWriter 247context.CodeWriter.WriteMethodInvocation(BeginWriteTagHelperAttributeMethodName); 254context.CodeWriter 288context.CodeWriter 290using (context.CodeWriter.BuildScope()) 294context.CodeWriter 320WritePropertyAccessorStartAssignment(context.CodeWriter, node); 322WritePropertyAccessor(context.CodeWriter, firstUseOfAttribute) 335WritePropertyAccessorStartAssignment(context.CodeWriter, node); 339context.CodeWriter.WriteStringLiteral(content); 343context.CodeWriter.Write("string.Empty"); 345context.CodeWriter.WriteLine(";"); 349context.CodeWriter.WriteMethodInvocation(BeginWriteTagHelperAttributeMethodName); 353context.CodeWriter 357WritePropertyAccessorStartAssignment(context.CodeWriter, node) 379context.CodeWriter.WritePadding(assignmentPrefixLength, node.Source, context); 382WritePropertyAccessorStartAssignment(context.CodeWriter, node) 389context.CodeWriter.WritePadding(assignmentPrefixLength, node.Source, context); 392WritePropertyAccessorStartAssignment(context.CodeWriter, node); 400context.CodeWriter.Write("true"); 407context.CodeWriter.WriteLine(";"); 412WritePropertyAccessorStartAssignment(context.CodeWriter, node); 417context.CodeWriter 426context.CodeWriter.Write("true"); 433context.CodeWriter.WriteLine(";"); 440context.CodeWriter 447WritePropertyAccessor(context.CodeWriter, node) 456context.CodeWriter.WriteLine("#line hidden"); 457context.CodeWriter.WriteField(s_fieldUninitializedModifiers, s_privateModifiers, ExecutionContextTypeName, ExecutionContextVariableName); 459context.CodeWriter 464context.CodeWriter.WriteField(s_fieldUnusedModifiers, s_privateModifiers, "string", StringValueBufferVariableName); 467context.CodeWriter 474context.CodeWriter 477using (context.CodeWriter.BuildScope()) 479context.CodeWriter.WriteLine("get"); 480using (context.CodeWriter.BuildScope()) 482context.CodeWriter 485using (context.CodeWriter.BuildScope()) 487context.CodeWriter 496context.CodeWriter 537context.CodeWriter.Write(token.Content); 543context.CodeWriter.Write(token.Content); 621uniqueId = checksum + context.CodeWriter.Location.AbsoluteIndex;
Language\Extensions\DesignTimeDirectiveTargetExtension.cs (28)
19context.CodeWriter 31context.CodeWriter 57context.CodeWriter 61using (context.CodeWriter.BuildLambda()) 63var originalIndent = context.CodeWriter.CurrentIndent; 64context.CodeWriter.CurrentIndent = 0; 80context.CodeWriter 88context.CodeWriter.Write("!"); 91context.CodeWriter.WriteLine(";"); 113context.CodeWriter 119context.CodeWriter 125context.CodeWriter.Write("!"); 128context.CodeWriter.WriteLine(";"); 145context.CodeWriter 151context.CodeWriter.Write("nameof("); 154context.CodeWriter 173context.CodeWriter.Write("// language=").Write(stringSyntax); 179context.CodeWriter 188context.CodeWriter.Write(node.Content); 192context.CodeWriter.Write("\""); 194context.CodeWriter 199context.CodeWriter.WriteLine(";"); 207context.CodeWriter 214context.CodeWriter.Write(node.Content); 215context.CodeWriter.WriteLine(";"); 219context.CodeWriter.CurrentIndent = originalIndent; 221context.CodeWriter.WriteLine("))();"); 237context.CodeWriter.Write(" ");
Language\Extensions\MetadataAttributeTargetExtension.cs (29)
33context.CodeWriter.Write("[assembly: "); 34context.CodeWriter.Write(CompiledItemAttributeName); 35context.CodeWriter.Write("(typeof("); 36context.CodeWriter.Write(node.TypeName); 37context.CodeWriter.Write("), @\""); 38context.CodeWriter.Write(node.Kind); 39context.CodeWriter.Write("\", @\""); 40context.CodeWriter.Write(node.Identifier); 41context.CodeWriter.WriteLine("\")]"); 57context.CodeWriter.Write("["); 58context.CodeWriter.Write(CompiledItemMetadataAttributeName); 59context.CodeWriter.Write("("); 60context.CodeWriter.WriteStringLiteral(node.Key); 61context.CodeWriter.Write(", "); 64context.CodeWriter.WriteLine(); 67context.CodeWriter.Write("// language="); 68context.CodeWriter.WriteLine(node.ValueStringSyntax); 73context.CodeWriter.WriteStringLiteral(node.Value); 78context.CodeWriter.WriteStringLiteral(node.Value); 80context.CodeWriter.WriteLine(")]"); 96context.CodeWriter.Write("["); 97context.CodeWriter.Write(SourceChecksumAttributeName); 98context.CodeWriter.Write("(@\""); 99context.CodeWriter.Write(node.ChecksumAlgorithm.ToString()); 100context.CodeWriter.Write("\", @\""); 101context.CodeWriter.Write(ChecksumUtilities.BytesToString(node.Checksum)); 102context.CodeWriter.Write("\", @\""); 103context.CodeWriter.Write(node.Identifier); 104context.CodeWriter.WriteLine("\")]");
Language\Extensions\PreallocatedAttributeTargetExtension.cs (9)
29context.CodeWriter 40context.CodeWriter.WriteEndMethodInvocation(); 44context.CodeWriter 63context.CodeWriter 71context.CodeWriter 100context.CodeWriter 106using (context.CodeWriter.BuildScope()) 110context.CodeWriter 124context.CodeWriter
Language\Extensions\SectionTargetExtension.cs (4)
21context.CodeWriter 29using (context.CodeWriter.BuildAsyncLambda(DefaultWriterName)) 36using (context.CodeWriter.BuildAsyncLambda()) 42context.CodeWriter.WriteEndMethodInvocation(endLine: true);
Language\Extensions\TemplateTargetExtension.cs (3)
21context.CodeWriter 25using (context.CodeWriter.BuildAsyncLambda(TemplateWriterName)) 34context.CodeWriter.WriteEndMethodInvocation(endLine: false);
Mvc.Version1_X\LegacySectionTargetExtension.cs (3)
20context.CodeWriter 26using (context.CodeWriter.BuildAsyncLambda(DefaultWriterName)) 31context.CodeWriter.WriteEndMethodInvocation(endLine: true);
Mvc\CreateNewOnMetadataUpdateAttributePass.cs (1)
74context.CodeWriter
Mvc\InjectTargetExtension.cs (5)
39context.CodeWriter.WriteLine(RazorInjectAttribute); 41context.CodeWriter.WriteAutoPropertyDeclaration(["public"], node.TypeName, memberName, node.TypeSource, node.MemberSource, context, privateSetter: true, defaultValue: true); 68context.CodeWriter.WriteLine("#nullable restore"); 71context.CodeWriter 77context.CodeWriter.WriteLine("#nullable disable");
Mvc\ViewComponentTagHelperTargetExtension.cs (1)
40WriteProcessInvokeAsyncArgsMethodString(context.CodeWriter, node.TagHelper);
Mvc\ViewComponentTagHelperTargetExtensionBase.cs (6)
51WriteTargetElementString(context.CodeWriter, node.TagHelper); 54using (context.CodeWriter.BuildClassDeclaration( 63context.CodeWriter.WriteFieldDeclaration( 69WriteConstructorString(context.CodeWriter, node.ClassName); 72WriteAttributeDeclarations(context.CodeWriter, node.TagHelper); 75WriteProcessMethodString(context.CodeWriter, node.TagHelper);