Commit Graph

776 Commits

Author SHA1 Message Date
Ryan Nowak 9ecd30cb2f Add Microsoft.CodeAnalysis.Razor
This project will have all of our roslyn-dependent infrastructure that we
need for designtime and runtime.
2017-01-20 15:26:39 -08:00
Ryan Nowak 4a49ee2164 Adds support for imports to IR lowering
This change adds support for 'imports' - extra source files which contain
directives that can merged with 'main' source files. The purpose of course
is to support things like global usings or addTagHelpers, like
_ViewImports in MVC does today.

Instead of a one-off this is now a feature of the Razor langugage since
things like addTagHelper have an impact on the parsing behavior. Also,
having a standard imports concept keeps out feature creep, for instance
the 'global' usings we have today could really just be an import.

Imports allow single-line directives including the fundamental directives
like addTagHelper, using, and other friends. Code, content, and block
directives are not merged and will be ignored. We can consider making
these kinds of things warnings in the future.
2017-01-20 10:43:53 -08:00
Nate McMaster 79663ef90e Upgrade to RC.3 2017-01-20 09:01:49 -08:00
Nate McMaster 8ba85cf18c
Pin sdk version using global.json 2017-01-19 17:11:22 -08:00
N. Taylor Mullen 6e647854fa Add support for `ViewComponentTagHelpers`.
- Hardcoded `ViewComponent` discovery.
- Hardcoded `ViewComponentTagHelperDescriptor` creation.
- Added test to validate that ViewComponents are discovered and transitioned into TagHelpers properly.
- Avoided adding a reference to MVC to prevent circular references. This resulted in custom marker attributes to represent `ViewComponent`s. Also made a lot of use of `ViewComponent` conventions (ending in "ViewComponent").

#932
2017-01-19 10:18:11 -08:00
Ryan Nowak a84f35022e Rename a test
Imports is something different, this is a test for usings.
2017-01-18 15:33:35 -08:00
Ryan Nowak be10bb5f7b Remove support for includes
I was mistaken, this isn't a feature we will need for _ViewStart.
2017-01-18 09:11:03 -08:00
BrennanConroy ea21469c11 Change Xunit versions 2017-01-17 16:42:34 -08:00
N. Taylor Mullen d218bc3173 Remove AssemblyName requirement from TagHelperDescriptorFactory method.
- The assembly name is accessible on the provided type. No need to pass one in.
2017-01-17 14:47:40 -08:00
Ryan Nowak d7527d2e0a Create new way of suppressing unique Id generation
Adds a way of suppressing generation of guid ids that isn't based on a
global static.
2017-01-17 11:06:41 -08:00
Pranav K 1b0379126b Downgrade the versions of new CodeAnalysis packages
Workaround for #935
2017-01-13 17:18:36 -08:00
Pranav K 9dbf80dde7 Modifications to allow building VSIX from build. 2017-01-13 11:55:46 -08:00
Ryan Nowak 242ea0ee3f Add parsing of includes and imports
Also adds the source document to the RazorSyntaxTree and does some cleanup
related to this. This lets us verify which tree goes to which document and
that seems important.

Added basic tests to verify that parsing happens, though it's not being
used for anything right now.
2017-01-13 11:25:20 -08:00
Yves57 5fa4672c99 Optimize C# symbol content string allocation 2017-01-13 10:59:55 -08:00
N. Taylor Mullen 8215d28ada Port TagHelperDescriptorFactory tests.
- Ported the existing descriptor factory tests and fixed issues with the current implementation.
- Ported documentation tests with the exception of the localization variants.
- Updated the DefaultTagHelperResolver to filter TagHelper types based on accessibility.
- Added DefaultTagHelperResolver tests.

#851
2017-01-13 10:35:10 -08:00
Ryan Nowak 208da8ca12 Add plumbing for imports and includes
Groundwork for support of _ViewImports _ViewStart and others.
2017-01-12 09:25:19 -08:00
Ajay Bhargav Baaskaran ffd455b77e Adds Instrumentation support
Instrumentation is added as an optional pass that can be configured by
MVC.
2017-01-11 17:27:52 -08:00
Nate McMaster 0324ac80dd React to aspnet/KoreBuild#155
This converts to using Internal.AspNetCore.Sdk instead of importing from the KoreBuild folder directly
2017-01-11 14:21:03 -08:00
N. Taylor Mullen ee59368467 Add Microsoft.CodeAnalysis.Razor.Workspaces.Test project.
#851
2017-01-10 12:12:36 -08:00
N. Taylor Mullen 7c6aea443f Downgrade Workspaces.Common to 1.3.0 to work with Microsoft.NETCore.App 1.2.
- This also enables us to target net451.

#927
2017-01-10 12:02:05 -08:00
Ryan Nowak e072a7f452 Fix build break
These baselines needed to updated after changing the namespace
of this type.
2017-01-10 11:53:39 -08:00
Ryan Nowak 59b24fb724 Make TagHelperDescriptor public for tooling 2017-01-10 09:06:05 -08:00
Ryan Nowak 6c7d121ce8 Fix bugs in TagHelper discovery 2017-01-09 18:13:33 -08:00
N. Taylor Mullen ead9692ab1 Disable Cross plat tests for design time code gen tests. 2017-01-09 15:25:38 -08:00
Ryan Nowak 1ac38fea6b Use the version of Roslyn packages available in VS 2017-01-09 13:30:23 -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
Nate McMaster 5abbf76067 Upgrade appveyor image 2017-01-09 10:38:56 -08:00
Nate McMaster 91bc4b3940 Remove redundant references 2017-01-05 18:12:53 -08:00
Ryan Nowak 1b30e037ca Revert bad change to .sln 2017-01-03 14:41:28 -08:00
Ryan Nowak e104451f79 Make SourceSpan public
Cleansup SourceSpan and makes it public where its used.
2017-01-03 12:46:56 -08:00
Ajay Bhargav Baaskaran eb0a2a1833 [Fixes #915] Added TagHelper preallocated attribute optimization pass 2017-01-03 11:05:57 -08:00
Yves57 e9a688be15 Optimize 'Span.Content' memory allocation 2017-01-03 10:13:15 -08:00
Ryan Nowak 6b075880ce Clean up SourceLocation
This change makes SourceLocation public and moves some of the undesirable
functions off of the class and into the .Legacy namespace.
2017-01-03 10:01:48 -08:00
Ryan Nowak e84bc66700 First cut of adding API sets
This change defines stages for IR processing. The comments in RazorIRPass
really explain the details. I've also made the preliminary changes to the
stuff we've built so far to follow the new conventions.

This is building towards multitargeting for Razor, being able to target
both Razor Pages and Razor MVC Views from the same engine, being able to
target different codegen and methods from within the same engine.
2016-12-30 17:58:39 -08:00
Ryan Nowak f45afb6c19 Add a test for using with trailing newline
I couldn't find a test like this, but I've been debugging an issue in this
scenario.
2016-12-30 16:06:18 -08:00
Ryan Nowak 0889067652 Remove the solution
This is making our build sad :(
2016-12-30 12:07:26 -08:00
Ryan Nowak 874a4cdf3a Add a .sln just for new projects 2016-12-30 10:44:41 -08:00
Ryan Nowak 0835de17ec Adds stronger verification for spans
This change ensures that spans are contiguous and that all source is part
of a span. This means that a character can't be 'lost' and not a member of
any span.

And guess what? We have a bug like that. So now a few tests are skipped
due to that bug.

Also made some changes to tests that construct invalid spans or spans
without correct locations as their expected input. This allows us to add
the above verification to all parser tests.
2016-12-28 21:56:35 -08:00
Ryan Nowak f191cc62a2 Get rid of locations on Tokens. 2016-12-28 18:22:06 -08:00
Yves57 bd4300d8cc Optimize HTML symbol content string allocation 2016-12-28 16:12:03 -08:00
N. Taylor Mullen e65c2ef1ef Upgrade to netcoreapp1.1 to fix test failure. 2016-12-28 15:55:16 -08:00
Ajay Bhargav Baaskaran 0dacf01f54 [Fixes #912] Added TagHelper design time code generation support 2016-12-28 15:22:07 -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 f47a40a4a7 Add Razor design time code generation.
- Added a common csharp rendering phase base to put shared assets of runtime and design time code gen.
- Added a new `DesignTimeIRPass` to setup the IR bits to provide accurate intellisense.
- Added a `CodeGenerationIntegrationTest` and moved the RuntimeCodeGenerationTests into it. This way we can re-use the cshtml files and it makes searching/running the tests easy..
- Updated how line mappings are calculated for some nodes.

#848
2016-12-27 11:06:58 -08:00
Ajay Bhargav Baaskaran af499794c5 [Fixes #878] Removed marker nodes from IR
- Also fixed SourceMappings content length in Markup spans
2016-12-22 15:11:52 -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
Pranav K 7657ea41a3 Updating to 4.4 CoreFx packages 2016-12-21 22:43:57 -08:00