Commit Graph

862 Commits

Author SHA1 Message Date
Ryan Nowak 9a27405718 Add LanguageServices test project 2017-03-06 17:55:00 -08:00
Yves57 dee8d8694f Prevent LOH allocations when constructing large Razor Source Documents. (#1049)
* Prevent LOH allocations when constructing large Razor Source Documents.

* Feedback
2017-03-06 16:50:05 -08:00
Ryan Nowak 3159266169 Whitespace cleanup 2017-03-06 16:29:59 -08:00
Ryan Nowak cefca39510 Fix broken padding in design time
The padding calculation for C# expression wasn't taking into account the
` = ` so all of the padding values for expressions were off by 3.
2017-03-06 15:54:47 -08:00
Ryan Nowak 966cd4a68d Introducing BasicWriter and TagHelperWriter
These are the replacements for CSharpRenderingConventions
2017-03-06 13:12:57 -08:00
Ryan Nowak 7730d33482 Introducing DocumentWriter 2017-03-03 15:00:09 -08:00
Nate McMaster 29d2defd11 Update AppVeyor and Travis settings 2017-03-01 18:25:45 -08:00
Nate McMaster f1f37b931c Change korebuild branch and fix argument forwarding in bootstrapper 2017-03-01 18:14:13 -08:00
Ajay Bhargav Baaskaran d422e61c3e Make CSharpRenderingContext and friends public 2017-02-28 19:04:51 -08:00
Pranav K 27e66c3750 Add tests for RazorPageGenerator 2017-02-28 14:15:52 -08:00
Pranav K 12a502d775 Move FileSystemRazorProject into Razor.Evolution
Add tests
2017-02-28 14:15:52 -08:00
Pranav K c83741f11c Remove references to Razor from RazorPageGenerator 2017-02-28 14:15:52 -08:00
Pranav K 3772c7c343 Downgrade versions of new packages to 1.0.0 2017-02-27 15:45:17 -08:00
Pranav K 9da7a957f4 Remove facade assemblies from VSIX output
Fixes #940
2017-02-27 08:59:31 -08:00
Pranav K 76fa731a6d Add .editorconfig 2017-02-24 09:54:56 -08:00
Ryan Nowak 913d9ef465 Quick fix for attribute documentation 2017-02-23 16:03:54 -08:00
Ryan Nowak 04395b8bfa Update VSIX version 2017-02-23 15:53:10 -08:00
Ryan Nowak 550283957a Tolerate null returns from OOP methods
See #1023
2017-02-23 15:51:26 -08:00
Ryan Nowak f177648c88 Add activity log for TagHelper exceptions
This will log to the VS activity log any time we fail to discovery
taghelpers due to an exception. There's no real user experience around
this... if someone is having an issue we can ask them to send us the log
or post the relevant portion.
2017-02-23 15:43:17 -08:00
Ryan Nowak f0d5461e31 Improve branding for our extension 2017-02-23 13:12:58 -08:00
Ryan Nowak 615d8e71d6 ifdef all the Razor Info window code
We don't want to ship this in VS yet :) Now the Razor Info window will
only be available in debug builds.
2017-02-23 11:03:25 -08:00
Ryan Nowak 94d21e03f5 Fixing support for XML docs in OOP
The issue here is that the OOP host doesn't yet have support for
documentation, it will just return null. Fixing this code to look for the
documentation after we get the descriptors back into VS.

I tested this and confirmed that it works with TagHelpers in dlls + xml
file documenation as well as TagHelpers compiled in the project itself.
2017-02-23 09:13:12 -08:00
Nate McMaster 539903c7cf Replace makefile.shade with a PowerShell script
cref aspnet/Korebuild#174
2017-02-22 16:15:39 -08:00
Pranav K a6d611aecd Introduce RazorCompilation 2017-02-22 10:22:18 -08:00
Ajay Bhargav Baaskaran cb5b8a45f1 [Fixes #959] Generate LineMapping for Using statements with source
- Also generate/test IR baselines with all code generation tests
2017-02-21 16:51:05 -08:00
Ryan Nowak c76ae277a3 Add baselines for codegen tests
This will make is much easier to investigate failures that bubble up to
the codegen level. You'll be able to see if there was a change to the IR
rather than just the final code.
2017-02-17 16:41:46 -08:00
Ryan Nowak 1ae0b21630 Replace CSharpIRToken with RazorIRToken
Deletes CSharpIRToken to use the more general RazorIRToken class.

Rather than using the visitor to visit tokens, now writing a
CSharpExpresionIRNode is an 'atom', and will write its tokens itself.
2017-02-17 16:27:31 -08:00
N. Taylor Mullen 2e4b1f4d18 Fix compilation error. 2017-02-17 16:12:40 -08:00
Ajay Bhargav Baaskaran ed9068cef4 Replace RazorError with RazorDiagnostics in public API 2017-02-17 15:44:37 -08:00
N. Taylor Mullen 7a2f89b5de Add assembly name filtering to GetTagHelpers calls.
- Updated the Razor extension to properly discover all assembly names available to a project and use those as a TagHelper filter.

#1022
2017-02-17 14:54:06 -08:00
Ryan Nowak 965ae5490f Introducing RazorIRToken
This IR node will be part of the new token model for IR. It will be used
by all nodes that contain user content. Going forward, tokens will be the
thing that contains text and produces line mappings.

This commit just introduces the class.
2017-02-17 11:22:53 -08:00
N. Taylor Mullen de6bfa480f Only show C# projects in Razor info window. 2017-02-17 11:18:28 -08:00
Ryan Nowak 290c11ef3a Set ToolsVersion=15.0 2017-02-17 11:13:07 -08:00
N. Taylor Mullen 8c17375be0 Surface TagHelper resolution errors.
- Decided to not expose the resolutions errors in the Razor extension. If we feel that it's good debug information we can add it later.
- Added a `TagHelperResolutionResult` type to Razor.Workspaces so it can be used in the language and remote service.

#1014
2017-02-17 10:51:44 -08:00
Ryan Nowak bbeb485405 Refactor ParserVisitor
We need the visitor to allow control over whether to recurse or not into
something. This change makes the old ParserVisitor class behave much more
like the newer IR Walkers.

We need this for the tokens refactor because IR lowering will not be just
a trivial visitor anymore in the future.
2017-02-16 15:36:01 -08:00
Pranav K 075771a12d Re-enable netcoreapp1.1 tests (part 2) 2017-02-16 15:29:31 -08:00
N. Taylor Mullen f3a0ee5bdb Add `RazorLanguageServiceException` to capture unexpected exceptions.
- Consumers will then be able to catch the `RazorLanguageServiceException`s directly and log them as needed.
2017-02-16 14:50:35 -08:00
Pranav K cfa4689d47 Re-enable netcoreapp1.1 tests
Fixes #1003
2017-02-16 14:09:12 -08:00
Pranav K f56d1b9441 Updating VS version 2017-02-16 14:09:12 -08:00
Nate McMaster 76b998a8dc
Skip .NET Framework-only tests on xplat 2017-02-16 11:16:52 -08:00
Ryan Nowak e35ee53ee5 DefaultRazorIRLoweringPhase is too agressive
This change fixes a bug where DefaultRazorIRLoweringPhase is too
aggressive in merging HTML spans. You can hit the bug by delimiting two
html spans with a metacode character like:

<foo>@{ <bar/> }</foo>

The lowering phase will combine these HTML nodes, which is invalid as they
don't have contiguous spans.

The change here is to merge spans only when they both have an invalid
location or are contiguous.
2017-02-16 10:53:09 -08:00
Ryan Nowak 7a1a6dd1d6 Part 2 of RuntimeTarget
Introducing ExtensionIRNode and an implementation of templates based on
the new feature set.

Now TemplateIRNode is-a ExtensionIRNode. It's implemented using just
extensibility and isn't part of the standard razor codegen. I'm adding it
to the RazorEngine so that it's still there by default.

I've also included a pattern for visitors to special case
ExtensionIRNode-derived classes that they know about. This requires a
little bit of boilerplate but makes it easy to traverse just the nodes you
care about while keeping the set of nodes open.

For now the general codegen feature still hasn't had a refactor, but this
opens things up for us to start finishing things like MVC's @inject
directive.
2017-02-15 18:08:19 -08:00
Ajay Bhargav Baaskaran 4b2245eeb9 [Fixes #924] Correct RightShiftAssign operator 2017-02-15 16:31:40 -08:00
Nate McMaster 4fd441ae35 Temporarily disable tests on .NET Core that rely on .NET Core 2.0 API 2017-02-15 10:04:59 -08:00
Nate McMaster 279855d947
Downgrade to stable packages 2017-02-14 16:15:35 -08:00
Ajay Bhargav Baaskaran 8ac5468714 Refactor IR phases
- Added DirectiveRemovalIRPass
 - Added IRazorDocumentClassifierPhase, IRazorDirectiveClassifierPhase and
   IRazorIROptimizationPhase
 - Added all the related passes and default implementations
 - Refactored DefaultDirectiveIRPass to do the right thing
 - Execute method in IR passes now return void
 - Added tests for the new phases
2017-02-14 14:51:36 -08:00
Pranav K 80172c641d Fix building the vsix inside VS 2017-02-14 12:55:43 -08:00
Doug Bunting 4861ef3391 Bump test projects up to .NET 4.5.2
- aspnet/Testing#248
- xUnit no longer supports .NET 4.5.1
- build tests for desktop .NET only on Windows
2017-02-14 08:48:29 -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
N. Taylor Mullen f861c23d1f Allow RazorSourceDocument to consume empty streams.
- Added tests to validate how encoding flows when used with empty streams in addition to their usability (not throwing).

#947
2017-02-13 12:11:38 -08:00