Add Razor design time code generation.
- Added a common csharp rendering phase base to put shared assets of runtime and design time code gen. - Added a new `DesignTimeIRPass` to setup the IR bits to provide accurate intellisense. - Added a `CodeGenerationIntegrationTest` and moved the RuntimeCodeGenerationTests into it. This way we can re-use the cshtml files and it makes searching/running the tests easy.. - Updated how line mappings are calculated for some nodes. #848
This commit is contained in:
parent
af499794c5
commit
f47a40a4a7
|
|
@ -1,9 +1,13 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Razor.Evolution.Intermediate;
|
||||
using Microsoft.AspNetCore.Razor.Evolution.Legacy;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution
|
||||
{
|
||||
internal class DefaultRazorDesignTimeCSharpLoweringPhase : RazorEnginePhaseBase, IRazorCSharpLoweringPhase
|
||||
internal class DefaultRazorDesignTimeCSharpLoweringPhase : RazorCSharpLoweringPhaseBase
|
||||
{
|
||||
protected override void ExecuteCore(RazorCodeDocument codeDocument)
|
||||
{
|
||||
|
|
@ -13,7 +17,196 @@ namespace Microsoft.AspNetCore.Razor.Evolution
|
|||
var syntaxTree = codeDocument.GetSyntaxTree();
|
||||
ThrowForMissingDependency(syntaxTree);
|
||||
|
||||
// Render design time CSharp
|
||||
var renderingContext = new CSharpRenderingContext()
|
||||
{
|
||||
Writer = new CSharpCodeWriter(),
|
||||
SourceDocument = codeDocument.Source,
|
||||
Options = syntaxTree.Options,
|
||||
};
|
||||
var visitor = new CSharpRenderer(renderingContext);
|
||||
visitor.VisitDocument(irDocument);
|
||||
var csharpDocument = new RazorCSharpDocument()
|
||||
{
|
||||
GeneratedCode = renderingContext.Writer.GenerateCode(),
|
||||
LineMappings = renderingContext.LineMappings,
|
||||
};
|
||||
|
||||
codeDocument.SetCSharpDocument(csharpDocument);
|
||||
}
|
||||
|
||||
private class CSharpRenderer : PageStructureCSharpRenderer
|
||||
{
|
||||
public CSharpRenderer(CSharpRenderingContext context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
public override void VisitCSharpToken(CSharpTokenIRNode node)
|
||||
{
|
||||
Context.Writer.Write(node.Content);
|
||||
}
|
||||
|
||||
public override void VisitCSharpExpression(CSharpExpressionIRNode node)
|
||||
{
|
||||
if (node.Children.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (node.SourceRange != null)
|
||||
{
|
||||
using (new LinePragmaWriter(Context.Writer, node.SourceRange))
|
||||
{
|
||||
var padding = BuildOffsetPadding(RazorDesignTimeIRPass.DesignTimeVariable.Length, node.SourceRange, Context);
|
||||
|
||||
Context.Writer
|
||||
.Write(padding)
|
||||
.WriteStartAssignment(RazorDesignTimeIRPass.DesignTimeVariable);
|
||||
|
||||
for (var i = 0; i < node.Children.Count; i++)
|
||||
{
|
||||
var childNode = node.Children[i];
|
||||
|
||||
if (childNode is CSharpTokenIRNode)
|
||||
{
|
||||
AddLineMappingFor(childNode);
|
||||
}
|
||||
|
||||
childNode.Accept(this);
|
||||
}
|
||||
|
||||
Context.Writer.WriteLine(";");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Context.Writer.WriteStartAssignment(RazorDesignTimeIRPass.DesignTimeVariable);
|
||||
VisitDefault(node);
|
||||
Context.Writer.WriteLine(";");
|
||||
}
|
||||
}
|
||||
|
||||
public override void VisitUsingStatement(UsingStatementIRNode node)
|
||||
{
|
||||
Context.Writer.WriteUsing(node.Content);
|
||||
}
|
||||
|
||||
public override void VisitCSharpStatement(CSharpStatementIRNode node)
|
||||
{
|
||||
if (node.SourceRange != null)
|
||||
{
|
||||
using (new LinePragmaWriter(Context.Writer, node.SourceRange))
|
||||
{
|
||||
var padding = BuildOffsetPadding(0, node.SourceRange, Context);
|
||||
Context.Writer.Write(padding);
|
||||
|
||||
AddLineMappingFor(node);
|
||||
Context.Writer.Write(node.Content);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Context.Writer.WriteLine(node.Content);
|
||||
}
|
||||
}
|
||||
|
||||
public override void VisitDirectiveToken(DirectiveTokenIRNode node)
|
||||
{
|
||||
const string TypeHelper = "__typeHelper";
|
||||
|
||||
var tokenKind = node.Descriptor.Kind;
|
||||
if (node.SourceRange == null || node.Descriptor.Kind == DirectiveTokenKind.Literal)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Wrap the directive token in a lambda to isolate variable names.
|
||||
Context.Writer
|
||||
.Write("((")
|
||||
.Write(typeof(Action).FullName)
|
||||
.Write(")(");
|
||||
using (Context.Writer.BuildLambda(endLine: false))
|
||||
{
|
||||
var originalIndent = Context.Writer.CurrentIndent;
|
||||
Context.Writer.ResetIndent();
|
||||
switch (tokenKind)
|
||||
{
|
||||
case DirectiveTokenKind.Type:
|
||||
|
||||
AddLineMappingFor(node);
|
||||
Context.Writer
|
||||
.Write(node.Content)
|
||||
.Write(" ")
|
||||
.WriteStartAssignment(TypeHelper)
|
||||
.WriteLine("null;");
|
||||
break;
|
||||
case DirectiveTokenKind.Member:
|
||||
Context.Writer
|
||||
.Write(typeof(object).FullName)
|
||||
.Write(" ");
|
||||
|
||||
AddLineMappingFor(node);
|
||||
Context.Writer
|
||||
.Write(node.Content)
|
||||
.WriteLine(" = null;");
|
||||
break;
|
||||
case DirectiveTokenKind.String:
|
||||
Context.Writer
|
||||
.Write(typeof(object).FullName)
|
||||
.Write(" ")
|
||||
.WriteStartAssignment(TypeHelper);
|
||||
|
||||
if (node.Content.StartsWith("\"", StringComparison.Ordinal))
|
||||
{
|
||||
AddLineMappingFor(node);
|
||||
Context.Writer.Write(node.Content);
|
||||
}
|
||||
else
|
||||
{
|
||||
Context.Writer.Write("\"");
|
||||
AddLineMappingFor(node);
|
||||
Context.Writer
|
||||
.Write(node.Content)
|
||||
.Write("\"");
|
||||
}
|
||||
|
||||
Context.Writer.WriteLine(";");
|
||||
break;
|
||||
}
|
||||
Context.Writer.SetIndent(originalIndent);
|
||||
}
|
||||
Context.Writer.WriteLine("))();");
|
||||
|
||||
}
|
||||
|
||||
public override void VisitTemplate(TemplateIRNode node)
|
||||
{
|
||||
const string ItemParameterName = "item";
|
||||
const string TemplateWriterName = "__razor_template_writer";
|
||||
|
||||
Context.Writer
|
||||
.Write(ItemParameterName).Write(" => ")
|
||||
.WriteStartNewObject("HelperResult" /* ORIGINAL: TemplateTypeName */);
|
||||
|
||||
var initialRenderingConventions = Context.RenderingConventions;
|
||||
var redirectConventions = new CSharpRedirectRenderingConventions(TemplateWriterName, Context.Writer);
|
||||
Context.RenderingConventions = redirectConventions;
|
||||
using (Context.Writer.BuildAsyncLambda(endLine: false, parameterNames: TemplateWriterName))
|
||||
{
|
||||
VisitDefault(node);
|
||||
}
|
||||
Context.RenderingConventions = initialRenderingConventions;
|
||||
|
||||
Context.Writer.WriteEndMethodInvocation(endLine: false);
|
||||
}
|
||||
|
||||
private void AddLineMappingFor(RazorIRNode node)
|
||||
{
|
||||
var sourceLocation = node.SourceRange;
|
||||
var generatedLocation = new MappingLocation(Context.Writer.GetCurrentSourceLocation(), node.SourceRange.ContentLength);
|
||||
var lineMapping = new LineMapping(sourceLocation, generatedLocation);
|
||||
|
||||
Context.LineMappings.Add(lineMapping);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
|
|
@ -11,7 +10,7 @@ using Microsoft.AspNetCore.Razor.Evolution.Legacy;
|
|||
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution
|
||||
{
|
||||
internal class DefaultRazorRuntimeCSharpLoweringPhase : RazorEnginePhaseBase, IRazorCSharpLoweringPhase
|
||||
internal class DefaultRazorRuntimeCSharpLoweringPhase : RazorCSharpLoweringPhaseBase
|
||||
{
|
||||
protected override void ExecuteCore(RazorCodeDocument codeDocument)
|
||||
{
|
||||
|
|
@ -28,234 +27,17 @@ namespace Microsoft.AspNetCore.Razor.Evolution
|
|||
Options = syntaxTree.Options,
|
||||
};
|
||||
var visitor = new CSharpRenderer(renderingContext);
|
||||
visitor.VisitDefault(irDocument);
|
||||
visitor.VisitDocument(irDocument);
|
||||
var csharpDocument = new RazorCSharpDocument()
|
||||
{
|
||||
GeneratedCode = renderingContext.Writer.GenerateCode(),
|
||||
LineMappings = renderingContext.Writer.LineMappingManager.Mappings,
|
||||
LineMappings = renderingContext.LineMappings,
|
||||
};
|
||||
|
||||
codeDocument.SetCSharpDocument(csharpDocument);
|
||||
}
|
||||
|
||||
public class CSharpRedirectRenderingConventions : CSharpRenderingConventions
|
||||
{
|
||||
private readonly string _redirectWriter;
|
||||
|
||||
public CSharpRedirectRenderingConventions(string redirectWriter, CSharpCodeWriter writer) : base(writer)
|
||||
{
|
||||
_redirectWriter = redirectWriter;
|
||||
}
|
||||
|
||||
public override string StartWriteMethod => "WriteTo(" + _redirectWriter + ", " /* ORIGINAL: WriteToMethodName */;
|
||||
|
||||
public override string StartWriteLiteralMethod => "WriteLiteralTo(" + _redirectWriter + ", " /* ORIGINAL: WriteLiteralToMethodName */;
|
||||
|
||||
|
||||
public override string StartBeginWriteAttributeMethod => "BeginWriteAttributeTo(" + _redirectWriter + ", " /* ORIGINAL: BeginWriteAttributeToMethodName */;
|
||||
|
||||
|
||||
public override string StartWriteAttributeValueMethod => "WriteAttributeValueTo(" + _redirectWriter + ", " /* ORIGINAL: WriteAttributeValueToMethodName */;
|
||||
|
||||
|
||||
public override string StartEndWriteAttributeMethod => "EndWriteAttributeTo(" + _redirectWriter /* ORIGINAL: EndWriteAttributeToMethodName */;
|
||||
}
|
||||
|
||||
public class CSharpRenderingConventions
|
||||
{
|
||||
public CSharpRenderingConventions(CSharpCodeWriter writer)
|
||||
{
|
||||
Writer = writer;
|
||||
}
|
||||
|
||||
protected CSharpCodeWriter Writer { get; }
|
||||
|
||||
public virtual string StartWriteMethod => "Write(" /* ORIGINAL: WriteMethodName */;
|
||||
|
||||
public virtual string StartWriteLiteralMethod => "WriteLiteral(" /* ORIGINAL: WriteLiteralMethodName */;
|
||||
|
||||
public virtual string StartBeginWriteAttributeMethod => "BeginWriteAttribute(" /* ORIGINAL: BeginWriteAttributeMethodName */;
|
||||
|
||||
public virtual string StartWriteAttributeValueMethod => "WriteAttributeValue(" /* ORIGINAL: WriteAttributeValueMethodName */;
|
||||
|
||||
public virtual string StartEndWriteAttributeMethod => "EndWriteAttribute(" /* ORIGINAL: EndWriteAttributeMethodName */;
|
||||
}
|
||||
|
||||
public class CSharpRenderingContext
|
||||
{
|
||||
private CSharpRenderingConventions _renderingConventions;
|
||||
|
||||
public ICollection<DirectiveDescriptor> Directives { get; set; }
|
||||
|
||||
public CSharpCodeWriter Writer { get; set; }
|
||||
|
||||
public CSharpRenderingConventions RenderingConventions
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_renderingConventions == null)
|
||||
{
|
||||
_renderingConventions = new CSharpRenderingConventions(Writer);
|
||||
}
|
||||
|
||||
return _renderingConventions;
|
||||
}
|
||||
set
|
||||
{
|
||||
_renderingConventions = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ICollection<RazorError> Errors { get; } = new List<RazorError>();
|
||||
|
||||
public RazorSourceDocument SourceDocument { get; set; }
|
||||
|
||||
public RazorParserOptions Options { get; set; }
|
||||
}
|
||||
|
||||
public class LinePragmaWriter : IDisposable
|
||||
{
|
||||
private readonly CSharpCodeWriter _writer;
|
||||
private readonly int _startIndent;
|
||||
|
||||
public LinePragmaWriter(CSharpCodeWriter writer, MappingLocation documentLocation)
|
||||
{
|
||||
if (writer == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(writer));
|
||||
}
|
||||
|
||||
_writer = writer;
|
||||
_startIndent = _writer.CurrentIndent;
|
||||
_writer.ResetIndent();
|
||||
_writer.WriteLineNumberDirective(documentLocation, documentLocation.FilePath);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Need to add an additional line at the end IF there wasn't one already written.
|
||||
// This is needed to work with the C# editor's handling of #line ...
|
||||
var builder = _writer.Builder;
|
||||
var endsWithNewline = builder.Length > 0 && builder[builder.Length - 1] == '\n';
|
||||
|
||||
// Always write at least 1 empty line to potentially separate code from pragmas.
|
||||
_writer.WriteLine();
|
||||
|
||||
// Check if the previous empty line wasn't enough to separate code from pragmas.
|
||||
if (!endsWithNewline)
|
||||
{
|
||||
_writer.WriteLine();
|
||||
}
|
||||
|
||||
_writer
|
||||
.WriteLineDefaultDirective()
|
||||
.WriteLineHiddenDirective()
|
||||
.SetIndent(_startIndent);
|
||||
}
|
||||
}
|
||||
|
||||
public class PageStructureCSharpRenderer : RazorIRNodeWalker
|
||||
{
|
||||
protected readonly CSharpRenderingContext Context;
|
||||
|
||||
public PageStructureCSharpRenderer(CSharpRenderingContext context)
|
||||
{
|
||||
Context = context;
|
||||
}
|
||||
|
||||
public override void VisitNamespace(NamespaceDeclarationIRNode node)
|
||||
{
|
||||
Context.Writer
|
||||
.Write("namespace ")
|
||||
.WriteLine(node.Content);
|
||||
|
||||
using (Context.Writer.BuildScope())
|
||||
{
|
||||
Context.Writer.WriteLineHiddenDirective();
|
||||
VisitDefault(node);
|
||||
}
|
||||
}
|
||||
|
||||
public override void VisitRazorMethodDeclaration(RazorMethodDeclarationIRNode node)
|
||||
{
|
||||
Context.Writer
|
||||
.WriteLine("#pragma warning disable 1998")
|
||||
.Write(node.AccessModifier)
|
||||
.Write(" ");
|
||||
|
||||
if (node.Modifiers != null)
|
||||
{
|
||||
for (var i = 0; i < node.Modifiers.Count; i++)
|
||||
{
|
||||
Context.Writer.Write(node.Modifiers[i]);
|
||||
|
||||
if (i + 1 < node.Modifiers.Count)
|
||||
{
|
||||
Context.Writer.Write(" ");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Context.Writer
|
||||
.Write(" ")
|
||||
.Write(node.ReturnType)
|
||||
.Write(" ")
|
||||
.Write(node.Name)
|
||||
.WriteLine("()");
|
||||
|
||||
using (Context.Writer.BuildScope())
|
||||
{
|
||||
VisitDefault(node);
|
||||
}
|
||||
|
||||
Context.Writer.WriteLine("#pragma warning restore 1998");
|
||||
}
|
||||
|
||||
public override void VisitClass(ClassDeclarationIRNode node)
|
||||
{
|
||||
Context.Writer
|
||||
.Write(node.AccessModifier)
|
||||
.Write(" class ")
|
||||
.Write(node.Name);
|
||||
|
||||
if (node.BaseType != null || node.Interfaces != null)
|
||||
{
|
||||
Context.Writer.Write(" : ");
|
||||
}
|
||||
|
||||
if (node.BaseType != null)
|
||||
{
|
||||
Context.Writer.Write(node.BaseType);
|
||||
|
||||
if (node.Interfaces != null)
|
||||
{
|
||||
Context.Writer.WriteParameterSeparator();
|
||||
}
|
||||
}
|
||||
|
||||
if (node.Interfaces != null)
|
||||
{
|
||||
for (var i = 0; i < node.Interfaces.Count; i++)
|
||||
{
|
||||
Context.Writer.Write(node.Interfaces[i]);
|
||||
|
||||
if (i + 1 < node.Interfaces.Count)
|
||||
{
|
||||
Context.Writer.WriteParameterSeparator();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Context.Writer.WriteLine();
|
||||
|
||||
using (Context.Writer.BuildScope())
|
||||
{
|
||||
VisitDefault(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class CSharpRenderer : PageStructureCSharpRenderer
|
||||
private class CSharpRenderer : PageStructureCSharpRenderer
|
||||
{
|
||||
public CSharpRenderer(CSharpRenderingContext context) : base(context)
|
||||
{
|
||||
|
|
@ -316,7 +98,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution
|
|||
if (node.SourceRange != null)
|
||||
{
|
||||
linePragmaScope = new LinePragmaWriter(Context.Writer, node.SourceRange);
|
||||
var padding = BuildOffsetPadding(Context.RenderingConventions.StartWriteMethod.Length, node.SourceRange);
|
||||
var padding = BuildOffsetPadding(Context.RenderingConventions.StartWriteMethod.Length, node.SourceRange, Context);
|
||||
Context.Writer.Write(padding);
|
||||
}
|
||||
|
||||
|
|
@ -446,7 +228,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution
|
|||
{
|
||||
using (new LinePragmaWriter(Context.Writer, node.SourceRange))
|
||||
{
|
||||
var padding = BuildOffsetPadding(0, node.SourceRange);
|
||||
var padding = BuildOffsetPadding(0, node.SourceRange, Context);
|
||||
Context.Writer
|
||||
.Write(padding)
|
||||
.WriteLine(node.Content);
|
||||
|
|
@ -478,62 +260,6 @@ namespace Microsoft.AspNetCore.Razor.Evolution
|
|||
|
||||
Context.Writer.WriteEndMethodInvocation(endLine: false);
|
||||
}
|
||||
|
||||
private static int CalculateExpressionPadding(MappingLocation sourceRange, CSharpRenderingContext context)
|
||||
{
|
||||
var spaceCount = 0;
|
||||
for (var i = sourceRange.AbsoluteIndex - 1; i >= 0; i--)
|
||||
{
|
||||
var @char = context.SourceDocument[i];
|
||||
if (@char == '\n' || @char == '\r')
|
||||
{
|
||||
break;
|
||||
}
|
||||
else if (@char == '\t')
|
||||
{
|
||||
spaceCount += context.Options.TabSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
spaceCount++;
|
||||
}
|
||||
}
|
||||
|
||||
return spaceCount;
|
||||
}
|
||||
|
||||
private string BuildOffsetPadding(int generatedOffset, MappingLocation sourceRange)
|
||||
{
|
||||
var basePadding = CalculateExpressionPadding(sourceRange, Context);
|
||||
var resolvedPadding = Math.Max(basePadding - generatedOffset, 0);
|
||||
|
||||
if (Context.Options.IsIndentingWithTabs)
|
||||
{
|
||||
var spaces = resolvedPadding % Context.Options.TabSize;
|
||||
var tabs = resolvedPadding / Context.Options.TabSize;
|
||||
|
||||
return new string('\t', tabs) + new string(' ', spaces);
|
||||
}
|
||||
else
|
||||
{
|
||||
return new string(' ', resolvedPadding);
|
||||
}
|
||||
}
|
||||
|
||||
private static void RenderExpressionInline(RazorIRNode node, CSharpRenderingContext context)
|
||||
{
|
||||
if (node is CSharpTokenIRNode)
|
||||
{
|
||||
context.Writer.Write(((CSharpTokenIRNode)node).Content);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (var i = 0; i < node.Children.Count; i++)
|
||||
{
|
||||
RenderExpressionInline(node.Children[i], context);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,13 +25,6 @@ namespace Microsoft.AspNetCore.Razor.Evolution.Legacy
|
|||
'\u2029',
|
||||
};
|
||||
|
||||
public CSharpCodeWriter()
|
||||
{
|
||||
LineMappingManager = new LineMappingManager();
|
||||
}
|
||||
|
||||
public LineMappingManager LineMappingManager { get; private set; }
|
||||
|
||||
public new CSharpCodeWriter Write(string data)
|
||||
{
|
||||
return (CSharpCodeWriter)base.Write(data);
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.Legacy
|
||||
{
|
||||
internal class LineMappingManager
|
||||
{
|
||||
public LineMappingManager()
|
||||
{
|
||||
Mappings = new List<LineMapping>();
|
||||
}
|
||||
|
||||
public List<LineMapping> Mappings { get; }
|
||||
|
||||
public void AddMapping(MappingLocation documentLocation, MappingLocation generatedLocation)
|
||||
{
|
||||
Mappings.Add(new LineMapping(documentLocation, generatedLocation));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,289 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Razor.Evolution.Intermediate;
|
||||
using Microsoft.AspNetCore.Razor.Evolution.Legacy;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution
|
||||
{
|
||||
internal abstract class RazorCSharpLoweringPhaseBase : RazorEnginePhaseBase, IRazorCSharpLoweringPhase
|
||||
{
|
||||
protected static void RenderExpressionInline(RazorIRNode node, CSharpRenderingContext context)
|
||||
{
|
||||
if (node is CSharpTokenIRNode)
|
||||
{
|
||||
context.Writer.Write(((CSharpTokenIRNode)node).Content);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (var i = 0; i < node.Children.Count; i++)
|
||||
{
|
||||
RenderExpressionInline(node.Children[i], context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected static int CalculateExpressionPadding(MappingLocation sourceRange, CSharpRenderingContext context)
|
||||
{
|
||||
var spaceCount = 0;
|
||||
for (var i = sourceRange.AbsoluteIndex - 1; i >= 0; i--)
|
||||
{
|
||||
var @char = context.SourceDocument[i];
|
||||
if (@char == '\n' || @char == '\r')
|
||||
{
|
||||
break;
|
||||
}
|
||||
else if (@char == '\t')
|
||||
{
|
||||
spaceCount += context.Options.TabSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
spaceCount++;
|
||||
}
|
||||
}
|
||||
|
||||
return spaceCount;
|
||||
}
|
||||
|
||||
protected static string BuildOffsetPadding(int generatedOffset, MappingLocation sourceRange, CSharpRenderingContext context)
|
||||
{
|
||||
var basePadding = CalculateExpressionPadding(sourceRange, context);
|
||||
var resolvedPadding = Math.Max(basePadding - generatedOffset, 0);
|
||||
|
||||
if (context.Options.IsIndentingWithTabs)
|
||||
{
|
||||
var spaces = resolvedPadding % context.Options.TabSize;
|
||||
var tabs = resolvedPadding / context.Options.TabSize;
|
||||
|
||||
return new string('\t', tabs) + new string(' ', spaces);
|
||||
}
|
||||
else
|
||||
{
|
||||
return new string(' ', resolvedPadding);
|
||||
}
|
||||
}
|
||||
|
||||
protected class LinePragmaWriter : IDisposable
|
||||
{
|
||||
private readonly CSharpCodeWriter _writer;
|
||||
private readonly int _startIndent;
|
||||
|
||||
public LinePragmaWriter(CSharpCodeWriter writer, MappingLocation documentLocation)
|
||||
{
|
||||
if (writer == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(writer));
|
||||
}
|
||||
|
||||
_writer = writer;
|
||||
_startIndent = _writer.CurrentIndent;
|
||||
_writer.ResetIndent();
|
||||
_writer.WriteLineNumberDirective(documentLocation, documentLocation.FilePath);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Need to add an additional line at the end IF there wasn't one already written.
|
||||
// This is needed to work with the C# editor's handling of #line ...
|
||||
var builder = _writer.Builder;
|
||||
var endsWithNewline = builder.Length > 0 && builder[builder.Length - 1] == '\n';
|
||||
|
||||
// Always write at least 1 empty line to potentially separate code from pragmas.
|
||||
_writer.WriteLine();
|
||||
|
||||
// Check if the previous empty line wasn't enough to separate code from pragmas.
|
||||
if (!endsWithNewline)
|
||||
{
|
||||
_writer.WriteLine();
|
||||
}
|
||||
|
||||
_writer
|
||||
.WriteLineDefaultDirective()
|
||||
.WriteLineHiddenDirective()
|
||||
.SetIndent(_startIndent);
|
||||
}
|
||||
}
|
||||
|
||||
protected class CSharpRedirectRenderingConventions : CSharpRenderingConventions
|
||||
{
|
||||
private readonly string _redirectWriter;
|
||||
|
||||
public CSharpRedirectRenderingConventions(string redirectWriter, CSharpCodeWriter writer) : base(writer)
|
||||
{
|
||||
_redirectWriter = redirectWriter;
|
||||
}
|
||||
|
||||
public override string StartWriteMethod => "WriteTo(" + _redirectWriter + ", " /* ORIGINAL: WriteToMethodName */;
|
||||
|
||||
public override string StartWriteLiteralMethod => "WriteLiteralTo(" + _redirectWriter + ", " /* ORIGINAL: WriteLiteralToMethodName */;
|
||||
|
||||
|
||||
public override string StartBeginWriteAttributeMethod => "BeginWriteAttributeTo(" + _redirectWriter + ", " /* ORIGINAL: BeginWriteAttributeToMethodName */;
|
||||
|
||||
|
||||
public override string StartWriteAttributeValueMethod => "WriteAttributeValueTo(" + _redirectWriter + ", " /* ORIGINAL: WriteAttributeValueToMethodName */;
|
||||
|
||||
|
||||
public override string StartEndWriteAttributeMethod => "EndWriteAttributeTo(" + _redirectWriter /* ORIGINAL: EndWriteAttributeToMethodName */;
|
||||
}
|
||||
|
||||
protected class CSharpRenderingConventions
|
||||
{
|
||||
public CSharpRenderingConventions(CSharpCodeWriter writer)
|
||||
{
|
||||
Writer = writer;
|
||||
}
|
||||
|
||||
protected CSharpCodeWriter Writer { get; }
|
||||
|
||||
public virtual string StartWriteMethod => "Write(" /* ORIGINAL: WriteMethodName */;
|
||||
|
||||
public virtual string StartWriteLiteralMethod => "WriteLiteral(" /* ORIGINAL: WriteLiteralMethodName */;
|
||||
|
||||
public virtual string StartBeginWriteAttributeMethod => "BeginWriteAttribute(" /* ORIGINAL: BeginWriteAttributeMethodName */;
|
||||
|
||||
public virtual string StartWriteAttributeValueMethod => "WriteAttributeValue(" /* ORIGINAL: WriteAttributeValueMethodName */;
|
||||
|
||||
public virtual string StartEndWriteAttributeMethod => "EndWriteAttribute(" /* ORIGINAL: EndWriteAttributeMethodName */;
|
||||
}
|
||||
|
||||
protected class CSharpRenderingContext
|
||||
{
|
||||
private CSharpRenderingConventions _renderingConventions;
|
||||
|
||||
public ICollection<DirectiveDescriptor> Directives { get; set; }
|
||||
|
||||
public List<LineMapping> LineMappings { get; } = new List<LineMapping>();
|
||||
|
||||
public CSharpCodeWriter Writer { get; set; }
|
||||
|
||||
public CSharpRenderingConventions RenderingConventions
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_renderingConventions == null)
|
||||
{
|
||||
_renderingConventions = new CSharpRenderingConventions(Writer);
|
||||
}
|
||||
|
||||
return _renderingConventions;
|
||||
}
|
||||
set
|
||||
{
|
||||
_renderingConventions = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ICollection<RazorError> Errors { get; } = new List<RazorError>();
|
||||
|
||||
public RazorSourceDocument SourceDocument { get; set; }
|
||||
|
||||
public RazorParserOptions Options { get; set; }
|
||||
}
|
||||
|
||||
protected class PageStructureCSharpRenderer : RazorIRNodeWalker
|
||||
{
|
||||
protected readonly CSharpRenderingContext Context;
|
||||
|
||||
public PageStructureCSharpRenderer(CSharpRenderingContext context)
|
||||
{
|
||||
Context = context;
|
||||
}
|
||||
|
||||
public override void VisitNamespace(NamespaceDeclarationIRNode node)
|
||||
{
|
||||
Context.Writer
|
||||
.Write("namespace ")
|
||||
.WriteLine(node.Content);
|
||||
|
||||
using (Context.Writer.BuildScope())
|
||||
{
|
||||
Context.Writer.WriteLineHiddenDirective();
|
||||
VisitDefault(node);
|
||||
}
|
||||
}
|
||||
|
||||
public override void VisitRazorMethodDeclaration(RazorMethodDeclarationIRNode node)
|
||||
{
|
||||
Context.Writer.WriteLine("#pragma warning disable 1998");
|
||||
|
||||
Context.Writer
|
||||
.Write(node.AccessModifier)
|
||||
.Write(" ");
|
||||
|
||||
if (node.Modifiers != null)
|
||||
{
|
||||
for (var i = 0; i < node.Modifiers.Count; i++)
|
||||
{
|
||||
Context.Writer.Write(node.Modifiers[i]);
|
||||
|
||||
if (i + 1 < node.Modifiers.Count)
|
||||
{
|
||||
Context.Writer.Write(" ");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Context.Writer
|
||||
.Write(" ")
|
||||
.Write(node.ReturnType)
|
||||
.Write(" ")
|
||||
.Write(node.Name)
|
||||
.WriteLine("()");
|
||||
|
||||
using (Context.Writer.BuildScope())
|
||||
{
|
||||
VisitDefault(node);
|
||||
}
|
||||
|
||||
Context.Writer.WriteLine("#pragma warning restore 1998");
|
||||
}
|
||||
|
||||
public override void VisitClass(ClassDeclarationIRNode node)
|
||||
{
|
||||
Context.Writer
|
||||
.Write(node.AccessModifier)
|
||||
.Write(" class ")
|
||||
.Write(node.Name);
|
||||
|
||||
if (node.BaseType != null || node.Interfaces != null)
|
||||
{
|
||||
Context.Writer.Write(" : ");
|
||||
}
|
||||
|
||||
if (node.BaseType != null)
|
||||
{
|
||||
Context.Writer.Write(node.BaseType);
|
||||
|
||||
if (node.Interfaces != null)
|
||||
{
|
||||
Context.Writer.WriteParameterSeparator();
|
||||
}
|
||||
}
|
||||
|
||||
if (node.Interfaces != null)
|
||||
{
|
||||
for (var i = 0; i < node.Interfaces.Count; i++)
|
||||
{
|
||||
Context.Writer.Write(node.Interfaces[i]);
|
||||
|
||||
if (i + 1 < node.Interfaces.Count)
|
||||
{
|
||||
Context.Writer.WriteParameterSeparator();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Context.Writer.WriteLine();
|
||||
|
||||
using (Context.Writer.BuildScope())
|
||||
{
|
||||
VisitDefault(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using Microsoft.AspNetCore.Razor.Evolution.Intermediate;
|
||||
using Microsoft.AspNetCore.Razor.Evolution.Legacy;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution
|
||||
{
|
||||
internal class RazorDesignTimeIRPass : RazorIRPassBase
|
||||
{
|
||||
internal const string DesignTimeVariable = "__o";
|
||||
|
||||
public override int Order => 25;
|
||||
|
||||
public override DocumentIRNode ExecuteCore(DocumentIRNode irDocument)
|
||||
{
|
||||
var walker = new DesignTimeHelperWalker();
|
||||
walker.VisitDocument(irDocument);
|
||||
|
||||
return irDocument;
|
||||
}
|
||||
|
||||
internal class DesignTimeHelperWalker : RazorIRNodeWalker
|
||||
{
|
||||
private DirectiveTokenHelperIRNode _directiveTokenHelper;
|
||||
|
||||
public override void VisitClass(ClassDeclarationIRNode node)
|
||||
{
|
||||
|
||||
var designTimeHelperDeclaration = new CSharpStatementIRNode()
|
||||
{
|
||||
Content = $"private static {typeof(object).FullName} {DesignTimeVariable} = null;",
|
||||
};
|
||||
|
||||
node.Children.Insert(0, designTimeHelperDeclaration);
|
||||
|
||||
_directiveTokenHelper = new DirectiveTokenHelperIRNode();
|
||||
|
||||
VisitDefault(node);
|
||||
|
||||
node.Children.Insert(0, _directiveTokenHelper);
|
||||
}
|
||||
|
||||
public override void VisitDirectiveToken(DirectiveTokenIRNode node)
|
||||
{
|
||||
_directiveTokenHelper.AddToMethodBody(node);
|
||||
}
|
||||
|
||||
private class DirectiveTokenHelperIRNode : RazorIRNode
|
||||
{
|
||||
private const string DirectiveTokenHelperMethodName = "__RazorDirectiveTokenHelpers__";
|
||||
private int _methodBodyIndex = 2;
|
||||
|
||||
public DirectiveTokenHelperIRNode()
|
||||
{
|
||||
var disableWarningPragma = new CSharpStatementIRNode()
|
||||
{
|
||||
Content = "#pragma warning disable 219",
|
||||
};
|
||||
Children.Add(disableWarningPragma);
|
||||
|
||||
var methodStartNode = new CSharpStatementIRNode()
|
||||
{
|
||||
Content = "private void " + DirectiveTokenHelperMethodName + "() {"
|
||||
};
|
||||
Children.Add(methodStartNode);
|
||||
|
||||
var methodEndNode = new CSharpStatementIRNode()
|
||||
{
|
||||
Content = "}"
|
||||
};
|
||||
Children.Add(methodEndNode);
|
||||
|
||||
var restoreWarningPragma = new CSharpStatementIRNode()
|
||||
{
|
||||
Content = "#pragma warning restore 219",
|
||||
};
|
||||
Children.Add(restoreWarningPragma);
|
||||
}
|
||||
|
||||
public override IList<RazorIRNode> Children { get; } = new List<RazorIRNode>();
|
||||
|
||||
public override RazorIRNode Parent { get; set; }
|
||||
|
||||
internal override MappingLocation SourceRange { get; set; }
|
||||
|
||||
public void AddToMethodBody(RazorIRNode node)
|
||||
{
|
||||
Children.Insert(_methodBodyIndex++, node);
|
||||
}
|
||||
|
||||
public override void Accept(RazorIRNodeVisitor visitor)
|
||||
{
|
||||
visitor.VisitDefault(this);
|
||||
}
|
||||
|
||||
public override TResult Accept<TResult>(RazorIRNodeVisitor<TResult> visitor)
|
||||
{
|
||||
return visitor.VisitDefault(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -72,6 +72,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution
|
|||
builder.Phases.Add(new DefaultRazorDesignTimeCSharpLoweringPhase());
|
||||
|
||||
builder.Features.Add(new ConfigureDesignTimeOptions());
|
||||
builder.Features.Add(new RazorDesignTimeIRPass());
|
||||
}
|
||||
|
||||
public abstract IReadOnlyList<IRazorEngineFeature> Features { get; }
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
#if NET451
|
||||
|
|
@ -10,7 +11,9 @@ using System.Runtime.Remoting.Messaging;
|
|||
#else
|
||||
using System.Threading;
|
||||
#endif
|
||||
using System.Text;
|
||||
using Microsoft.AspNetCore.Razor.Evolution.Intermediate;
|
||||
using Microsoft.AspNetCore.Razor.Evolution.Legacy;
|
||||
using Xunit;
|
||||
using Xunit.Sdk;
|
||||
using System.Runtime.InteropServices;
|
||||
|
|
@ -70,7 +73,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests
|
|||
#endif
|
||||
}
|
||||
|
||||
protected RazorCodeDocument CreateCodeDocument()
|
||||
protected virtual RazorCodeDocument CreateCodeDocument()
|
||||
{
|
||||
if (Filename == null)
|
||||
{
|
||||
|
|
@ -155,5 +158,47 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests
|
|||
|
||||
Assert.Equal(baseline, actual);
|
||||
}
|
||||
|
||||
protected void AssertDesignTimeDocumentMatchBaseline(RazorCodeDocument document)
|
||||
{
|
||||
if (Filename == null)
|
||||
{
|
||||
var message = $"{nameof(AssertDesignTimeDocumentMatchBaseline)} should only be called from an integration test ({nameof(Filename)} is null).";
|
||||
throw new InvalidOperationException(message);
|
||||
}
|
||||
|
||||
var csharpDocument = document.GetCSharpDocument();
|
||||
Assert.NotNull(csharpDocument);
|
||||
|
||||
var syntaxTree = document.GetSyntaxTree();
|
||||
Assert.NotNull(syntaxTree);
|
||||
Assert.True(syntaxTree.Options.DesignTimeMode);
|
||||
|
||||
// Validate generated code.
|
||||
AssertCSharpDocumentMatchesBaseline(csharpDocument);
|
||||
|
||||
var baselineFilename = Path.ChangeExtension(Filename, ".mappings.txt");
|
||||
var serializedMappings = LineMappingsSerializer.Serialize(csharpDocument, document.Source);
|
||||
|
||||
if (GenerateBaselines)
|
||||
{
|
||||
var baselineFullPath = Path.Combine(TestProjectRoot, baselineFilename);
|
||||
File.WriteAllText(baselineFullPath, serializedMappings);
|
||||
return;
|
||||
}
|
||||
|
||||
var testFile = TestFile.Create(baselineFilename);
|
||||
if (!testFile.Exists())
|
||||
{
|
||||
throw new XunitException($"The resource {baselineFilename} was not found.");
|
||||
}
|
||||
|
||||
var baseline = testFile.ReadAllText();
|
||||
|
||||
// Normalize newlines to match those in the baseline.
|
||||
var actual = serializedMappings.Replace("\r", "").Replace("\n", "\r\n");
|
||||
|
||||
Assert.Equal(baseline, actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Text;
|
||||
using Microsoft.AspNetCore.Razor.Evolution.Legacy;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests
|
||||
{
|
||||
public static class LineMappingsSerializer
|
||||
{
|
||||
public static string Serialize(RazorCSharpDocument csharpDocument, RazorSourceDocument sourceDocument)
|
||||
{
|
||||
var builder = new StringBuilder();
|
||||
var charBuffer = new char[sourceDocument.Length];
|
||||
sourceDocument.CopyTo(0, charBuffer, 0, sourceDocument.Length);
|
||||
var sourceContent = new string(charBuffer);
|
||||
|
||||
for (var i = 0; i < csharpDocument.LineMappings.Count; i++)
|
||||
{
|
||||
var lineMapping = csharpDocument.LineMappings[i];
|
||||
|
||||
builder.Append("Source Location: ");
|
||||
AppendMappingLocation(builder, lineMapping.DocumentLocation, sourceContent);
|
||||
|
||||
builder.Append("Generated Location: ");
|
||||
AppendMappingLocation(builder, lineMapping.GeneratedLocation, csharpDocument.GeneratedCode);
|
||||
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
return builder.ToString();
|
||||
}
|
||||
|
||||
private static void AppendMappingLocation(StringBuilder builder, MappingLocation location, string content)
|
||||
{
|
||||
builder
|
||||
.AppendLine(location.ToString())
|
||||
.Append("|");
|
||||
|
||||
for (var i = 0; i < location.ContentLength; i++)
|
||||
{
|
||||
builder.Append(content[location.AbsoluteIndex + i]);
|
||||
}
|
||||
|
||||
builder.AppendLine("|");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,599 +0,0 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Razor.Evolution.Intermediate;
|
||||
using Microsoft.AspNetCore.Testing.xunit;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests
|
||||
{
|
||||
public class RuntimeCodeGenerationIntegrationTest : IntegrationTestBase
|
||||
{
|
||||
[Fact]
|
||||
public void UnfinishedExpressionInCode()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Templates()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void StringLiterals()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SimpleUnspacedIf()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Sections()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RazorComments()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParserError()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OpenedIf()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NullConditionalExpressions()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NoLinePragmas()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NestedCSharp()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NestedCodeBlocks()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MarkupInCodeBlock()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Instrumented()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void InlineBlocks()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Inherits()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Imports()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ImplicitExpressionAtEOF()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ImplicitExpression()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void HtmlCommentWithQuote_Double()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void HtmlCommentWithQuote_Single()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void HiddenSpansInCode()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void FunctionsBlock()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void FunctionsBlockMinimal()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExpressionsInCode()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExplicitExpressionWithMarkup()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExplicitExpressionAtEOF()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExplicitExpression()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EmptyImplicitExpressionInCode()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EmptyImplicitExpression()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EmptyExplicitExpression()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EmptyCodeBlock()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DesignTime()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ConditionalAttributes()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CodeBlockWithTextElement()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CodeBlockAtEOF()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CodeBlock()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Blocks()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Await()
|
||||
{
|
||||
// Arrange
|
||||
var engine = RazorEngine.Create(builder => builder.Features.Add(new ApiSetsIRTestAdapter()));
|
||||
var document = CreateCodeDocument();
|
||||
|
||||
// Act
|
||||
engine.Process(document);
|
||||
|
||||
// Assert
|
||||
AssertCSharpDocumentMatchesBaseline(document.GetCSharpDocument());
|
||||
}
|
||||
|
||||
private class ApiSetsIRTestAdapter : RazorIRPassBase
|
||||
{
|
||||
public override DocumentIRNode ExecuteCore(DocumentIRNode irDocument)
|
||||
{
|
||||
var walker = new ApiSetsIRWalker();
|
||||
walker.Visit(irDocument);
|
||||
|
||||
return irDocument;
|
||||
}
|
||||
|
||||
private class ApiSetsIRWalker : RazorIRNodeWalker
|
||||
{
|
||||
public override void VisitClass(ClassDeclarationIRNode node)
|
||||
{
|
||||
node.Name = Filename.Replace('/', '_');
|
||||
node.AccessModifier = "public";
|
||||
|
||||
VisitDefault(node);
|
||||
}
|
||||
|
||||
public override void VisitNamespace(NamespaceDeclarationIRNode node)
|
||||
{
|
||||
node.Content = typeof(RuntimeCodeGenerationIntegrationTest).Namespace + ".TestFiles";
|
||||
|
||||
VisitDefault(node);
|
||||
}
|
||||
|
||||
public override void VisitRazorMethodDeclaration(RazorMethodDeclarationIRNode node)
|
||||
{
|
||||
node.AccessModifier = "public";
|
||||
node.Modifiers = new[] { "async" };
|
||||
node.ReturnType = typeof(Task).FullName;
|
||||
node.Name = "ExecuteAsync";
|
||||
|
||||
VisitDefault(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -161,7 +161,8 @@ namespace Microsoft.AspNetCore.Razor.Evolution
|
|||
feature => Assert.IsType<HtmlNodeOptimizationPass>(feature),
|
||||
feature => Assert.IsType<TagHelperBinderSyntaxTreePass>(feature),
|
||||
feature => Assert.IsType<DefaultDirectiveIRPass>(feature),
|
||||
feature => Assert.IsType<RazorEngine.ConfigureDesignTimeOptions>(feature));
|
||||
feature => Assert.IsType<RazorEngine.ConfigureDesignTimeOptions>(feature),
|
||||
feature => Assert.IsType<RazorDesignTimeIRPass>(feature));
|
||||
}
|
||||
|
||||
private static void AssertDefaultDesignTimePhases(IReadOnlyList<IRazorEnginePhase> phases)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,108 @@
|
|||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await_DesignTime
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
__o = await Foo();
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 11 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
__o = await Foo();
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 12 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
await Foo();
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 13 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 13 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
__o = await Foo();
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 13 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 14 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
__o = await;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 19 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
__o = await Foo(1, 2);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 20 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
__o = await Foo.Bar(1, 2);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 21 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
__o = await Foo("bob", true);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 22 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
await Foo(something, hello: "world");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 23 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
await Foo.Bar(1, 2)
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 24 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 24 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
__o = await Foo(boolValue: false);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 24 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 25 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
__o = await ("wrrronggg");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
|
||||
public async Task<string> Foo()
|
||||
{
|
||||
return "Bar";
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
Source Location: (192:9,39 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml)
|
||||
|await Foo()|
|
||||
Generated Location: (679:16,42 [11] )
|
||||
|await Foo()|
|
||||
|
||||
Source Location: (247:10,38 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml)
|
||||
|await Foo()|
|
||||
Generated Location: (847:21,41 [11] )
|
||||
|await Foo()|
|
||||
|
||||
Source Location: (304:11,39 [14] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml)
|
||||
| await Foo(); |
|
||||
Generated Location: (1013:26,39 [14] )
|
||||
| await Foo(); |
|
||||
|
||||
Source Location: (371:12,46 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml)
|
||||
| |
|
||||
Generated Location: (1188:31,46 [1] )
|
||||
| |
|
||||
|
||||
Source Location: (376:12,51 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml)
|
||||
|await Foo()|
|
||||
Generated Location: (1358:36,54 [11] )
|
||||
|await Foo()|
|
||||
|
||||
Source Location: (391:12,66 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml)
|
||||
| |
|
||||
Generated Location: (1551:41,66 [1] )
|
||||
| |
|
||||
|
||||
Source Location: (448:13,49 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml)
|
||||
|await|
|
||||
Generated Location: (1719:46,52 [5] )
|
||||
|await|
|
||||
|
||||
Source Location: (578:18,42 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml)
|
||||
|await Foo(1, 2)|
|
||||
Generated Location: (1885:51,45 [15] )
|
||||
|await Foo(1, 2)|
|
||||
|
||||
Source Location: (650:19,51 [19] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml)
|
||||
|await Foo.Bar(1, 2)|
|
||||
Generated Location: (2070:56,54 [19] )
|
||||
|await Foo.Bar(1, 2)|
|
||||
|
||||
Source Location: (716:20,41 [22] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml)
|
||||
|await Foo("bob", true)|
|
||||
Generated Location: (2249:61,44 [22] )
|
||||
|await Foo("bob", true)|
|
||||
|
||||
Source Location: (787:21,42 [39] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml)
|
||||
| await Foo(something, hello: "world"); |
|
||||
Generated Location: (2429:66,42 [39] )
|
||||
| await Foo(something, hello: "world"); |
|
||||
|
||||
Source Location: (884:22,51 [21] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml)
|
||||
| await Foo.Bar(1, 2) |
|
||||
Generated Location: (2634:71,51 [21] )
|
||||
| await Foo.Bar(1, 2) |
|
||||
|
||||
Source Location: (961:23,49 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml)
|
||||
| |
|
||||
Generated Location: (2819:76,49 [1] )
|
||||
| |
|
||||
|
||||
Source Location: (966:23,54 [27] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml)
|
||||
|await Foo(boolValue: false)|
|
||||
Generated Location: (2992:81,57 [27] )
|
||||
|await Foo(boolValue: false)|
|
||||
|
||||
Source Location: (997:23,85 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml)
|
||||
| |
|
||||
Generated Location: (3220:86,85 [1] )
|
||||
| |
|
||||
|
||||
Source Location: (1057:24,52 [19] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml)
|
||||
|await ("wrrronggg")|
|
||||
Generated Location: (3391:91,55 [19] )
|
||||
|await ("wrrronggg")|
|
||||
|
||||
Source Location: (12:0,12 [76] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml)
|
||||
|
|
||||
public async Task<string> Foo()
|
||||
{
|
||||
return "Bar";
|
||||
}
|
||||
|
|
||||
Generated Location: (3586:98,12 [76] )
|
||||
|
|
||||
public async Task<string> Foo()
|
||||
{
|
||||
return "Bar";
|
||||
}
|
||||
|
|
||||
|
||||
|
|
@ -1,84 +1,84 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Await.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "00b5e01b7a405dcfde7e4d512ee930daaa1778b5"
|
||||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "00b5e01b7a405dcfde7e4d512ee930daaa1778b5"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_RuntimeCodeGenerationIntegrationTest_Await
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Await_Runtime
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
WriteLiteral("\r\n<section>\r\n <h1>Basic Asynchronous Expression Test</h1>\r\n <p>Basic Asynchronous Expression: ");
|
||||
#line 10 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Await.cshtml"
|
||||
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
Write(await Foo());
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</p>\r\n <p>Basic Asynchronous Template: ");
|
||||
#line 11 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Await.cshtml"
|
||||
#line 11 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
Write(await Foo());
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</p>\r\n <p>Basic Asynchronous Statement: ");
|
||||
#line 12 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Await.cshtml"
|
||||
#line 12 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
await Foo();
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</p>\r\n <p>Basic Asynchronous Statement Nested: <b>");
|
||||
#line 13 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Await.cshtml"
|
||||
#line 13 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
Write(await Foo());
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</b> ");
|
||||
WriteLiteral("</p>\r\n <p>Basic Incomplete Asynchronous Statement: ");
|
||||
#line 14 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Await.cshtml"
|
||||
#line 14 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
Write(await);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</p>\r\n</section>\r\n\r\n<section>\r\n <h1>Advanced Asynchronous Expression Test</h1>\r\n <p>Advanced Asynchronous Expression: ");
|
||||
#line 19 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Await.cshtml"
|
||||
#line 19 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
Write(await Foo(1, 2));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</p>\r\n <p>Advanced Asynchronous Expression Extended: ");
|
||||
#line 20 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Await.cshtml"
|
||||
#line 20 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
Write(await Foo.Bar(1, 2));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</p>\r\n <p>Advanced Asynchronous Template: ");
|
||||
#line 21 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Await.cshtml"
|
||||
#line 21 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
Write(await Foo("bob", true));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</p>\r\n <p>Advanced Asynchronous Statement: ");
|
||||
#line 22 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Await.cshtml"
|
||||
#line 22 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
await Foo(something, hello: "world");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</p>\r\n <p>Advanced Asynchronous Statement Extended: ");
|
||||
#line 23 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Await.cshtml"
|
||||
#line 23 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
await Foo.Bar(1, 2)
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</p>\r\n <p>Advanced Asynchronous Statement Nested: <b>");
|
||||
#line 24 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Await.cshtml"
|
||||
#line 24 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
Write(await Foo(boolValue: false));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</b> ");
|
||||
WriteLiteral("</p>\r\n <p>Advanced Incomplete Asynchronous Statement: ");
|
||||
#line 25 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Await.cshtml"
|
||||
#line 25 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
Write(await ("wrrronggg"));
|
||||
|
||||
#line default
|
||||
|
|
@ -86,7 +86,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
|||
WriteLiteral("</p>\r\n</section>");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#line 1 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Await.cshtml"
|
||||
#line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Await.cshtml"
|
||||
|
||||
public async Task<string> Foo()
|
||||
{
|
||||
|
|
@ -0,0 +1,135 @@
|
|||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Blocks_DesignTime
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
|
||||
int i = 1;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
while(i <= 10) {
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
__o = i;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
|
||||
i += 1;
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
if(i == 11) {
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 11 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 14 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
switch(i) {
|
||||
case 11:
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 16 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
|
||||
break;
|
||||
default:
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 19 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 23 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
for(int j = 1; j <= 10; j += 2) {
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 24 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
__o = j;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 24 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 27 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
try {
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 28 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
|
||||
} catch(Exception ex) {
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 30 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
__o = ex.Message;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 30 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 33 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
__o = i;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 35 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
lock(new object()) {
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 36 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,139 @@
|
|||
Source Location: (2:0,2 [18] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml)
|
||||
|
|
||||
int i = 1;
|
||||
|
|
||||
Generated Location: (640:16,2 [18] )
|
||||
|
|
||||
int i = 1;
|
||||
|
|
||||
|
||||
Source Location: (26:4,1 [22] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml)
|
||||
|while(i <= 10) {
|
||||
|
|
||||
Generated Location: (772:22,1 [22] )
|
||||
|while(i <= 10) {
|
||||
|
|
||||
|
||||
Source Location: (69:5,25 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml)
|
||||
|i|
|
||||
Generated Location: (937:28,28 [1] )
|
||||
|i|
|
||||
|
||||
Source Location: (75:5,31 [16] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml)
|
||||
|
|
||||
i += 1;
|
||||
}|
|
||||
Generated Location: (1085:33,31 [16] )
|
||||
|
|
||||
i += 1;
|
||||
}|
|
||||
|
||||
Source Location: (96:9,1 [19] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml)
|
||||
|if(i == 11) {
|
||||
|
|
||||
Generated Location: (1218:40,1 [19] )
|
||||
|if(i == 11) {
|
||||
|
|
||||
|
||||
Source Location: (140:10,29 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml)
|
||||
|
|
||||
}|
|
||||
Generated Location: (1382:46,29 [3] )
|
||||
|
|
||||
}|
|
||||
|
||||
Source Location: (148:13,1 [35] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml)
|
||||
|switch(i) {
|
||||
case 11:
|
||||
|
|
||||
Generated Location: (1502:52,1 [35] )
|
||||
|switch(i) {
|
||||
case 11:
|
||||
|
|
||||
|
||||
Source Location: (219:15,44 [40] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml)
|
||||
|
|
||||
break;
|
||||
default:
|
||||
|
|
||||
Generated Location: (1697:59,44 [40] )
|
||||
|
|
||||
break;
|
||||
default:
|
||||
|
|
||||
|
||||
Source Location: (288:18,37 [19] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml)
|
||||
|
|
||||
break;
|
||||
}|
|
||||
Generated Location: (1890:67,37 [19] )
|
||||
|
|
||||
break;
|
||||
}|
|
||||
|
||||
Source Location: (312:22,1 [39] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml)
|
||||
|for(int j = 1; j <= 10; j += 2) {
|
||||
|
|
||||
Generated Location: (2026:74,1 [39] )
|
||||
|for(int j = 1; j <= 10; j += 2) {
|
||||
|
|
||||
|
||||
Source Location: (378:23,31 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml)
|
||||
|j|
|
||||
Generated Location: (2215:80,34 [1] )
|
||||
|j|
|
||||
|
||||
Source Location: (384:23,37 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml)
|
||||
|
|
||||
}|
|
||||
Generated Location: (2370:85,37 [3] )
|
||||
|
|
||||
}|
|
||||
|
||||
Source Location: (392:26,1 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml)
|
||||
|try {
|
||||
|
|
||||
Generated Location: (2490:91,1 [11] )
|
||||
|try {
|
||||
|
|
||||
|
||||
Source Location: (438:27,39 [31] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml)
|
||||
|
|
||||
} catch(Exception ex) {
|
||||
|
|
||||
Generated Location: (2656:97,39 [31] )
|
||||
|
|
||||
} catch(Exception ex) {
|
||||
|
|
||||
|
||||
Source Location: (500:29,35 [10] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml)
|
||||
|ex.Message|
|
||||
Generated Location: (2841:104,38 [10] )
|
||||
|ex.Message|
|
||||
|
||||
Source Location: (515:29,50 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml)
|
||||
|
|
||||
}|
|
||||
Generated Location: (3018:109,50 [3] )
|
||||
|
|
||||
}|
|
||||
|
||||
Source Location: (535:32,13 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml)
|
||||
|i|
|
||||
Generated Location: (3153:115,16 [1] )
|
||||
|i|
|
||||
|
||||
Source Location: (545:34,1 [26] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml)
|
||||
|lock(new object()) {
|
||||
|
|
||||
Generated Location: (3272:120,1 [26] )
|
||||
|lock(new object()) {
|
||||
|
|
||||
|
||||
Source Location: (618:35,51 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml)
|
||||
|
|
||||
}|
|
||||
Generated Location: (3465:126,51 [3] )
|
||||
|
|
||||
}|
|
||||
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Blocks.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "ba7d8f5f5159a2389c780aa606885ef6c917a45a"
|
||||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "ba7d8f5f5159a2389c780aa606885ef6c917a45a"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_RuntimeCodeGenerationIntegrationTest_Blocks
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_Blocks_Runtime
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 1 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
#line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
|
||||
int i = 1;
|
||||
|
||||
|
|
@ -17,20 +17,20 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
|||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
#line 5 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
while(i <= 10) {
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <p>Hello from C#, #");
|
||||
#line 6 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
Write(i);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</p>\r\n");
|
||||
#line 7 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
#line 7 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
i += 1;
|
||||
}
|
||||
|
||||
|
|
@ -38,21 +38,21 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
|||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
#line 10 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
if(i == 11) {
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <p>We wrote 10 lines!</p>\r\n");
|
||||
#line 12 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
#line 12 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
#line 14 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
#line 14 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
switch(i) {
|
||||
case 11:
|
||||
|
||||
|
|
@ -60,7 +60,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
|||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <p>No really, we wrote 10 lines!</p>\r\n");
|
||||
#line 17 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
#line 17 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
break;
|
||||
default:
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
|||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <p>Actually, we didn\'t...</p>\r\n");
|
||||
#line 20 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
#line 20 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -76,67 +76,67 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
|||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
#line 23 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
#line 23 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
for(int j = 1; j <= 10; j += 2) {
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <p>Hello again from C#, #");
|
||||
#line 24 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
#line 24 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
Write(j);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</p>\r\n");
|
||||
#line 25 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
#line 25 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
#line 27 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
#line 27 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
try {
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <p>That time, we wrote 5 lines!</p>\r\n");
|
||||
#line 29 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
#line 29 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
} catch(Exception ex) {
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <p>Oh no! An error occurred: ");
|
||||
#line 30 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
#line 30 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
Write(ex.Message);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</p>\r\n");
|
||||
#line 31 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
#line 31 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<p>i is now ");
|
||||
#line 33 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
#line 33 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
Write(i);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</p>\r\n\r\n");
|
||||
#line 35 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
#line 35 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
lock(new object()) {
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <p>This block is locked, for your security!</p>\r\n");
|
||||
#line 37 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
#line 37 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/Blocks.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockAtEOF_DesignTime
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
Source Location: (2:0,2 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF.cshtml)
|
||||
||
|
||||
Generated Location: (656:16,2 [0] )
|
||||
||
|
||||
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/CodeBlockAtEOF.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "5f82673b13daf5e28291f3bfb58df5e3a94e13cc"
|
||||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockAtEOF.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "5f82673b13daf5e28291f3bfb58df5e3a94e13cc"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_RuntimeCodeGenerationIntegrationTest_CodeBlockAtEOF
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockAtEOF_Runtime
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockWithTextElement_DesignTime
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml"
|
||||
|
||||
var a = 1;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 2 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml"
|
||||
|
||||
var b = 1;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml"
|
||||
__o = a+b;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
Source Location: (2:0,2 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml)
|
||||
|
|
||||
var a = 1; |
|
||||
Generated Location: (676:16,2 [17] )
|
||||
|
|
||||
var a = 1; |
|
||||
|
||||
Source Location: (35:1,31 [22] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml)
|
||||
|
|
||||
var b = 1; |
|
||||
Generated Location: (857:22,31 [22] )
|
||||
|
|
||||
var b = 1; |
|
||||
|
||||
Source Location: (69:2,29 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml)
|
||||
|a+b|
|
||||
Generated Location: (1053:28,41 [3] )
|
||||
|a+b|
|
||||
|
||||
Source Location: (80:2,40 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml)
|
||||
|
|
||||
|
|
||||
Generated Location: (1239:33,49 [2] )
|
||||
|
|
||||
|
|
||||
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "13e48ff59aab8106ceb68dd4a10b0bdf10c322fc"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlockWithTextElement_Runtime
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml"
|
||||
|
||||
var a = 1;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("foo");
|
||||
#line 2 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml"
|
||||
|
||||
var b = 1;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("bar ");
|
||||
#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlockWithTextElement.cshtml"
|
||||
Write(a+b);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlock_DesignTime
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock.cshtml"
|
||||
|
||||
for(int i = 1; i <= 10; i++) {
|
||||
Output.Write("<p>Hello from C#, #" + i.ToString() + "</p>");
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
Source Location: (2:0,2 [115] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock.cshtml)
|
||||
|
|
||||
for(int i = 1; i <= 10; i++) {
|
||||
Output.Write("<p>Hello from C#, #" + i.ToString() + "</p>");
|
||||
}
|
||||
|
|
||||
Generated Location: (646:16,2 [115] )
|
||||
|
|
||||
for(int i = 1; i <= 10; i++) {
|
||||
Output.Write("<p>Hello from C#, #" + i.ToString() + "</p>");
|
||||
}
|
||||
|
|
||||
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/CodeBlock.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "019ce8023d064d08ca88c597b764aea895ec5841"
|
||||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "019ce8023d064d08ca88c597b764aea895ec5841"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_RuntimeCodeGenerationIntegrationTest_CodeBlock
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_CodeBlock_Runtime
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 1 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/CodeBlock.cshtml"
|
||||
#line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/CodeBlock.cshtml"
|
||||
|
||||
for(int i = 1; i <= 10; i++) {
|
||||
Output.Write("<p>Hello from C#, #" + i.ToString() + "</p>");
|
||||
|
|
@ -0,0 +1,142 @@
|
|||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes_DesignTime
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
|
||||
var ch = true;
|
||||
var cls = "bar";
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 4 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
__o = cls;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
__o = cls;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 7 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
__o = cls;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 7 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
__o = ch;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
__o = ch;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
if(cls != null) {
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
__o = cls;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 11 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 12 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
__o = Url.Content("~/Scripts/jquery-1.6.2.min.js");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 12 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 13 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
__o = Url.Content("~/Scripts/modernizr-2.0.6-development-only.js");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 13 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 14 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,138 @@
|
|||
Source Location: (2:0,2 [48] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml)
|
||||
|
|
||||
var ch = true;
|
||||
var cls = "bar";
|
||||
|
|
||||
Generated Location: (670:16,2 [48] )
|
||||
|
|
||||
var ch = true;
|
||||
var cls = "bar";
|
||||
|
|
||||
|
||||
Source Location: (66:3,20 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml)
|
||||
|
|
||||
|
|
||||
Generated Location: (868:24,20 [6] )
|
||||
|
|
||||
|
|
||||
|
||||
Source Location: (83:4,15 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml)
|
||||
|cls|
|
||||
Generated Location: (1022:30,18 [3] )
|
||||
|cls|
|
||||
|
||||
Source Location: (90:4,22 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml)
|
||||
|
|
||||
|
|
||||
Generated Location: (1178:35,22 [6] )
|
||||
|
|
||||
|
|
||||
|
||||
Source Location: (111:5,19 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml)
|
||||
|cls|
|
||||
Generated Location: (1336:41,22 [3] )
|
||||
|cls|
|
||||
|
||||
Source Location: (118:5,26 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml)
|
||||
|
|
||||
|
|
||||
Generated Location: (1496:46,26 [6] )
|
||||
|
|
||||
|
|
||||
|
||||
Source Location: (135:6,15 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml)
|
||||
|cls|
|
||||
Generated Location: (1650:52,18 [3] )
|
||||
|cls|
|
||||
|
||||
Source Location: (146:6,26 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml)
|
||||
|
|
||||
|
|
||||
Generated Location: (1810:57,26 [6] )
|
||||
|
|
||||
|
|
||||
|
||||
Source Location: (185:7,37 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml)
|
||||
|ch|
|
||||
Generated Location: (1986:63,40 [2] )
|
||||
|ch|
|
||||
|
||||
Source Location: (191:7,43 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml)
|
||||
|
|
||||
|
|
||||
Generated Location: (2162:68,43 [6] )
|
||||
|
|
||||
|
|
||||
|
||||
Source Location: (234:8,41 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml)
|
||||
|ch|
|
||||
Generated Location: (2342:74,44 [2] )
|
||||
|ch|
|
||||
|
||||
Source Location: (240:8,47 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml)
|
||||
|
|
||||
|
|
||||
Generated Location: (2522:79,47 [6] )
|
||||
|
|
||||
|
|
||||
|
||||
Source Location: (257:9,15 [18] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml)
|
||||
|if(cls != null) { |
|
||||
Generated Location: (2674:85,15 [18] )
|
||||
|if(cls != null) { |
|
||||
|
||||
Source Location: (276:9,34 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml)
|
||||
|cls|
|
||||
Generated Location: (2860:90,37 [3] )
|
||||
|cls|
|
||||
|
||||
Source Location: (279:9,37 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml)
|
||||
| }|
|
||||
Generated Location: (3032:95,37 [2] )
|
||||
| }|
|
||||
|
||||
Source Location: (285:9,43 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml)
|
||||
|
|
||||
|
|
||||
Generated Location: (3208:100,43 [6] )
|
||||
|
|
||||
|
|
||||
|
||||
Source Location: (309:10,22 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml)
|
||||
|
|
||||
|
|
||||
Generated Location: (3367:106,22 [6] )
|
||||
|
|
||||
|
|
||||
|
||||
Source Location: (329:11,18 [44] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml)
|
||||
|Url.Content("~/Scripts/jquery-1.6.2.min.js")|
|
||||
Generated Location: (3525:112,21 [44] )
|
||||
|Url.Content("~/Scripts/jquery-1.6.2.min.js")|
|
||||
|
||||
Source Location: (407:11,96 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml)
|
||||
|
|
||||
|
|
||||
Generated Location: (3797:117,96 [6] )
|
||||
|
|
||||
|
|
||||
|
||||
Source Location: (427:12,18 [60] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml)
|
||||
|Url.Content("~/Scripts/modernizr-2.0.6-development-only.js")|
|
||||
Generated Location: (3955:123,21 [60] )
|
||||
|Url.Content("~/Scripts/modernizr-2.0.6-development-only.js")|
|
||||
|
||||
Source Location: (521:12,112 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml)
|
||||
|
|
||||
|
|
||||
Generated Location: (4259:128,112 [6] )
|
||||
|
|
||||
|
|
||||
|
||||
Source Location: (638:13,115 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml)
|
||||
|
|
||||
|
|
||||
Generated Location: (4511:134,115 [2] )
|
||||
|
|
||||
|
|
||||
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/ConditionalAttributes.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "088be4e50958bcab0f1d1ac04d2c28dcd8049bf5"
|
||||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "088be4e50958bcab0f1d1ac04d2c28dcd8049bf5"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_RuntimeCodeGenerationIntegrationTest_ConditionalAttributes
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ConditionalAttributes_Runtime
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 1 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
#line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
|
||||
var ch = true;
|
||||
var cls = "bar";
|
||||
|
|
@ -19,7 +19,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
|||
#line hidden
|
||||
WriteLiteral(" <a href=\"Foo\" />\r\n <p");
|
||||
BeginWriteAttribute("class", " class=\"", 74, "\"", 86, 1);
|
||||
#line 5 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
WriteAttributeValue("", 82, cls, 82, 4, false);
|
||||
|
||||
#line default
|
||||
|
|
@ -28,7 +28,7 @@ WriteAttributeValue("", 82, cls, 82, 4, false);
|
|||
WriteLiteral(" />\r\n <p");
|
||||
BeginWriteAttribute("class", " class=\"", 98, "\"", 114, 2);
|
||||
WriteAttributeValue("", 106, "foo", 106, 3, true);
|
||||
#line 6 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
WriteAttributeValue(" ", 109, cls, 110, 4, false);
|
||||
|
||||
#line default
|
||||
|
|
@ -36,7 +36,7 @@ WriteAttributeValue(" ", 109, cls, 110, 4, false);
|
|||
EndWriteAttribute();
|
||||
WriteLiteral(" />\r\n <p");
|
||||
BeginWriteAttribute("class", " class=\"", 126, "\"", 142, 2);
|
||||
#line 7 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
#line 7 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
WriteAttributeValue("", 134, cls, 134, 4, false);
|
||||
|
||||
#line default
|
||||
|
|
@ -45,7 +45,7 @@ WriteAttributeValue("", 134, cls, 134, 4, false);
|
|||
EndWriteAttribute();
|
||||
WriteLiteral(" />\r\n <input type=\"checkbox\"");
|
||||
BeginWriteAttribute("checked", " checked=\"", 174, "\"", 187, 1);
|
||||
#line 8 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
#line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
WriteAttributeValue("", 184, ch, 184, 3, false);
|
||||
|
||||
#line default
|
||||
|
|
@ -54,7 +54,7 @@ WriteAttributeValue("", 184, ch, 184, 3, false);
|
|||
WriteLiteral(" />\r\n <input type=\"checkbox\"");
|
||||
BeginWriteAttribute("checked", " checked=\"", 219, "\"", 236, 2);
|
||||
WriteAttributeValue("", 229, "foo", 229, 3, true);
|
||||
#line 9 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
WriteAttributeValue(" ", 232, ch, 233, 3, false);
|
||||
|
||||
#line default
|
||||
|
|
@ -63,17 +63,17 @@ WriteAttributeValue(" ", 232, ch, 233, 3, false);
|
|||
WriteLiteral(" />\r\n <p");
|
||||
BeginWriteAttribute("class", " class=\"", 248, "\"", 281, 1);
|
||||
WriteAttributeValue("", 256, new HelperResult(async(__razor_attribute_value_writer) => {
|
||||
#line 10 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
if(cls != null) {
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 10 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
WriteTo(__razor_attribute_value_writer, cls);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 10 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
|
|
@ -83,7 +83,7 @@ WriteTo(__razor_attribute_value_writer, cls);
|
|||
EndWriteAttribute();
|
||||
WriteLiteral(" />\r\n <a href=\"~/Foo\" />\r\n <script");
|
||||
BeginWriteAttribute("src", " src=\"", 322, "\"", 373, 1);
|
||||
#line 12 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
#line 12 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
WriteAttributeValue("", 328, Url.Content("~/Scripts/jquery-1.6.2.min.js"), 328, 45, false);
|
||||
|
||||
#line default
|
||||
|
|
@ -91,7 +91,7 @@ WriteAttributeValue("", 328, Url.Content("~/Scripts/jquery-1.6.2.min.js"), 328,
|
|||
EndWriteAttribute();
|
||||
WriteLiteral(" type=\"text/javascript\"></script>\r\n <script");
|
||||
BeginWriteAttribute("src", " src=\"", 420, "\"", 487, 1);
|
||||
#line 13 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
#line 13 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ConditionalAttributes.cshtml"
|
||||
WriteAttributeValue("", 426, Url.Content("~/Scripts/modernizr-2.0.6-development-only.js"), 426, 61, false);
|
||||
|
||||
#line default
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_DesignTime_DesignTime
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
((System.Action)(() => {
|
||||
System.Object Footer = null;
|
||||
}
|
||||
))();
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 2 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml"
|
||||
for(int i = 1; i <= 10; i++) {
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml"
|
||||
__o = i;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml"
|
||||
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 8 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml"
|
||||
__o = Foo(Bar.Baz);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml"
|
||||
__o = Foo(item => new HelperResult(async(__razor_template_writer) => {
|
||||
#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml"
|
||||
__o = baz;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
DefineSection("Footer", async (__razor_section_writer) => {
|
||||
#line 14 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml"
|
||||
__o = bar;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
});
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
Source Location: (173:11,9 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml)
|
||||
|Footer|
|
||||
Generated Location: (396:10,14 [6] )
|
||||
|Footer|
|
||||
|
||||
Source Location: (20:1,13 [36] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml)
|
||||
|for(int i = 1; i <= 10; i++) {
|
||||
|
|
||||
Generated Location: (749:20,13 [36] )
|
||||
|for(int i = 1; i <= 10; i++) {
|
||||
|
|
||||
|
||||
Source Location: (74:2,22 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml)
|
||||
|i|
|
||||
Generated Location: (929:26,25 [1] )
|
||||
|i|
|
||||
|
||||
Source Location: (79:2,27 [15] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml)
|
||||
|
|
||||
}|
|
||||
Generated Location: (1077:31,27 [15] )
|
||||
|
|
||||
}|
|
||||
|
||||
Source Location: (113:7,2 [12] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml)
|
||||
|Foo(Bar.Baz)|
|
||||
Generated Location: (1217:37,6 [12] )
|
||||
|Foo(Bar.Baz)|
|
||||
|
||||
Source Location: (129:8,1 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml)
|
||||
|Foo(|
|
||||
Generated Location: (1355:42,6 [4] )
|
||||
|Foo(|
|
||||
|
||||
Source Location: (142:8,14 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml)
|
||||
|baz|
|
||||
Generated Location: (1524:44,17 [3] )
|
||||
|baz|
|
||||
|
||||
Source Location: (153:8,25 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml)
|
||||
|)|
|
||||
Generated Location: (1565:49,1 [1] )
|
||||
|)|
|
||||
|
||||
Source Location: (204:13,5 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/DesignTime.cshtml)
|
||||
|bar|
|
||||
Generated Location: (1768:55,8 [3] )
|
||||
|bar|
|
||||
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyCodeBlock_DesignTime
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
Source Location: (20:2,2 [0] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock.cshtml)
|
||||
||
|
||||
Generated Location: (656:16,2 [0] )
|
||||
||
|
||||
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/EmptyCodeBlock.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "a81f9de6dc302ab6600f3808428e5247ed389511"
|
||||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyCodeBlock.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "a81f9de6dc302ab6600f3808428e5247ed389511"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_RuntimeCodeGenerationIntegrationTest_EmptyCodeBlock
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyCodeBlock_Runtime
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyExplicitExpression_DesignTime
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/ImplicitExpressionAtEOF.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "ecf286733e30e006a630f3a5fe87c21f45e4c807"
|
||||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyExplicitExpression.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "e6467906896d16277c5a0cf962ac6d863c58852f"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_RuntimeCodeGenerationIntegrationTest_ImplicitExpressionAtEOF
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyExplicitExpression_Runtime
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpressionInCode_DesignTime
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 2 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
Source Location: (2:0,2 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode.cshtml)
|
||||
|
|
||||
|
|
||||
Generated Location: (686:16,2 [6] )
|
||||
|
|
||||
|
|
||||
|
||||
Source Location: (9:1,5 [2] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode.cshtml)
|
||||
|
|
||||
|
|
||||
Generated Location: (835:22,5 [2] )
|
||||
|
|
||||
|
|
||||
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/EmptyImplicitExpressionInCode.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "b21853e37dde51b305bde9602624934d4d6affd3"
|
||||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpressionInCode.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "b21853e37dde51b305bde9602624934d4d6affd3"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_RuntimeCodeGenerationIntegrationTest_EmptyImplicitExpressionInCode
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpressionInCode_Runtime
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpression_DesignTime
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/EmptyImplicitExpression.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "8ed47ba5d7cac644fdbb2c4f816d49bdeed1ac45"
|
||||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/EmptyImplicitExpression.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "8ed47ba5d7cac644fdbb2c4f816d49bdeed1ac45"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_RuntimeCodeGenerationIntegrationTest_EmptyImplicitExpression
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_EmptyImplicitExpression_Runtime
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionAtEOF_DesignTime
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/ExplicitExpressionAtEOF.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "bf53afff8ab65f1af9b9a82f9a571f1cd023dfc0"
|
||||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionAtEOF.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "bf53afff8ab65f1af9b9a82f9a571f1cd023dfc0"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_RuntimeCodeGenerationIntegrationTest_ExplicitExpressionAtEOF
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionAtEOF_Runtime
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionWithMarkup_DesignTime
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml"
|
||||
__o = item => new HelperResult(async(__razor_template_writer) => {
|
||||
}
|
||||
);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -1,16 +1,16 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "1252c799cdeb86a71e4304f01ebaae540fa26894"
|
||||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "1252c799cdeb86a71e4304f01ebaae540fa26894"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_RuntimeCodeGenerationIntegrationTest_ExplicitExpressionWithMarkup
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpressionWithMarkup_Runtime
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
WriteLiteral("<div>");
|
||||
#line 1 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml"
|
||||
#line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpressionWithMarkup.cshtml"
|
||||
Write(item => new HelperResult(async(__razor_template_writer) => {
|
||||
WriteLiteralTo(__razor_template_writer, "</div>");
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpression_DesignTime
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression.cshtml"
|
||||
__o = 1+1;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
Source Location: (10:0,10 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression.cshtml)
|
||||
|1+1|
|
||||
Generated Location: (675:16,13 [3] )
|
||||
|1+1|
|
||||
|
||||
|
|
@ -1,16 +1,16 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/ExplicitExpression.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "a897a227b26c531d644bdff988df46d3c8178346"
|
||||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "a897a227b26c531d644bdff988df46d3c8178346"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_RuntimeCodeGenerationIntegrationTest_ExplicitExpression
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExplicitExpression_Runtime
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
WriteLiteral("1 + 1 = ");
|
||||
#line 1 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/ExplicitExpression.cshtml"
|
||||
#line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExplicitExpression.cshtml"
|
||||
Write(1+1);
|
||||
|
||||
#line default
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExpressionsInCode_DesignTime
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml"
|
||||
|
||||
object foo = null;
|
||||
string bar = "Foo";
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml"
|
||||
if(foo != null) {
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 7 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml"
|
||||
__o = foo;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 7 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml"
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 9 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml"
|
||||
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 13 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml"
|
||||
if(!String.IsNullOrEmpty(bar)) {
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 14 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml"
|
||||
__o = bar.Replace("F", "B");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 14 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml"
|
||||
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
Source Location: (2:0,2 [51] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml)
|
||||
|
|
||||
object foo = null;
|
||||
string bar = "Foo";
|
||||
|
|
||||
Generated Location: (662:16,2 [51] )
|
||||
|
|
||||
object foo = null;
|
||||
string bar = "Foo";
|
||||
|
|
||||
|
||||
Source Location: (59:5,1 [23] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml)
|
||||
|if(foo != null) {
|
||||
|
|
||||
Generated Location: (838:23,1 [23] )
|
||||
|if(foo != null) {
|
||||
|
|
||||
|
||||
Source Location: (83:6,5 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml)
|
||||
|foo|
|
||||
Generated Location: (995:29,8 [3] )
|
||||
|foo|
|
||||
|
||||
Source Location: (86:6,8 [16] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml)
|
||||
|
|
||||
} else {
|
||||
|
|
||||
Generated Location: (1133:34,8 [16] )
|
||||
|
|
||||
} else {
|
||||
|
|
||||
|
||||
Source Location: (121:8,23 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml)
|
||||
|
|
||||
}|
|
||||
Generated Location: (1298:41,23 [3] )
|
||||
|
|
||||
}|
|
||||
|
||||
Source Location: (134:12,1 [38] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml)
|
||||
|if(!String.IsNullOrEmpty(bar)) {
|
||||
|
|
||||
Generated Location: (1429:47,1 [38] )
|
||||
|if(!String.IsNullOrEmpty(bar)) {
|
||||
|
|
||||
|
||||
Source Location: (174:13,6 [21] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml)
|
||||
|bar.Replace("F", "B")|
|
||||
Generated Location: (1603:53,9 [21] )
|
||||
|bar.Replace("F", "B")|
|
||||
|
||||
Source Location: (196:13,28 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml)
|
||||
|
|
||||
}|
|
||||
Generated Location: (1780:58,28 [3] )
|
||||
|
|
||||
}|
|
||||
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "8c7ae67489dbddec9f2dbef3c2b65def1149e507"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ExpressionsInCode_Runtime
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml"
|
||||
|
||||
object foo = null;
|
||||
string bar = "Foo";
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
#line 6 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml"
|
||||
if(foo != null) {
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 7 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml"
|
||||
Write(foo);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 7 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml"
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <p>Foo is Null!</p>\r\n");
|
||||
#line 10 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<p>\r\n");
|
||||
#line 13 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml"
|
||||
if(!String.IsNullOrEmpty(bar)) {
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 14 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml"
|
||||
Write(bar.Replace("F", "B"));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 14 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ExpressionsInCode.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</p>");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlockMinimal_DesignTime
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal.cshtml"
|
||||
|
||||
string foo(string input) {
|
||||
return input + "!";
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
Source Location: (16:2,12 [55] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal.cshtml)
|
||||
|
|
||||
string foo(string input) {
|
||||
return input + "!";
|
||||
}
|
||||
|
|
||||
Generated Location: (732:18,15 [55] )
|
||||
|
|
||||
string foo(string input) {
|
||||
return input + "!";
|
||||
}
|
||||
|
|
||||
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/FunctionsBlockMinimal.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "366e1cb1c026413435ec398a7d47c8c1acc373d8"
|
||||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "366e1cb1c026413435ec398a7d47c8c1acc373d8"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_RuntimeCodeGenerationIntegrationTest_FunctionsBlockMinimal
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlockMinimal_Runtime
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
|
|
@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
|||
WriteLiteral("\r\n\r\n");
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#line 3 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/FunctionsBlockMinimal.cshtml"
|
||||
#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlockMinimal.cshtml"
|
||||
|
||||
string foo(string input) {
|
||||
return input + "!";
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlock_DesignTime
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 12 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock.cshtml"
|
||||
__o = RandomInt();
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock.cshtml"
|
||||
|
||||
Random _rand = new Random();
|
||||
private int RandomInt() {
|
||||
return _rand.Next();
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
Source Location: (167:11,25 [11] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock.cshtml)
|
||||
|RandomInt()|
|
||||
Generated Location: (683:16,28 [11] )
|
||||
|RandomInt()|
|
||||
|
||||
Source Location: (12:0,12 [4] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock.cshtml)
|
||||
|
|
||||
|
||||
|
|
||||
Generated Location: (879:23,12 [4] )
|
||||
|
|
||||
|
||||
|
|
||||
|
||||
Source Location: (33:4,12 [104] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock.cshtml)
|
||||
|
|
||||
Random _rand = new Random();
|
||||
private int RandomInt() {
|
||||
return _rand.Next();
|
||||
}
|
||||
|
|
||||
Generated Location: (1016:29,12 [104] )
|
||||
|
|
||||
Random _rand = new Random();
|
||||
private int RandomInt() {
|
||||
return _rand.Next();
|
||||
}
|
||||
|
|
||||
|
||||
|
|
@ -1,24 +1,24 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/FunctionsBlock.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "94813053694a285515d791c48d703f1131881d0c"
|
||||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "94813053694a285515d791c48d703f1131881d0c"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_RuntimeCodeGenerationIntegrationTest_FunctionsBlock
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_FunctionsBlock_Runtime
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
WriteLiteral("\r\n");
|
||||
WriteLiteral("\r\nHere\'s a random number: ");
|
||||
#line 12 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/FunctionsBlock.cshtml"
|
||||
#line 12 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock.cshtml"
|
||||
Write(RandomInt());
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#line 5 "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/FunctionsBlock.cshtml"
|
||||
#line 5 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/FunctionsBlock.cshtml"
|
||||
|
||||
Random _rand = new Random();
|
||||
private int RandomInt() {
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HiddenSpansInCode_DesignTime
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 2 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode.cshtml"
|
||||
@Da
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
Source Location: (2:0,2 [6] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode.cshtml)
|
||||
|
|
||||
|
|
||||
Generated Location: (662:16,2 [6] )
|
||||
|
|
||||
|
|
||||
|
||||
Source Location: (9:1,5 [5] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode.cshtml)
|
||||
|@Da
|
||||
|
|
||||
Generated Location: (799:22,5 [5] )
|
||||
|@Da
|
||||
|
|
||||
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "5bd51d8947ca920e594be8d214b4ebee2888c90c"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HiddenSpansInCode_Runtime
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 2 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HiddenSpansInCode.cshtml"
|
||||
@Da
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Double_DesignTime
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/HtmlCommentWithQuote_Double.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "a07711bc1fd0478b3b8329a68ab2028ef93429df"
|
||||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Double.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "a07711bc1fd0478b3b8329a68ab2028ef93429df"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_RuntimeCodeGenerationIntegrationTest_HtmlCommentWithQuote_Double
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Double_Runtime
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Single_DesignTime
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/HtmlCommentWithQuote_Single.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "2d9bb4407e7aac9563aaeac9f0534a48f54e3d44"
|
||||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/HtmlCommentWithQuote_Single.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "2d9bb4407e7aac9563aaeac9f0534a48f54e3d44"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_RuntimeCodeGenerationIntegrationTest_HtmlCommentWithQuote_Single
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_HtmlCommentWithQuote_Single_Runtime
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ImplicitExpressionAtEOF_DesignTime
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/RuntimeCodeGenerationIntegrationTest/EmptyExplicitExpression.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "e6467906896d16277c5a0cf962ac6d863c58852f"
|
||||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpressionAtEOF.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "ecf286733e30e006a630f3a5fe87c21f45e4c807"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_RuntimeCodeGenerationIntegrationTest_EmptyExplicitExpression
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ImplicitExpressionAtEOF_Runtime
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ImplicitExpression_DesignTime
|
||||
{
|
||||
#pragma warning disable 219
|
||||
private void __RazorDirectiveTokenHelpers__() {
|
||||
}
|
||||
#pragma warning restore 219
|
||||
private static System.Object __o = null;
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression.cshtml"
|
||||
for(int i = 1; i <= 10; i++) {
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 2 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression.cshtml"
|
||||
__o = i;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#line 2 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression.cshtml"
|
||||
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
Source Location: (1:0,1 [36] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression.cshtml)
|
||||
|for(int i = 1; i <= 10; i++) {
|
||||
|
|
||||
Generated Location: (663:16,1 [36] )
|
||||
|for(int i = 1; i <= 10; i++) {
|
||||
|
|
||||
|
||||
Source Location: (55:1,22 [1] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression.cshtml)
|
||||
|i|
|
||||
Generated Location: (851:22,25 [1] )
|
||||
|i|
|
||||
|
||||
Source Location: (60:1,27 [3] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression.cshtml)
|
||||
|
|
||||
}|
|
||||
Generated Location: (1007:27,27 [3] )
|
||||
|
|
||||
}|
|
||||
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
#pragma checksum "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "77befd9645f3c2d9ab48b935faebf9f731f42abc"
|
||||
namespace Microsoft.AspNetCore.Razor.Evolution.IntegrationTests.TestFiles
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
public class TestFiles_IntegrationTests_CodeGenerationIntegrationTest_ImplicitExpression_Runtime
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
public async System.Threading.Tasks.Task ExecuteAsync()
|
||||
{
|
||||
#line 1 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression.cshtml"
|
||||
for(int i = 1; i <= 10; i++) {
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <p>This is item #");
|
||||
#line 2 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression.cshtml"
|
||||
Write(i);
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</p>\r\n");
|
||||
#line 3 "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ImplicitExpression.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue