Commit Graph

47 Commits

Author SHA1 Message Date
Ajay Bhargav Baaskaran bd8e9ecc31 Added RazorParserFeatureFlags and added support for minimized bool tag
helper bound attributes
 - Fixes #1678, #431
2017-09-29 16:02:09 -07:00
Ajay Bhargav Baaskaran 4b68a48f1d Fix: Broken intellisense for extensible directives 2017-08-29 14:47:52 -07:00
Ajay Bhargav Baaskaran fa6fde2b20 Moved TagHelper directive validation and parsing from TagHelperBinder to
CSharpCodeParser
2017-08-23 17:14:41 -07:00
N. Taylor Mullen 6e42c8d0e4 Made section 1.X compatibility only apply at design time.
#1637
2017-08-22 20:47:01 -07:00
N. Taylor Mullen 5104e8c806 Make 2.0 codegen compatible with 1.0 projects until multi-targeting is complete.
#1637
2017-08-22 17:29:33 -07:00
Ajay Bhargav Baaskaran 4fcad1548e Added support for multitargeting
- Added 1_X src project for multitargeting

- Added 1_X test project for multitargeting

- Added 1_X test MvcShim for multitargeting

- Make section directive generate the correct code the appropriate version

- Added another sln
2017-08-04 15:39:18 -07:00
N. Taylor Mullen f8d43853f8 Re-introduce RazorEditorParser.
- Revived `RazorEditorParser`.
- Made `PartialParseResult` internal and renamed it to `PartialParseResultInternal`. This fell in line with other syntax tree types.
- Moved the `RazorEditorParser` implementation away from `TextChange` and `ITextBuffer`. Instead it now relies on `SourceChange` and the VS contract `ITextSnapshot`.
- Added `RazorEditorParserTest` to ensure the changes in implementation did not impact previous functionality.
- Removed some obvious tests that unnecessarily re-tested behavior that was already verified.
- Updated tests.
- Moved several Language.Test types to the common test project so they could be reused.

#1259
2017-07-12 17:01:16 -07:00
Ryan Nowak 7408bcd025 Rewrite of code rendering context 2017-07-05 15:32:54 -07:00
Ryan Nowak 112cbc0bb6 Check for warnrings in tests taht compile
This fixes and issue that snuck through and broke MVC as well as
preventing this from happening in the future.
2017-07-01 11:52:41 -07:00
Ryan Nowak 7aeb228063 Redesign tag helper codegen 2017-06-30 17:34:01 -07:00
Ryan Nowak 853b458893 This is a different take on Taylor's builders.
This makes it possible to use another 'kind' of tag helpers, which isn't
possible today.

This also further decouples the tag helper api surface from the default
implementation.

VCTH now have their own 'kind'.

Also improved generation of display names and error messages where it
was coupled to the type name.
2017-06-28 17:37:52 -07:00
N. Taylor Mullen dd10b0b086 Update test node writer to write malformed directives.
- Updated baselines.

#1456
2017-06-28 16:34:56 -07:00
N. Taylor Mullen 05cc4123a7 Add duplicate directive error for th prefix.
- Regenerated diagnostics for integration tests.
- Added a duplicate directive unit test.
- Added a new RazorDiagnostic entry in the factory.

#942
2017-06-28 16:12:02 -07:00
Ajay Bhargav Baaskaran d73ecf8b36 Suppress warnings for auto generated code 2017-06-26 17:35:11 -07:00
N. Taylor Mullen 7a04e35da5 Update built-in directives to use DirectiveUsage.
- Updated integration code gen and IR bits to reflect new directive usage.
- Updated existing unit tests that happened to test directives in code blocks to now test what happens when they exist at the document level. Being inside of a code block is now invalid and we have separate tests for that scenario.

