Commit Graph

773 Commits

Author SHA1 Message Date
Ryan Nowak f3fecabe04 Bump Roslyn to a 2.6.0 build
Fixes #1654
2017-08-30 15:30:57 -07:00
Ajay Bhargav Baaskaran 5cb11b9bf4 Implmement a project system for Razor 2017-08-30 12:58:38 -07:00
Ajay Bhargav Baaskaran 4b68a48f1d Fix: Broken intellisense for extensible directives 2017-08-29 14:47:52 -07:00
Ajay Bhargav Baaskaran b12683a35d Mark trailing whitespace after type name in directives as markup 2017-08-29 12:48:44 -07:00
Ajay Bhargav Baaskaran f3d121cacf Mark whitespace between tag helper directive and its value as Markup 2017-08-28 21:42:37 -07:00
Ajay Bhargav Baaskaran 1b5bd4afac Added ParentIsTagHelper property to AttributeCompletionContext 2017-08-25 16:23:58 -07:00
Nate McMaster 471722eba1 Use PackageLineup to manage PackageReference versions
This uses a feature of KoreBuild which will select PackageReference
versions based on a lineup file. This helps unify versions between repos
and helps us ensure we are consistent across multiple components.
2017-08-25 15:44:05 -07:00
N. Taylor Mullen 347e4158fb Skipped flakey tests.
- Instead of utilizing ConditionalFact's we're silently skipping these tests to avoid the mass warnings you get otherwise.
2017-08-25 15:30:29 -07:00
Ryan Nowak a9a86fa3bf Add foreground dispatcher 2017-08-24 11:11:25 -07:00
Ryan Nowak d87e0f7fbd Fixes #1632 - track textviews in the document tracker
I've stripped out some of the dead code and complexity from the document
tracker in an attempt to simplify it. I will bring this back as part of
the multi-targeting work.
2017-08-24 10:47:33 -07:00
N. Taylor Mullen 8b4fc0cef6 Take control of VisualStudioRazorParser reparse test mechanics.
#1644
2017-08-24 10:42:12 -07:00
Ajay Bhargav Baaskaran fa6fde2b20 Moved TagHelper directive validation and parsing from TagHelperBinder to
CSharpCodeParser
2017-08-23 17:14:41 -07:00
Ajay Bhargav Baaskaran 9b6420dbfc Include currently selected attribute in TagHelper completion results 2017-08-23 17:08:59 -07:00
Nate McMaster 0c3fff3137 Upgrade to xunit 2.3.0-beta4 (#1640)
Includes a few changes required by xunit.analyzers, such as removing unused theory parameters.
2017-08-23 12:56:31 -07:00
Nate McMaster 4cadee2762 Use Directory.Build.props/targets (#1641) 2017-08-23 12:24:57 -07:00
N. Taylor Mullen 24154ec4c2 Create a VisualStudio parser to handle the editing loop.
- Renamed `RazorEditorParser` => `VisualStudioRazorParser` (maintained a copy of the original in Legacy)
- Tried to make as little changes as possible to the `BackgroundParser` due to its complexity; mostly just removed the TreeStructureChanged logic since this is re-done on the Razor editor side of things.
- Split the `RazorEditorParserTest`s into two separate tests. Partial parser tests and the VS parsing tests.
- Updated `StringTextSnapshot` to support changes in order to test the VS parser.

#1536
2017-08-23 11:38:11 -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 d726be6dd1 Removed duplicate extension methods 2017-08-17 16:40:13 -07:00
Ajay Bhargav Baaskaran 45732a5dd3 Fix: Nested tag helpers do not work when tag helper prefix is set 2017-08-17 15:26:10 -07:00
N. Taylor Mullen db805eb3e3 Fix ModelExpression's in section directive blocks.
- Changed `SectionDirectivePass` to move non-token body nodes from the original `DirectiveIntermediateNode` to the `SectionIntermediateNode`. By doing this there's no longer dual references of `SectionIntermediateNode` bodies.
- Added MVC tests for current and 1_X extensions.

#1614
2017-08-16 10:25:53 -07:00
Ajay Bhargav Baaskaran 8d2a9e5929 Support tuples for type directive tokens 2017-08-14 12:43:41 -07:00
Ajay Bhargav Baaskaran 655a693e4a Make ViewComponentTagHelper use extension intermediate nodes 2017-08-11 12:01:21 -07:00
Ajay Bhargav Baaskaran 364fc1a55d Allow nullable types with generic arguments in directives 2017-08-10 11:47:43 -07:00
Ajay Bhargav Baaskaran 4fe07f2298 Added unit tests for DefaultTemplateEngineFactoryService 2017-08-09 12:31:51 -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 127784e058 Fix clean machine/testing for Mvc.Extensions. 2017-08-03 10:40:16 -07:00
N. Taylor Mullen aa980fc67c Roslyn-ize our tooling contracts.
- Added `ILanguageServiceFactory` types for all serviceable contracts.
- Maintained binary compatibility by copy/pasting existing services into a Legacy folder.
- Added a Workspaces.Test project since their implementations moved.
- Updated binary incompatible version of `RazorSyntaxFactsService` to not depend on VisualStudio. Added an extension type to the VS.LanguageServices.Razor project to enable easy-access from VisualStudio.

Below on refers to the binary incompatible copies.
Core services that were **entirely** moved from VisualStudio.Razor => Razor.Workspaces are as follows:
- `RazorSyntaxFactsService`, this included mutating the API to not depend on VisualStudio and moving some primitive types such as `AcceptedCharacters`.
- `TagHelperCompletionService`
- `TagHelperFactsService`
These all have a `ServiceLayer` of `Editor`.

Bits that were partially moved:
- `RazorTemplateEngineFactoryService`. The Default implementation and its corresponding factory still live in VisualStudio.Razor. This way Razor.Workspaces can get by without a reference to Mvc.Razor.Extensions.
- `ITagHelperResolver` used to exist in VisualStudio.Razor. Removed the type and replaced its usage with the already-existing `TagHelperResolver` type in Razor.Workspaces. Both contracts were nearly identical.
These all have a `ServiceLayer` of `Default`.

#1260
2017-08-02 16:58:44 -07:00
Ajay Bhargav Baaskaran 31e9710186 Added unit test for DefaultTagHelperOptimizationPass 2017-07-31 17:12:20 -07:00
Ajay Bhargav Baaskaran ee64ee7e1a Removed warning in ViewImports integration test 2017-07-28 16:59:35 -07:00
Mike Harder 35c8da94bf Temporarily disable package downgrade warnings (#1576)
- Revert when RoslynDevVersion >= RoslynVersion
2017-07-20 13:13:04 -07:00
N. Taylor Mullen 184ab74e68 Don't render view attributes when in design time.
- This is a temporary work around that's needed until we have multi-targeting support in https://github.com/aspnet/Razor/issues/1535.
2017-07-19 09:56:51 -07:00
N. Taylor Mullen 006b4651da Change product code to work with editor expectations.
- Descriptor providers should not be pushing `null` descriptors into the overall list of `TagHelperDescriptor`s; this causes null refs on the editor side of things at design time.
- Expose `FilePath` on `RazorEditorParser` for the editor. The editor currenlty uses the `RazorEditorParser` as a place to hold some state about the Razor document.
2017-07-19 09:56:51 -07:00
Ryan Nowak 8bbfecb0da Merge branch 'rel/2.0.0' into dev 2017-07-17 13:17:03 -07:00
Ryan Nowak 59d3fb433b Fix #1555
Revert validation that file-scoped directives appear before HTML or
code.
2017-07-17 11:24:58 -07:00
N. Taylor Mullen 2a69b50a64 Change Razor.Test.Common to not act like an executable.
- There's no need for this test library to have a conditional TFM because it's never run under the desktop TFM when crossplat.
2017-07-13 14:58:27 -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
Ajay Bhargav Baaskaran b70815e317 Made `RazorCodeGenerationOptionsBuilder.DesignTime` getter only
- Made RazorCodeGenerationOptions consistent with RazorParserOptions
2017-07-07 14:41:53 -07:00
Ryan Nowak 9c0a8a5c96 Rename properties on taghelper nodes 2017-07-07 11:32:05 -07:00
Ryan Nowak ff40124594 Convert most of CodeWriter into extensions
We don't really want to ship what we have as a contract. As an emergency
measure we are making it into internal extension methods so we can have
a do-over in 2.1.
2017-07-07 10:55:33 -07:00
Ajay Bhargav Baaskaran 267b3fab0a Made IntermediateNodeWalker.Ancestors indexable 2017-07-06 19:24:25 -07:00
Ajay Bhargav Baaskaran 49eab41726 Made CodeTargetBuilder an abstract class 2017-07-06 19:01:28 -07:00
Ajay Bhargav Baaskaran d6e892b30c Adjusted verbosity of some property names and made
TagHelperIntermediateNode.TagHelpers and IList
2017-07-06 18:05:36 -07:00
N. Taylor Mullen 45fad171a6 Reduce public surface area of some APIs.
- Change `DefaultRazorEngineBuilder.DesignTime` to be getter only
- Make `DocumentClassifierPassBase.TargetExtensions` private.

#1510
2017-07-06 16:50:11 -07:00
N. Taylor Mullen c34a99e188 Update the TagHelperBinding API to use IReadOnlyList.
- Changed `Attributes` to return `IReadOnlyList<KeyValuePair<string, string>>`.
- Changed `GetBoundRules` to return `IReadOnlyList<TagMatchingRuleDescriptor>`.
- Updated tests to react to new signature.

#1510
2017-07-06 15:42:24 -07:00
N. Taylor Mullen cb40da4e0f Rename ParseOnlyLeadingDirectives.
- Was renamed to `ParseLeadingDirectives`.

#1510
2017-07-06 14:34:15 -07:00
N. Taylor Mullen b68290ddb7 Make `RazorParserOptions` creation more like RazorEngine
- Removed verbose `Create` methods in favor of the `RazorParserOptionsBuilder`. This is similar to how the `RazorEngine` functions.
- Added a `CreateDesignTime` method.
- Updated existing tests to use new Create syntax.

#1510
2017-07-06 14:33:33 -07:00
N. Taylor Mullen 87a5435036 Make `RazorParserOptions.DesignTime` getter only.
- Renamed `IRazorParserOptionsFeature` to `IConfigureRazorParserOptionsFeature`, the original interface was re-purposed to get the options rather than configure them.
- This involved re-designing how we set design time on the `RazorParserOptions` object. The indicator of `DesignTime` is now configured at the RazorEngine level via a parser options provider feature.
- Moved options construction from the phase into an `IRazorParserOptionsFeature` type.

#1510
2017-07-06 14:33:05 -07:00
Ajay Bhargav Baaskaran 11c5293862 Unnest IntermediateToken.TokenKind 2017-07-06 11:15:36 -07:00
N. Taylor Mullen afa61e7080 Rename LineMapping => SourceMapping.
- Also removed the == and `!=` operators for `SourceMapping`.

#1510
2017-07-06 10:34:19 -07:00