Commit Graph

727 Commits

Author SHA1 Message Date
Pranav K 7657ea41a3 Updating to 4.4 CoreFx packages 2016-12-21 22:43:57 -08:00
Ryan Nowak c088a8871d Getting rid of Advance (part 1) 2016-12-20 12:11:23 -08:00
Ryan Nowak 0d569da92c Remove unused field 2016-12-20 11:12:18 -08:00
Ryan Nowak b8e1fb8011 Add line-mapping support to RazorSourceDocument 2016-12-20 09:06:12 -08:00
Ryan Nowak b473101927 Fix line endings 2016-12-20 08:56:18 -08:00
N. Taylor Mullen 88d99b06b3 Skip Razor.Evolution tests on Linux and Mac.
- Source ranges currently aren't normalized when they're input into the system. Due to how we serialize pieces of the code this breaks cross plat because of newline differences.
- This is a temporary work around to get the build passing cross plat.
2016-12-19 15:03:32 -08:00
Nate McMaster 705a490acb Upgrade to VS 2017 2016-12-16 16:04:22 -08:00
Ajay Bhargav Baaskaran e2dd09c918 [Fixes #881] Added TagHelper IR support 2016-12-15 11:46:35 -08:00
N. Taylor Mullen 61b2b0d4e7 Add model for differentiating design time and runtime parsing.
- If needed, a phase/feature can always retrieve the syntax tree to lookup whether the parse tree was made in a "design time" fashion.
- Future DesignTime / Runtime specific bits will be added to their corresponding `AddRuntimeDefaults`/`AddDesignTimeDefaults` methods.
2016-12-14 12:39:25 -08:00
N. Taylor Mullen 6ae3feff29 Remove unused parser options config code.
- This was supposed to be removed when code generation was added but was not.
2016-12-14 12:12:00 -08:00
N. Taylor Mullen eb230e0408 Port existing CSharp code generation integration tests.
- Added code generation test infrastructure to validate ported tests.

#847
2016-12-14 11:18:31 -08:00
N. Taylor Mullen 5d4c4e1ccf Add Razor runtime code generation.
- Added TabSize,IsIndentingWithTabs and NamespaceImports to the RazorParser options. These are replacements for the existing RazorEngineHost abstraction.
- Added RazorParserOptions consumption pattern to more than just the parsing phase.
- Added a ChecksumIRNode to ensure Debugging can work.
- Updated tests to to react to new Checksum and Namespace nodes in the IR tree.
2016-12-14 11:18:30 -08:00
N. Taylor Mullen 2db4985c21 Modify functions, section and inherits to use extensible directives.
- Removed existing type names used to track `@functions`, `@section` and `@inherits`.
- Updated parsing logic to reflect existing directive behaviors.
- Added additional IR and syntax tree pass in order to fulfill the default directive expectations.
- Updated tests to to expect new extensible directives parse structure.

#894
2016-12-14 11:12:40 -08:00
Ajay Bhargav Baaskaran 1b3863044d Removed packages list in NuGetPackageVerifier.json 2016-12-12 00:49:16 -08:00
N. Taylor Mullen f09fd291a7 Make `HtmlContentIRNode` content newlines platform agnostic.
- Prior to this the platform that the newlines were escaped on would be the platform the baselines would pass on.
- Updated baselines to reflect new newline escaping.

#888
2016-12-08 10:59:52 -08:00
N. Taylor Mullen 34ef31356f Fix policheck violation. 2016-12-08 10:20:47 -08:00
N. Taylor Mullen 2639fad8ab Transitioned SourceLocation => MappingLocation on IRNodes.
- Also modified the property name from `SourceLocation` => `SourceRange` to avoid ambiguity.
- Updated IR baselines
- Updated IR baseline infrastructure to conditionally render the document location.

#884
2016-12-08 10:18:28 -08:00
N. Taylor Mullen 3d8798f6b1 Update .travis.yml osx images to xcode7.3. 2016-12-08 09:58:06 -08:00
Ryan Nowak 026f9ffb69 Nodes that have children should use .Children
This removes special casing for nodes that contain children that were
hiding them in a .Content or .Value property.
2016-12-07 17:58:31 -08:00
N. Taylor Mullen 18bb31cee4 Change IntegrationTestBase to properly locate baseline files in net451.
- Net451 tests would have their current directory set to the dll that was located in bin/debug/framework/rid/... when run via `dotnet test`.

#885
2016-12-07 16:29:50 -08:00
Ryan Nowak 853c28e568 Add integration testing
This change adds a basic framework for doing baselined integration tests.
This is very similar to what we do elsewhere with generated files and
tests that read them from resources.

What's here now is the support to do this kind of baselining with IR in a
pretty readable serialization format.

This is a building block and the intent is that we'd do something similar
in the future for syntax nodes and C# source.

Looking at the code of the tests in particular, we'll also build the
ability to capture the documents at key points (such as before/after a
targeted phase) and then verify them in the same manner.
2016-12-06 11:25:04 -08:00
Ryan Nowak 2f54c12b82 Add missing interface to IR phase
Addressing PR feedback
2016-12-06 10:25:53 -08:00
Ryan Nowak 2190dc2096 Add RazorCSharpSourceDocument
Precursor to actual CSharp lowering
2016-12-04 23:30:55 -08:00
Ryan Nowak 9cefcdd450 Add legacy dependencies of C# lowering 2016-12-04 23:30:34 -08:00
Ryan Nowak 03549bb542 Add end-to-end support for extensible directives
This change adds a way to actually configure the RazorEngine to use
extensible directives (previously buried behind legacy API). As part of
this feature adds the RazorParserOptions class to encapsulate anything
else that becomes a parser options (ahem taghelpers).

Now we have a pattern for this when we get there.

Options are propagated as part of the RazorSyntaxTree for
testability/sanity and this was actually responsible for the bulk of the
changes.

Also added some extension methods for adding directives to the
IRazorEngineBuilder and an end to end integration test.
2016-12-03 18:44:54 -08:00
Ryan Nowak 46018f9512 Add IR phase
This change adds a phase which runs IR passes. Design and code are almost
exactly the same as the existing SyntaxTree phase. However all of this is
public because the IR is public API.
2016-11-29 21:28:27 -08:00
N. Taylor Mullen 518378f499 Add extensible directive abstractions
- Based generic directive implementation off of descriptors.
- Added parsing logic to consume descriptors and parse content that's expected.
- Added parsing errors to automagically detect unexpected directive pieces.
- Updated visitor implementations to understand the directive bits.
- Added a builder abstraction to easily create descriptors. Had to maintain the ability to manually construct a descriptor to enable convenient serialization/deserialization.
- Added tests/comparers to verify correctness of parsing.

#853
2016-11-23 19:56:40 -08:00
N. Taylor Mullen 522f6e969d Pin global.json SDK to 1.0.0-preview2-1-003177. 2016-11-23 15:58:35 -08:00
N. Taylor Mullen 47769c1626 Fix visit chunk generator naming. 2016-11-22 16:44:08 -08:00
N. Taylor Mullen cf7489e600 Port WhiteSpaceRewriter and ConditionalAttributeCollapser.
- Add an `HtmlNodeOptimizationPass` that does all of the `RazorSyntaxTreeRewriting` that legacy used to achieve outside of `TagHelper`s.
- Add tests for `HtmlNodeOptimizationPass` to verify it's executing appropriate bits.

#849
2016-11-22 12:04:31 -08:00
N. Taylor Mullen aa58ea6907 Change IR implementations to not hold all information in children.
- Added conditional attribute test.
- Reacted to Html optimization pass in tests.
- Removed directive IR bits since they'll be handled by the extensible directive system.

#844
2016-11-22 11:54:13 -08:00
Ryan Nowak d8b626c843 Implement IR lowering phase
This is a first cut of IR lowering and includes the basic node types and
some tests.
2016-11-22 11:25:23 -08:00
N. Taylor Mullen d0e1b810c4 Fix test case so it works cross plat.
- This just happened to be working on Windows. Newlines!
2016-11-21 14:52:52 -08:00
N. Taylor Mullen 6c8ef157b4 Add TagHelper binding abstractions.
- Added a TagHelperFeature to hold TagHelper specific pieces that can be replaced.
- Built a syntax tree pass that applies the ported TagHelper bits.
- Updated tests that expected different RazorEngine defaults.
- Added new tests to verify binder pass.
2016-11-21 11:04:42 -08:00
N. Taylor Mullen 26a1cf3cff Port existing TagHelper infrastructure.
- Modified how tests are run to reflect our new test infrastructure.
- Added TagHelper assertion bits.
- Moved all classes to the Evolution.Legacy namespace.
- Copied Test.Sources bits to the Evolution.Test project.

#845
2016-11-21 11:01:10 -08:00
N. Taylor Mullen 51fb0c993b Add indexability to the RazorSourceDocument.
- Removed the `CreateReader` API in favor of a `CopyTo`, `Length`, `[index]` and `Encoding`.
- Updated existing APIs to react to the change.
- Added tests.
2016-11-21 10:58:09 -08:00
Nate McMaster 8171a25079
Clean tmp folder after unzipping KoreBuild 2016-11-18 10:56:58 -08:00
Pranav K 03cf0d3528 Remove makefile.shade 2016-11-16 14:44:09 -08:00
N. Taylor Mullen 2b77446326 Update sln to reflect changed testing project. 2016-11-16 14:33:25 -08:00
N. Taylor Mullen dbcb690120 Update Razor.Evolution versions and package verifier. 2016-11-16 14:21:52 -08:00
Pranav K 1562865ca6 Add RazorProject - an abstraction for working with Razor files in a project
Fixes #842
2016-11-16 14:06:03 -08:00
Ryan Nowak d42a4c84a1 Rename IR* -> RazorIR* 2016-11-16 14:06:03 -08:00
Ryan Nowak d40f6d3151 Add abstractions for Razor IR
This is an API skeleton for the IR data model that we'll be using as a
spiritual continuation of the 'chunks' API. Currently missing a lot of
detail which will be filled in as needed.
2016-11-16 14:06:02 -08:00
Ryan Nowak b74ea5d74e Fix failing tests 2016-11-16 14:06:02 -08:00
Ryan Nowak b341340d1f Add skeleton of syntax phases 2016-11-16 14:06:01 -08:00
Ryan Nowak 49d3574677 Make tests public - xUnit requires this 2016-11-16 14:06:01 -08:00
N. Taylor Mullen d06e5b6002 Add legacy parser 2016-11-16 14:06:00 -08:00
Ryan Nowak 6b9b75841f Add Razor Evolution Engine and primitives 2016-11-16 14:05:58 -08:00
Pranav K 43caef488c Use IsTeamCity to determine if we're running on the CI 2016-11-16 14:05:58 -08:00
Pranav K 3b5a0db512 Push packages as part of invoking verify on the feed 2016-11-16 14:05:57 -08:00