Commit Graph

24 Commits

Author SHA1 Message Date
Pranav K a6d611aecd Introduce RazorCompilation 2017-02-22 10:22:18 -08:00
Ryan Nowak 0dbf62196c Introduces RuntimeTarget and abstraction for APIs
This is a new abstraction that represents the api surface available for
codegen to target. Every kind of document should have an associated
RuntimeTarget or just use the default.

To prevent breakage, our DocumentClassifierBase class will provide a
default API set to implementors (like MVC).

I haven't fundamentally changed how codegen is done yet, I've just hidden
it behind a new abstraction. The RuntimeTarget now is also responsible for
selecting between design time and runtime.

The bulk of the noise here is from splitting a lot of the codegen stuff
into its own files.
2017-02-13 15:34:51 -08:00
Pranav K 2eba53de1b Add support for optional directives 2017-02-07 19:20:49 -08:00
Pranav K a801a49377 Add an API to RazorProject to navigate hierarchical files
Fixes #962
2017-02-03 11:25:15 -08:00
Ryan Nowak e549270b4a Add RazorDiagnostic type
This is a replacement for RazorError, is conceptually equivalent with
Diagnostic from Roslyn.

The next PR will start exposing this through our public API rather than
the legacy type.
2017-01-31 15:53:22 -08:00
Ryan Nowak 03b63d97a2 Quick fixes from MVC
We're close to hooking up new Razor to MVC. This is a set of enabling
'quick fix' changes to resolve some blockers to using Razor.Evolution in
the product.

Main issues:
 - Types not public enough - anything in the .Legacy namespace is still
   slated from 'improvement'
 - Wrong references. We don't want .Workspaces in MVC, so moving the heavy
   lifting of TagHelper discovery to CodeAnalysis.Razor.
2017-01-24 09:22:28 -08:00
Ryan Nowak 851dd7ba3b Add support for TagHelper directives
This commit adds support to the TagHelperBinderSyntaxTreePass to interpret
@addTagHelper, @removeTagHelper, and @tagHelperPrefix.

I also ported all the original tests for this feature and updated them to
call new APIs.

The bulk of the changes here were updates to baseline tests that weren't
correctly using @addTagHelper
2017-01-20 17:44:35 -08:00
N. Taylor Mullen ee59368467 Add Microsoft.CodeAnalysis.Razor.Workspaces.Test project.
#851
2017-01-10 12:12:36 -08:00
Ryan Nowak cbc8d12a0c Code dump of Razor extension 2017-01-09 13:09:25 -08:00
Ryan Nowak 3351192dc5 Code dump of Visual Studio language services 2017-01-09 11:08:50 -08:00
Ryan Nowak 2c55a03667 Code dump of prototype servicehub service 2017-01-09 11:08:50 -08:00
Ryan Nowak a289e04cb4 Code dump of TagHelper discovery prototype
Adds a new project for design time Razor analysis
2017-01-09 11:08:50 -08:00
Ajay Bhargav Baaskaran 9dece91975 [Fixes #882] Added TagHelper runtime code generation support 2016-12-27 11:29:25 -08:00
N. Taylor Mullen c6150ba287 Move section support into IR.
- Previously we'd special case `@section` at code generation time; now we transform the directive into an IR node.
- Changed the expectations of `DefineSection` to not take in a section writer. It's now expected to modify what `Write`, `WriteLiteral` etc. write to when inside of the lambda. This is done today in TagHelpers via `StartTagHelperWritingScope`.
- Updated baseline files to reflect new `DefineSection` expectations.
- Updated IR tests since we no longer leave around `DirectiveIRNode`s.

#901
2016-12-22 14:39:25 -08:00
Nate McMaster 705a490acb Upgrade to VS 2017 2016-12-16 16:04:22 -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
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 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
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 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
N. Taylor Mullen 17f3e3bbab Initial project skeleton for Razor Evolution 2016-11-16 14:05:57 -08:00