#1376
2017-06-22 11:42:37 -07:00
Ryan Nowak 7a234ca513 Rename UsingStatement>UsingDirective 2017-06-21 19:54:40 -07:00
Ryan Nowak a580c8fdf1 Get rid of AccessModifiers 2017-06-21 19:10:57 -07:00
Ryan Nowak a40ca857c5 Rename HtmlAttributeValueStyle>AttributeStructure 2017-06-21 18:56:37 -07:00
Ryan Nowak 21e26ad4aa Rename RazorIRNode
Get rid of references to 'IR'
2017-06-21 12:55:16 -07:00
Ryan Nowak 062d7561ae Make section an extension node 2017-06-20 19:20:46 -07:00
N. Taylor Mullen 132c8c7a7e Implement consistent error story for directives.
- Added error case that enforces whitespace in between directive tokens.
- Upon encountering invalid directive tokens/states we bail out of parsing and log an appropriate error.
- Raised directive parse errors to the IR layer. This is slightly hacky given the parsers limitations; we swap out the error sink temporarily to capture all directive parser errors and then shove the errors collected onto the directives chunk generator.
- Added a `MalformedDiretiveIRNode` and corresponding pass to represent directives that are in an invalid state. Chose to not take the path of using the default `DirectiveIRNode.Diagnostics` member to enable users who are extending directives to only ever have to work with "valid" directives. If they want to work with malformed directives they can search the IR document for their malformed counterpart and handle it separately.
- Updated existing test expectations
- Removed some existing tests that were no longer valid (we don't call into user code if a directive is malformed).

#1173
2017-06-19 21:14:06 -07:00
Ajay Bhargav Baaskaran 3892a6fede Removed ChecksumIRNode 2017-06-16 11:14:54 -07:00
Ajay Bhargav Baaskaran 27ac5da6d5 Add indexer null-check for preallocated tag helper attributes 2017-06-13 10:53:07 -07:00
Ajay Bhargav Baaskaran 27b73d737b Set correct value style for literal tag helper bound attributes 2017-06-09 12:05:27 -07:00
Ryan Nowak e05c697c58 Fix #1356 verify diagnostics in integration tests 2017-06-08 17:03:43 -07:00
Ajay Bhargav Baaskaran 8bba757703 Don't ignore whitespace at the start of '<text>' tag 2017-06-08 11:56:24 -07:00
Ajay Bhargav Baaskaran a6d2c04195 [Fixes #1379] Rename CSharpStatement to CSharpCode 2017-06-07 15:20:47 -07:00
Ajay Bhargav Baaskaran 2f03a39e41 Refactored attribute values IR 2017-05-26 12:34:34 -07:00
N. Taylor Mullen dcccea3004 Add Checksum computation to RazorSourceDocument.
- Renamed many of our `RazorSourceDocument` abstractions to not include the word `Razor`.
- Added a `GetChecksum()` method to `RazorSourceDocument` to allow source documents to compute their own checksums.
- Re-generated codegen tests that did not normalize new lines. Ones that did re-generate newlines converted from stream => string => normalized string and then ran the Razor parser.
- Added tests to validate `GetChecksum` for all source document types.
- Removed unused `LegacySourceDocument`.
2017-05-26 12:29:36 -07:00
Ajay Bhargav Baaskaran 1efcdafa45 Removed ExecuteTagHelpersIRNode 2017-05-22 11:03:34 -07:00
Ryan Nowak 811ea019a5 Fixes #1245 - Make TemplateCodeExtension public
This removes the hardcoding of an MVC type from Razor.
2017-05-17 20:25:06 -07:00
N. Taylor Mullen 657c2a8da3 Merge branch 'rel/15.3' into dev
# Conflicts:
#	test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/IntegrationTests/CodeGenerationIntegrationTest.cs
2017-05-17 11:24:32 -07:00
Ajay Bhargav Baaskaran 7bd13061b5 Set the chunk generator of non-string tag helper attributes to ExpressionChunkGenerator 2017-05-17 11:17:01 -07:00
N. Taylor Mullen b8ea008151 Make extensible directive type token rendering allow value types.
- Instead of rendering a null assigning statement for a type token we now render a `default(TTypeToken)`. With this approach type tokens can be value types without creating a design time error.
- Re-generated baseline files to reflect new directive token code generation.

#1176
2017-05-17 10:31:16 -07:00
Ryan Nowak a8dd0355d0 Remove default usings
This change removes the default usings for 'System' and
'System.Threading.Tasks' and adds them to the MVC template engine.

This is preparation for removing this feature from the razor options, I
wanted to get all of the intentional diff out of the way.
2017-05-12 17:08:58 -07:00
Ryan Nowak 86d045c667 Fix #1305 move instrumentation to MVC 2017-05-12 16:14:17 -07:00
Ryan Nowak b17e506ce8 Some API cleanup around directivest 2017-05-12 13:27:28 -07:00
Ajay Bhargav Baaskaran b44d59ca36 Remove Redirect writers 2017-05-11 15:38:54 -07:00
Ryan Nowak 2afe2e1627 Rename RazorMethodDeclaration -> MethodDeclaration 2017-05-11 10:22:45 -07:00
Ryan Nowak 1705888721 Add a test for #153 - already fixed 2017-05-05 12:48:01 -07:00
Ajay Bhargav Baaskaran c71f6e7c3f [Fixes #1058] Added a test to verify nested enum behavior 2017-05-05 11:50:31 -07:00
N. Taylor Mullen 0e509b4bbb Add incomplete directive integration tests.
- These tests validate that our extensible directives do not have code that explodes when an incomplete directive is encountered. This is typically the case when a user is in the midst of typing a directive at design time.
- Added an extensions test and a language test.

#1271
2017-05-01 14:32:17 -07:00
Ryan Brandenburg 8af9f656dd Add CodeGen tests for @inherits 2017-05-01 10:42:00 -07:00
Ajay Bhargav Baaskaran 4e2cd0c2d6 Finish writer implementation of the remaining IR nodes and added tests
- SetTagHelperPropertyIRNode
- ChecksumIRNode
- UsingStatementIRNode
- Preallocated attributes target extension
- HtmlAttributeIRNode and friends
- Design time directive helper target extension
- Removed renderers and rendering conventions
- Regenerated IR baselines
Issue - #846 and #1051
2017-04-21 11:46:34 -07:00
N. Taylor Mullen 1696e2aebf Upgrade Razor's Roslyn dependency to 2.0.0.
- Added C# 7 test to validate questionable features work end-to-end.
- Had to add several explicit package references to let our VS specific packages work as expected.

#1046
2017-04-21 11:40:21 -07:00
Ajay Bhargav Baaskaran 0f7b0f5d8c [Fixes #1196] Remove Content property from HtmlContentIRNode 2017-04-10 12:54:11 -07:00
N. Taylor Mullen 0618bae3bd Rename Microsoft.AspNetCore.Razor.Evolution => Microsoft.AspNetCore.Razor.Language.
- Also updated corresponding test project to go from Evolution => Language.
- Regenerated test files to reflect new file paths.

#1169
2017-04-10 10:20:04 -07:00