parent
73e8fc10e4
commit
cef32d4098
|
|
@ -2,10 +2,10 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using Microsoft.AspNet.Mvc.Razor.Host;
|
||||
using Microsoft.AspNet.Razor;
|
||||
using Microsoft.AspNet.Razor.Generator;
|
||||
using Microsoft.AspNet.Razor.Parser;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
using Microsoft.AspNet.Razor.Text;
|
||||
using Microsoft.AspNet.Razor.Tokenizer.Symbols;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
// Copyright (c) Microsoft Open Technologies, Inc. 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 System.Linq;
|
||||
using Microsoft.AspNet.Razor;
|
||||
using Microsoft.AspNet.Razor.Generator.Compiler;
|
||||
using Microsoft.AspNet.Razor.Parser;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
using Microsoft.AspNet.Razor.Parser.TagHelpers;
|
||||
using Microsoft.AspNet.Razor.TagHelpers;
|
||||
using Microsoft.AspNet.Razor.Text;
|
||||
using Microsoft.Framework.Internal;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
|
|
@ -45,7 +44,7 @@ namespace Microsoft.AspNet.Mvc.Razor
|
|||
/// <inheritdoc />
|
||||
protected override IEnumerable<TagHelperDescriptor> GetTagHelperDescriptors(
|
||||
[NotNull] Block documentRoot,
|
||||
[NotNull] ParserErrorSink errorSink)
|
||||
[NotNull] ErrorSink errorSink)
|
||||
{
|
||||
var visitor = new GlobalImportTagHelperDirectiveSpanVisitor(
|
||||
TagHelperDescriptorResolver,
|
||||
|
|
@ -120,7 +119,7 @@ namespace Microsoft.AspNet.Mvc.Razor
|
|||
public GlobalImportTagHelperDirectiveSpanVisitor(
|
||||
ITagHelperDescriptorResolver descriptorResolver,
|
||||
IEnumerable<TagHelperDirectiveDescriptor> globalImportDirectiveDescriptors,
|
||||
ParserErrorSink errorSink)
|
||||
ErrorSink errorSink)
|
||||
: base(descriptorResolver, errorSink)
|
||||
{
|
||||
_globalImportDirectiveDescriptors = globalImportDirectiveDescriptors;
|
||||
|
|
@ -128,7 +127,7 @@ namespace Microsoft.AspNet.Mvc.Razor
|
|||
|
||||
protected override TagHelperDescriptorResolutionContext GetTagHelperDescriptorResolutionContext(
|
||||
IEnumerable<TagHelperDirectiveDescriptor> descriptors,
|
||||
ParserErrorSink errorSink)
|
||||
ErrorSink errorSink)
|
||||
{
|
||||
var directivesToImport = MergeDirectiveDescriptors(descriptors, _globalImportDirectiveDescriptors);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
using Microsoft.AspNet.Razor;
|
||||
using Microsoft.Framework.Internal;
|
||||
using Microsoft.Framework.Runtime;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
using Microsoft.AspNet.Razor.Text;
|
||||
using Microsoft.AspNet.Razor;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.Text;
|
||||
using Microsoft.Framework.Internal;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ using System.Globalization;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.Claims;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Http;
|
||||
using Microsoft.AspNet.Mvc.Rendering;
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
|
||||
using System;
|
||||
using Microsoft.AspNet.Mvc.Razor.Directives;
|
||||
using Microsoft.AspNet.Razor;
|
||||
using Microsoft.AspNet.Razor.Generator;
|
||||
using Microsoft.AspNet.Razor.Generator.Compiler;
|
||||
using Microsoft.AspNet.Razor.Generator.Compiler.CSharp;
|
||||
using Microsoft.AspNet.Razor.Parser;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
using Xunit;
|
||||
|
||||
|
|
@ -153,7 +153,7 @@ MyType1
|
|||
"MyNamespace",
|
||||
string.Empty,
|
||||
shouldGenerateLinePragmas: true),
|
||||
new ParserErrorSink());
|
||||
new ErrorSink());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3,10 +3,10 @@
|
|||
|
||||
using System;
|
||||
using Microsoft.AspNet.Mvc.Razor.Directives;
|
||||
using Microsoft.AspNet.Razor;
|
||||
using Microsoft.AspNet.Razor.Generator;
|
||||
using Microsoft.AspNet.Razor.Generator.Compiler;
|
||||
using Microsoft.AspNet.Razor.Generator.Compiler.CSharp;
|
||||
using Microsoft.AspNet.Razor.Parser;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
using Xunit;
|
||||
|
||||
|
|
@ -109,7 +109,7 @@ Environment.NewLine +
|
|||
"MyNamespace",
|
||||
string.Empty,
|
||||
shouldGenerateLinePragmas: true),
|
||||
new ParserErrorSink());
|
||||
new ErrorSink());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNet.Razor;
|
||||
using Microsoft.AspNet.Razor.Generator;
|
||||
using Microsoft.AspNet.Razor.Generator.Compiler;
|
||||
using Microsoft.AspNet.Razor.Parser;
|
||||
|
|
@ -491,7 +492,7 @@ namespace Microsoft.AspNet.Mvc.Razor
|
|||
codeParser,
|
||||
markupParser,
|
||||
markupParser,
|
||||
new ParserErrorSink());
|
||||
new ErrorSink());
|
||||
codeParser.Context = context;
|
||||
markupParser.Context = context;
|
||||
markupParser.ParseDocument();
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ using Microsoft.AspNet.Razor.Generator;
|
|||
using Microsoft.AspNet.Razor.Generator.Compiler;
|
||||
using Microsoft.AspNet.Razor.Generator.Compiler.CSharp;
|
||||
using Microsoft.AspNet.Razor.Parser;
|
||||
using Microsoft.AspNet.Razor.Text;
|
||||
using Microsoft.Framework.Internal;
|
||||
using Xunit;
|
||||
|
||||
|
|
@ -69,7 +68,7 @@ namespace Microsoft.AspNet.Mvc.Razor
|
|||
host.DefaultNamespace,
|
||||
rootedFilePath,
|
||||
shouldGenerateLinePragmas: true),
|
||||
new ParserErrorSink());
|
||||
new ErrorSink());
|
||||
var codeBuilder = new CSharpCodeBuilder(codeBuilderContext);
|
||||
host.ChunkInheritanceUtility = chunkInheritanceUtility;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNet.Razor;
|
||||
using Microsoft.AspNet.Razor.Generator.Compiler;
|
||||
using Microsoft.AspNet.Razor.Parser;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
using Microsoft.AspNet.Razor.TagHelpers;
|
||||
using Microsoft.AspNet.Razor.Text;
|
||||
using Moq;
|
||||
using Xunit;
|
||||
|
||||
|
|
@ -160,7 +160,7 @@ namespace Microsoft.AspNet.Mvc.Razor
|
|||
var parser = new TestableMvcRazorParser(baseParser, codeTrees, defaultInheritedChunks: new Chunk[0]);
|
||||
|
||||
// Act
|
||||
parser.GetTagHelperDescriptorsPublic(block, errorSink: new ParserErrorSink()).ToArray();
|
||||
parser.GetTagHelperDescriptorsPublic(block, errorSink: new ErrorSink()).ToArray();
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(descriptors);
|
||||
|
|
@ -203,7 +203,7 @@ namespace Microsoft.AspNet.Mvc.Razor
|
|||
|
||||
public IEnumerable<TagHelperDescriptor> GetTagHelperDescriptorsPublic(
|
||||
Block documentRoot,
|
||||
ParserErrorSink errorSink)
|
||||
ErrorSink errorSink)
|
||||
{
|
||||
return GetTagHelperDescriptors(documentRoot, errorSink);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using Microsoft.AspNet.Razor;
|
||||
using Microsoft.AspNet.Razor.Generator;
|
||||
using Microsoft.AspNet.Razor.Generator.Compiler.CSharp;
|
||||
using Microsoft.AspNet.Razor.Parser;
|
||||
using Microsoft.AspNet.Razor.TagHelpers;
|
||||
using Xunit;
|
||||
|
||||
|
|
@ -32,7 +32,7 @@ namespace Microsoft.AspNet.Mvc.Razor
|
|||
rootNamespace: string.Empty,
|
||||
sourceFile: string.Empty,
|
||||
shouldGenerateLinePragmas: true);
|
||||
var errorSink = new ParserErrorSink();
|
||||
var errorSink = new ErrorSink();
|
||||
var context = new CodeBuilderContext(generatorContext, errorSink);
|
||||
|
||||
// Act
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using Microsoft.AspNet.Razor;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
using Microsoft.AspNet.Razor.Text;
|
||||
using Microsoft.AspNet.Razor.Tokenizer.Symbols;
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNet.Razor;
|
||||
using Microsoft.AspNet.Razor.Editor;
|
||||
using Microsoft.AspNet.Razor.Generator;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
using Microsoft.AspNet.Razor.Text;
|
||||
using Microsoft.AspNet.Razor.Tokenizer.Symbols;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNet.Razor;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
using Microsoft.AspNet.Razor.Text;
|
||||
using Microsoft.AspNet.Razor.Tokenizer;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using Microsoft.AspNet.Razor;
|
||||
using Microsoft.AspNet.Razor.Generator;
|
||||
using Microsoft.AspNet.Razor.Parser;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ using System.Linq;
|
|||
using Microsoft.AspNet.FileProviders;
|
||||
using Microsoft.AspNet.Razor;
|
||||
using Microsoft.AspNet.Razor.Generator.Compiler;
|
||||
using Microsoft.AspNet.Razor.Parser;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
using Microsoft.AspNet.Razor.TagHelpers;
|
||||
using Moq;
|
||||
|
|
@ -50,7 +49,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
|||
public void Compile_ReturnsFailedResultIfParseFails()
|
||||
{
|
||||
// Arrange
|
||||
var errorSink = new ParserErrorSink();
|
||||
var errorSink = new ErrorSink();
|
||||
errorSink.OnError(new RazorError("some message", 1, 1, 1, 1));
|
||||
var generatorResult = new GeneratorResults(
|
||||
new Block(new BlockBuilder { Type = BlockType.Comment }),
|
||||
|
|
@ -89,7 +88,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
|||
var generatorResult = new GeneratorResults(
|
||||
new Block(new BlockBuilder { Type = BlockType.Comment }),
|
||||
Enumerable.Empty<TagHelperDescriptor>(),
|
||||
new ParserErrorSink(),
|
||||
new ErrorSink(),
|
||||
new CodeBuilderResult(code, new LineMapping[0]),
|
||||
new CodeTree());
|
||||
var host = new Mock<IMvcRazorHost>();
|
||||
|
|
@ -121,7 +120,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation
|
|||
return new GeneratorResults(
|
||||
new Block(new BlockBuilder { Type = BlockType.Comment }),
|
||||
Enumerable.Empty<TagHelperDescriptor>(),
|
||||
new ParserErrorSink(),
|
||||
new ErrorSink(),
|
||||
new CodeBuilderResult("", new LineMapping[0]),
|
||||
new CodeTree());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Host.Test
|
|||
codeParser,
|
||||
markupParser,
|
||||
markupParser,
|
||||
new ParserErrorSink());
|
||||
new ErrorSink());
|
||||
codeParser.Context = context;
|
||||
markupParser.Context = context;
|
||||
markupParser.ParseDocument();
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
using Microsoft.AspNet.Razor.Text;
|
||||
using Microsoft.AspNet.Razor;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNet.Mvc.Razor.Precompilation
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNet.Razor;
|
||||
using Microsoft.AspNet.Razor.Editor;
|
||||
using Microsoft.AspNet.Razor.Generator;
|
||||
using Microsoft.AspNet.Razor.Parser.SyntaxTree;
|
||||
|
|
|
|||
Loading…
Reference in New Issue