Commit Graph

111 Commits

Author SHA1 Message Date
Ryan Nowak 40080f3637 add issue numbers 2018-09-13 16:04:17 -07:00
Ryan Nowak 8d537a3c43 Add Issue numbers 2018-09-13 16:03:36 -07:00
Ryan Nowak b67fa0664d Check for spans that are missing from output 2018-09-13 14:51:46 -07:00
Ajay Bhargav Baaskaran 96709c4d77
Actually verify classified spans (#2575) 2018-09-10 10:48:47 -07:00
N. Taylor Mullen 4619d59828 Add IVT to Razor LanguageServer.
- `LanguageServer.StrongNamed` isn't a thing anymore.
2018-08-30 11:26:02 -07:00
Ajay Bhargav Baaskaran f4808b50b5 Renamed WhiteSpace to Whitespace 2018-08-24 15:45:55 -07:00
Ajay Bhargav Baaskaran db2a142132
Updated the tokenizer and parser to operate on SyntaxTokens directly (#2540)
* Updated the tokenizer and parser to operate on SyntaxTokens directly
- The tokenizer and parser now operates directly on SyntaxTokens (Green)
- The SyntaxToken(Red) is now created when the Span is built with the correct parent and position
- All other passes that run after the parsing is complete(TagHelperRewriter etc) will operate on the Red tokens.
- There is now only one type for all SyntaxTokens. They are differentiated by their SyntaxKind.
- Added equivalence checking for tokens
- Updated test code to react
- Regenerated baselines
2018-08-16 16:11:01 -07:00
Ajay Bhargav Baaskaran 9a9931d59f
Initial infrastrucure for a better html parser (#2522)
Initial infrastrucure for a better html parser
- Added new syntax node types that follow Roslyn's red/green pattern
- Modified the html text node in the current syntax tree to use the new
nodes
- Updated test infrastructure
- Generated baselines
2018-08-13 11:26:24 -07:00
Ajay Bhargav Baaskaran 8e667ba730 Rename parser tests to have shorter names 2018-07-19 15:22:30 -07:00
Ajay Bhargav Baaskaran 21f2edce16 Generate and verify baselines for ClassifiedSpans and TagHelperSpans
- Moved GetClassifiedSpans and GetTagHelperSpans logic to Razor.Language
2018-07-17 10:54:42 -07:00
Ajay Bhargav Baaskaran ce4780a830 Renamed symbol to token everywhere
- Updated Resources
- Updated test code
- Regenerated baselines
- Added exclusions for apicheck (See https://github.com/aspnet/BuildTools/issues/704)
2018-07-06 16:29:36 -07:00
Ajay Bhargav Baaskaran ed7c4e8f5c Parser tests clean up 2018-07-06 16:24:39 -07:00
Ajay Bhargav Baaskaran 984e7826d6 Converted TagHelperParseTreeRewriterTest 2018-06-29 12:23:52 -07:00
Ajay Bhargav Baaskaran b232a1103a Prereq for converting tag helper tests 2018-06-29 12:15:13 -07:00
Ajay Bhargav Baaskaran 048a6ec3ea Converted HtmlAttributeTest 2018-06-27 14:47:44 -07:00
Ryan Nowak 4fda468f06 Convert CSharpSectionTest 2018-06-27 13:14:58 -07:00
Ajay Bhargav Baaskaran c0929a9002 Convert CSharpErrorTest 2018-06-27 12:53:52 -07:00
Ajay Bhargav Baaskaran ab27e0bd52 Converted CSharpBlockTest to use baselines 2018-06-26 18:02:50 -07:00
Ajay Bhargav Baaskaran 1e58748f59 Converted HtmlBlockTest to use baselines 2018-06-26 16:09:05 -07:00
Ajay Bhargav Baaskaran a92089d2f9 Converted CSharpDirectivesTest to use baselines 2018-06-26 15:17:36 -07:00
Ajay Bhargav Baaskaran 2aea2c6b9f Use correct newline string when splitting baselines 2018-06-25 14:38:15 -07:00
Ajay Bhargav Baaskaran fdf4a0dca8 Fix build break 2018-06-25 14:14:29 -07:00
Ajay Bhargav Baaskaran c7959c3c43 Fix failing tests 2018-06-25 13:55:53 -07:00
Ajay Bhargav Baaskaran 999c24d78d Converted more parser tests to baselines
- Converted CSharpAutoCompleteTest
2018-06-25 11:43:17 -07:00
Ajay Bhargav Baaskaran b821ce8b8e First step in converting parser tests to use baselines
- Added the necessary infrastructure to serialize and verify the syntax
tree
- Updated ParserVisitor to be overrideable
- Made CSharpVerbatimBlockTest to use baselines
2018-06-19 15:57:05 -07:00
N. Taylor Mullen 1aa15374b5 Add partial parsing of `@functions` directive body.
- Added ability to understand valid inserts, deletes and replacements for the `@functions` directive (and any other directive that uses our extensible code block bits).
- Added unit tests.
- Updated existing tests.
- Found an issue when completing some C# items the auto-completions would impact the underlying snapshot after we'd captured the change. Fixed this by forcing a reparse when we detect that our understanding of the latest snapshot and the actual latest snapshot diverge.

#2408
2018-06-18 17:11:40 -07:00
Ryan Brandenburg efaaec6546 Upgrade to netcoreapp22 2018-05-08 15:22:54 -07:00
Ajay Bhargav Baaskaran f8dc5c4702 Obsoleted IRazorEngineBuilder APIs 2018-04-13 12:35:53 -07:00
Ajay Bhargav Baaskaran 6270c1f47e Merge branch 'rel/vs15.7' into dev 2018-04-05 16:28:17 -07:00
Ryan Nowak 4cd24a2b08 Add experimental flag to un-special-case data-
This change allows blazor to opt into treating data- attributes the same
way as normal attributes in the parser.
2018-04-05 15:27:04 -07:00
Ryan Nowak d1c0ab587c Add support for type parameters to class nodes
This change will allow someone extending Razor to use generic type
parameters in generated classes.

There's no user-level extensibility provided here yet, as in there is no
language support for adding type parameters.
2018-04-05 15:26:42 -07:00
N. Taylor Mullen da255ff9db Make `TestProject.GetProjectDirectory` more thorough when finding project directory.
- Used our test path utilities to properly navigate to the project directory.
- Added some logic to make future debugging/test failures more diagnosable.

#2184
2018-03-26 12:36:46 -07:00
N. Taylor Mullen c874f84c3d Revert "Revert "Make Razor HTML Comments aware (#2178)""
This reverts commit 1f3f4b79da.
2018-03-20 15:23:53 -07:00
N. Taylor Mullen 1f3f4b79da Revert "Make Razor HTML Comments aware (#2178)"
This reverts commit b58986414e.
2018-03-20 11:54:09 -07:00
Artak b58986414e
Make Razor HTML Comments aware (#2178)
* Merging changes (from dev branch; doing manually to squash them really)of HTML Parser to be aware of HTML Comments so TagHelpers don't complain about comments as content.
2018-03-19 10:18:29 -07:00
Artak a9004e503e
Merge pull request #2061 from aspnet/artakm/RestrictChildrenComments
Ignoring HTML comments in tag helper's body. Updated the markup parser to be aware of HTML Comments.
2018-03-12 11:17:57 -07:00
Ryan Nowak 989a6c699f Don't add the tag helper provider by default
Since the default tag helper provider is used by MVC then MVC should
include it. Now that Blazor is in the mix we shouldn't include it for
all configurations.
2018-03-08 15:41:34 -08:00
Artak Mkrtchyan 6f515bb763
Fixed all the tests to reflect HtmlComment block type support 2018-03-08 13:37:03 -08:00
Artak Mkrtchyan e1fbea24f1
HtmlMarkupParser is now aware of HtmlComment blocks. Majority (if not all, will confirm soon) tests have been updated to account for HtmlComment blocks. 2018-03-08 13:37:03 -08:00
Artak Mkrtchyan ad8485addd
Added new BlockType - HtmlComment
Updated the HtmlMarkupParser to understand the HtmlCOmments, and treat those as blocks.
2018-03-08 13:37:03 -08:00
Nate McMaster 13824c418e Catch 15.7 up with dev
This change integrates most of the non-breaking work that we did in 2.1
including the updates to make Razor less coupled to MVC.
2018-02-19 10:46:16 -08:00
Ryan Nowak 56ead8118a Decouple Razor tools from MVC
Adds a loader (with shadow copying in server mode) based on the Roslyn
Analyzer loader design.

Adds some targets to the Razor SDK that we can use to compute the
configuration and extensions.

Passes all of the metadata through to the command line tools so they can
deal with extensions.
2018-02-15 13:31:31 -08:00
N. Taylor Mullen 133eff3119 Move to RazorProjectEngine.
- Instead of using Razor/Mvc TemplateEngine use `RazorProjectEngine`. This involved changing several locations (each of which used `RazorTemplateEngine` in an entirely different way) to use the RazorProjectEngine's two Process methods.
- Changed an unused public API `VisualStudioRazorParser.TemplateEngine` to `VisualStudioRazorParser.RazorProjectEngine`.
- Ported the remainder of `RazorEngineBuilder`'s extension methods over to `RazorProjectEngineBuilder`. These were used in tests and our `RazorGenerate` tool.
- Added a few test helper methods/classes to enable simple testing of the `RazorProjectEngine`.
- Resolved several test hacks that were working around little discrepancies each of the `RazorTemplateEngine` APIs.
- Changed the template engine factory service to be a project engine factory service.
2018-02-14 12:40:23 -08:00
N. Taylor Mullen 84bc74ea9f Move to RazorProjectFileSystem.
- Changed all existing APIs to utilize `RazorProjectFileSystem`. This was possible because `RazorProjectFileSystem` inherits from RazorProject.
- Renamed `FileSystemRazorProject` to `DefaultRazorProjectFileSystem`.
- Renamed FileSystemRazorProjectItem` to `DefaultRazorProjectItem`.
- Obsoleted `RazorProject.Create`

#1828
2018-02-09 11:49:31 -08:00
Pranav K 84beb5985f Add support for relative paths
* Move path munging in to Razor SDK
* Use AssignTargetPath to determine the target path for outputs and embedded resources

Fixes #1829
Fixes #1847
Fixes #1999
2018-02-05 14:19:52 -08:00
N. Taylor Mullen 771a7e35a4 Add MVC support for RazorProjectEngine.
- Make `RazorProjectEngine` call paths for all feature registrations.
- Add `DefaultMvcImportFeature` for latest and 1.X MVC.
- Ported `AddTargetExtension` and `AddDirective` to `RazorProjectEngineBuilderExtensions`.
- Added tests and a test file system project type.
- Moved obsolete `IRazorEngineBuilder` methods to the bottom of each file. Will actually obsolete the methods once `RazorProjectEngine` is working end-to-end.

#1828
2018-01-25 12:26:11 -08:00
Ryan Nowak 03dea86c4e Adding more tests and clarity around file paths
I noticed we were really undertesting all of the things that handle
paths and file names. I gave this some love and a little clean up where
we weren't doing the right thing in RazorSourceDocument.

Also changed the template engine tests to use the
FileSystemRazorProject. These tests are already using the files on disk
as inputs. I turned off checksums for these since they now have the full
file path, and that would not be portable.
2018-01-08 22:53:49 -08:00
Ryan Nowak 16324c3126 Add an Identifier by default
Using the MVC view engine convention for identifiers seems to make the
most sense, and we already use that convention for RazorProject so I
guess we're stuck with it.
2018-01-06 18:43:01 -08:00
Ryan Nowak d602f9d770 Add relative path to source document
Adding this via a properties object that encompasses all of the optional
properties. This way if we need to add more items that are optional we
can continue to do so without overload explosion.
2018-01-05 18:15:06 -08:00
Ryan Nowak 186e5733c0
Add metadata to Razor (#1894)
* Add metadata to Razor

This PR introduces standard metadata to Razor. This change begins to
formalize the contract between generated code produced by Razor and
runtimes that want to load and interact with this code.

This is a step on making MVC a 'plugin' to Razor rather than the only
possible implementation. Since we're doing MSBuild work - this is the
right time to designate the current interaction between Razor and MVC as
'legacy' and move forward.

Additionally, we need the source thumbprinting to make re-compilation of
Razor a thing.

-----

Also I noticed that our source document doesn't expose the hash
algorithm by name. We really should have this, so I added it and
hardened the code that deals with checksums in c# generation.
2018-01-02 13:30:50 -08:00