Commit Graph

252 Commits

Author SHA1 Message Date
Ryan Nowak dbf5b80f97 PR feedback
\n\nCommit migrated from bfc2485b67
2019-07-01 15:29:08 -07:00
Ryan Nowak e9ac371854 General cleanup of bind code
Removed support for more obsolete cases and cleaned up some out-of-date
comments.
\n\nCommit migrated from 19c6a6fa4b
2019-07-01 15:29:08 -07:00
Ryan Nowak 8d6e13082d Remove handling of pre-directive-attribute cases
\n\nCommit migrated from 2e34a6ace6
2019-07-01 15:29:08 -07:00
Ryan Nowak e1f53b4bd6 Add code generation support for culture
Adds the code generation support for culture + bind.

Some additonal changes are needed for the compiler support for bind, we
need to pass the culture into the code that unwraps the value as well.

There's no need to eagerly push these changes into the runtime (can wait
for the compiler change to go in) because nothing in our runtime tests
use the new feature.
\n\nCommit migrated from 6aad9748e8
2019-07-01 15:29:08 -07:00
Ryan Nowak 04d7e63b79 Add culture parameter to element-bind tag helpers
\n\nCommit migrated from 7515e2ce49
2019-07-01 15:29:08 -07:00
Ryan Nowak 66cb243807 Add codegen for default format
\n\nCommit migrated from e5be8d4673
2019-07-01 15:29:08 -07:00
Ryan Nowak 3c84c57c61 Add the ability to specify invariant and format
Adds the ability to specify that an `<input type="..." />` for some
specific value of `type` maps to the invariant culture and/or provides
a default format.

The primary examples of usage would be the number field which wants to
use invariant culture, or datetime which wants to use invariant culture
and a format string.
\n\nCommit migrated from 60f2d563a6
2019-07-01 15:29:08 -07:00
Ryan Nowak 2c6e1dacac Use ref-assembly code in shim
Updates our Components shim to use the ref assembly code. This is just
cleanup and will help us keep up-to-date with API review changes since
we can just copy-past the files.

I made two modifications to make this simple.
- Removed our built-in components
- Removed the HTTP stuff

This makes it easier for us to maintain the shim. You can see cases
where I had to update tests because they diverged from what the real
APIs look like (no product bugs).

I'd still like to improve this workflow so suggestions wanted xD
\n\nCommit migrated from 8517be2bac
2019-07-01 14:22:26 -07:00
Ryan Nowak 895ad896c7 Fix: dotnet/aspnetcore-tooling#11197 automatic backing-field for @ref (dotnet/aspnetcore-tooling#707)
This change makes @ref define a field for you by default. We didn't do
this originally because we weren't sure if the compiler generating a
field would always be what you want, and more importantly,
we didn't have the expressiveness to add an opt-out.

Now that we have directive attributes, it's easy to create an opt-out
for the field generation. The special thing about it is that where
you opt-out has to be static. For this reason the @bind:suppressField
attribute cannot be used with a value, you either have the flag or not.

Additionally, we don't support automatic field generation for
generics, because usually we can't write the field name. If we
want to in the future could make this work when the generic
type arguments are specified. So in the case of generics,
you have to opt-out, and you will get a diagnostic
that tells you so.\n\nCommit migrated from dadf9faf22
2019-07-01 13:58:25 -07:00
Ajay Bhargav Baaskaran 0659180119 Do case insensitive comparison in DefaultRazorProjectFileSystem.GetItem (dotnet/aspnetcore-tooling#709)
\n\nCommit migrated from ff305c700f
2019-06-28 11:02:55 -07:00
Pranav K 4e16cfd4da Use LogErrorFromException when FindAssembliesWithReferencesTo throws (dotnet/aspnetcore-tooling#702)
Currently FindAssembliesWithReferencesTo produces a stacktrace when P2P builds fail - for instance
if the referenced project has a compiler error. This changes it to use LogErrorFromException.

In addition, there was a typo in the property that disabled the feature.

Fixes https://github.com/aspnet/AspNetCore/issues/11226\n\nCommit migrated from 87c12a116c
2019-06-26 11:18:54 -07:00
Javier Calvarro Nelson 19d9dbcd43 Removes the logic for sanitizing the base path for static web assets (dotnet/aspnetcore-tooling#700)
Removes the logic for sanitizing the base path for static web assets\n\nCommit migrated from 98b168c894
2019-06-25 18:35:38 +02:00
Doug Bunting adfe6f09e4 Move to 3.0 Preview 6 SDK and 2.1.11 runtime (dotnet/aspnetcore-tooling#695)
- add feeds that SDK no longer provides automatically when building test apps
- add another allowed build warning in some integration tests\n\nCommit migrated from cfd4698381
2019-06-24 10:51:23 -07:00
Ryan Nowak ef4773a2d5 Add attribute splatting compiler support (dotnet/aspnetcore-tooling#640)
* Add TagHelperDescriptorProvider

* Remove bad life-choice

* Add some AddRange love

* Add splatting lowering and codegen

* PR feedback
\n\nCommit migrated from 9c8dd1cae7
2019-06-21 14:48:09 -07:00
Ajay Bhargav Baaskaran fa65b30dce Don't require preceding @ for event handler directive attributes (dotnet/aspnetcore-tooling#658)
* Don't require preceding @ for event handler directive attributes

* updated event handler th attribute type
\n\nCommit migrated from 6dce1532be
2019-06-20 17:05:59 -07:00
Ajay Bhargav Baaskaran ab867ec5e2 Allow @bind:event override when used with @bind (dotnet/aspnetcore-tooling#687)
* Allow @bind:event override when used with @bind

* Added more tests to cover standalone @bind-value=... case

* fix
\n\nCommit migrated from a399bd072e
2019-06-20 16:01:29 -07:00
Pranav K 7a510b311d Fixup incremental builds with ApplicationPartsDiscovery (dotnet/aspnetcore-tooling#693)
\n\nCommit migrated from df3c4d533a
2019-06-20 13:53:35 -07:00
Steve Sanderson 64f56b7607 For bind on element, also write the updated attribute name to the render tree builder (dotnet/aspnetcore-tooling#689)
\n\nCommit migrated from 6e5490049d
2019-06-20 09:54:06 +02:00
Pranav K 060ff0d878 Ensure ApplicationPart attributes are added during incremental builds (dotnet/aspnetcore-tooling#686)
Fixes https://github.com/aspnet/AspNetCore/issues/11315\n\nCommit migrated from 1a7a74bce8
2019-06-19 11:43:07 -07:00
N. Taylor Mullen c16d55c63f Allow `content`, `output` and `context` as keywords to VC params.
- It looks that when we first did VCTH we never put in the effort to reduce our footprint on available parameters for `ViewComponentTagHelper`s. I went ahead and added several underscores to the generated fields/parameters to reduce collisions.
- Updated tests to reflect the new codegen.

aspnet/AspNetCoredotnet/aspnetcore-tooling#8645
\n\nCommit migrated from b545a4de75
2019-06-19 11:19:16 -07:00
N. Taylor Mullen 261b256cf8 Fix error spacing.
\n\nCommit migrated from 1fdb3f3fdb
2019-06-06 13:22:33 -07:00
Ajay Bhargav Baaskaran 30668fb196 Ignore extensible directive nodes coming from Imports when generating padding (dotnet/aspnetcore-tooling#655) (dotnet/aspnetcore-tooling#661)
\n\nCommit migrated from 6d1dea7141
2019-06-06 11:19:50 -07:00
Javier Calvarro Nelson 2c01615cad [Flaky tests] Restore package projects at build time
\n\nCommit migrated from 8ee0e6d5b4
2019-06-05 15:47:52 -07:00
Javier Calvarro Nelson 22f593b796 [Static Web Assets] Removes support for embedding the development manifest
* Stops embedding the manifest in favor of using a file copied to the output folder.
\n\nCommit migrated from 4c65b1947f
2019-06-05 13:40:11 -07:00
N. Taylor Mullen 48eeaefc1e Add Razor component TagHelper detection.
- WTE needs a way to detect if a `TagHelperDescriptor` is a component based `TagHelper` in order to turn features like validation, completion etc. on/off.
- Updated tests to add verification points for the new `IsRazorComponentTagHelper` method.
\n\nCommit migrated from 6fcd12e60b
2019-06-03 16:29:45 -07:00
Ajay Bhargav Baaskaran c588d53a42 Use an explicit intermediate node for directive attributes (dotnet/aspnetcore-tooling#638)
* Use an explicit intermediate node for directive attributes

* More cleanup
\n\nCommit migrated from f8d7f4cc3b
2019-06-03 13:54:28 -07:00
Pranav K 9d8e9fb3a7 Allow file watching with dotnet-watch
\n\nCommit migrated from 42d3a88fed
2019-06-01 08:10:10 -07:00
Pranav K 5c59b78415 Allow UpToDateReloadFileTypes to be modified by packages
\n\nCommit migrated from 81c2e03bc3
2019-05-31 15:16:09 -07:00
Javier Calvarro Nelson 1c27d78420 Adds support for packing and publishing static web assets
* Adds support for publishing static web assets
* At publish time, it copies all the referenced assets from referenced
  projects and packages into their final locations.
* Automatically pack static web assets for consumption
* Generate Microsoft.AspNetCore.StaticWebAssets.props and pack it into
  build\Microsoft.AspNetCore.StaticWebAssets.props
* Generate `<<PackageId>>.props` and pack it into `build\<<PackageId>>.props`
  importing Microsoft.AspNetCore.StaticWebAssets.props
* Generate `<<PackageId>>.props` and pack it into buildMultiTargeting\`<<PackageId>>.props`
  importing `build\<<PackageId>>.props`
* Generate `<<PackageId>>.props` and pack it into buildTransitive\`<<PackageId>>.props`
  importing buildMultiTargeting\`<<PackageId>>.props`
* Pack all the static web assets from the current project into `staticwebassets\**`\n\nCommit migrated from 87817bed3e
2019-05-30 21:51:44 +02:00
Ryan Nowak 33e8098b4f Remove obsolete project file
\n\nCommit migrated from a7d1373707
2019-05-29 20:06:31 -07:00
Nate McMaster b45c32fa5b Add support for source-build (dotnet/aspnetcore-tooling#620)
\n\nCommit migrated from 986c224acf
2019-05-29 13:06:38 -07:00
Ajay Bhargav Baaskaran f25734acf4 Support parsing directive attributes - Part 2/2 (dotnet/aspnetcore-tooling#619)
* Support parsing directive attributes
\n\nCommit migrated from 5eb8ef43eb
2019-05-26 12:43:13 -07:00
Javier Calvarro Nelson 68f5fec0b0 Suports discovery of static web assets from referenced projects (dotnet/aspnetcore-tooling#605)
* Define static web assets in the current project
  * These are assets under the wwwroot folder.
  * By convention, the base path for these assets is `_content/<<PackageId>>`
    with spaces and dots removed and all characters lower-cased.
* Retrieve static web assets from referenced projects\n\nCommit migrated from 50646aae64
2019-05-24 10:42:38 +02:00
Pranav K 66dd6b35d3 Specify UpToDateReloadFileTypes (dotnet/aspnetcore-tooling#611)
* Specify UpToDateReloadFileTypes

Specify a list of file extensions that VS will monitor for file changes to reload the app.
Includes .razor and .cshtml files.

\n\nCommit migrated from 9a964127bf
2019-05-22 16:43:02 -07:00
Ajay Bhargav Baaskaran db66452bbd Fix bug in bind lowering logic
\n\nCommit migrated from 5bcd008779
2019-05-22 14:06:32 -07:00
Ryan Nowak 95bb698c5a Make duplicate attribute names an error (dotnet/aspnetcore-tooling#604)
This came up in the context of discussion around aspnet/AspNetCoredotnet/aspnetcore-tooling#5071.

Browsers use a 'first attribute wins' rule for evaluating attributes and
building the DOM - though duplicate attributes are considered to be a
spec violation.

Blazor wants to use 'last attribute wins' rules because that's most
sensible when you consider evaluation order and splatting.

This means that we have to have the markup block pass do the same thing
as the Blazor runtime when duplicates appear. However, since this is a
spec violation I'm proposing that we just make it an error (like we do
for malformed tags). There's no useful purpose for duplicate attributes
since browsers ignore it.

Since we're not going to allow this for elements. Let's go all of the
way and block it for components as well. And while we're here, lets
block some of the invalid cases where users try to mix onchange and
bind. These don't work today, so we should make them an error. If we
decide to add support for this case to the runtime that would require
compiler work anyway.
\n\nCommit migrated from 0c59ca5f74
2019-05-21 16:37:08 -07:00
Ajay Bhargav Baaskaran 72d017cc1b Added support for @attribute directive (dotnet/aspnetcore-tooling#607)
\n\nCommit migrated from 67b8a838da
2019-05-21 15:42:56 -07:00
Ajay Bhargav Baaskaran 5bad5de7ee Directive attributes part 1: Support parameters in bound attributes (dotnet/aspnetcore-tooling#597)
* Directive attributes part 1: Support parameters in bound attributes

* update

* Fix test

* feedback

* Updated design

* Do case sensitive comparison

* more

* Bug fix
\n\nCommit migrated from 9bbf240948
2019-05-21 13:07:23 -07:00
Javier Calvarro Nelson 13397dd4d6 Initial support for static assets in Razor Class Libraries (dotnet/aspnetcore-tooling#580)
* Imports static assets from packages containing custom msbuild
  targets defining a StaticWebAsset item group.
* Generates an embeds a manifest into the application assembly
  that contains a list of paths to the content roots of the
  assets defined in the packages custom msbuild targets.\n\nCommit migrated from 8e70013b70
2019-05-21 15:03:00 +02:00
Javier Calvarro Nelson 111e26dd03 Conditionally enable content items in the razor SDK (dotnet/aspnetcore-tooling#589)
* Move the globs from the project system into the Razor SDK on a separate file that can be imported by itself.
* Import the file conditionally based on the EnableRazorContent property\n\nCommit migrated from 62e33dac1d
2019-05-20 21:06:38 +02:00
Alex Lorimer 98a2a4348b fixed destructive property assignment (reference self correctly using `$(GetCopyToOutputDirectoryItemsDependsOn)` instead of `$(GetCopyToOutputDirectoryItems)`) (dotnet/aspnetcore-tooling#603)
The intention here would have been to add to the existing GetCopyToOutputDirectoryItemsDependsOn property, defined in Microsoft.Common.Targets. Instead what was happening is that it was being completely overwitten with the _RazorGetCopyToOutputDirectoryItems entry, given that $(GetCopyToOutputDirectoryItems) doesn't exist as a property and must have been a typo (it exists as a task, not a property).

An effect of this bug was that the `AssignTargetPaths` target is not always executed before the `GetCopyToOutputDirectoryItems` target, which should explicitly depend on it. `AssignTargetPaths` is responsible for populating the `ContentWithTargetPath` itemgroup. Left empty, it appears to `GetCopyToOutputDirectoryItems` task that there are no Content files to copy to the final output directory, when in fact there are.\n\nCommit migrated from 4597bc3d55
2019-05-20 06:39:51 -07:00
Pranav K b5a7daba2b Do build time discovery of MVC ApplicationParts (dotnet/aspnetcore-tooling#598)
* Do build time discovery of MVC ApplicationParts
\n\nCommit migrated from e79d5600f7
2019-05-17 13:14:41 -07:00
N. Taylor Mullen 96475e488d Render more TagHelper code at design time.
- This is a pre-requisite to properly warnings users about TagHelpers in code blocks. With this change VS indicates that there's an asynchronous operation happening in a code block but because the code is auto-generated it happens behind the scenes and therefore always gets logged as a line 1 error (unusable). Therefore, to fix this issue there will be a partner PR that will go out in AspNetCore that adds analyzer errors for cases where `__tagHelperRunner.RunAsync` exists in code blocks that do not return `Task` and are not marked with `async` properly.
- Updated test files to reflect the new TagHelper codegen at design time.
- Note: This doesn't solve the `~/` case that will be in a follow up PR.

aspnet/AspNetCoredotnet/aspnetcore-tooling#8630
\n\nCommit migrated from 17af3efccd
2019-05-17 12:59:32 -07:00
N. Taylor Mullen ffd11eaa05 Add support for single line control flow statements in code blocks.
- This adds support for C# single line variations of: `if`, `for`, `foreach`, `do`, `while`, `lock` and `using`.
- Turns out the existing parser had 99% of the support for these scenarios already. Therefore, in this change set I went ahead and added exhaustive tests to verify things worked end-to-end.
- Added a restriction to single line markup to not allow markup in single line control flow statements. Updated resx to provide a better error message for cases when users do use markup in single line control flow statements.

dotnet/aspnetcore-tooling#9637
\n\nCommit migrated from cf474c97aa
2019-05-08 14:20:08 -07:00
N. Taylor Mullen b9fde956ea Fix RazorDiagnostics from being hidden and unordered.
- Diagnostics were not being raised to the `RazorSyntaxTree` and weren't being ordered on final output. This resulted in some of our tests missing the fact that certain cases were generating errors.
- Made all three phases of Razor parsing order their diagnostics.
- Added `GetAllDiagnostics` methods to `SyntaxNode`s to be more consistent with IR documents.
- Updated test files. In some cases new errors were found because we're now lifting them to the `SyntaxTree`, in most others the errors are re-ordered.

**Note: In end-to-end scenarios diagnostics were not hidden, only unordered. The IR phase would find nested/hidden documents and lift them to the IR/C# documents.**
\n\nCommit migrated from ef31a9683b
2019-05-08 09:22:42 -07:00
Pranav K 997ab19511 Unskip Build_WithViews_ProducesDepsFileWithCompilationContext_ButNoReferences (dotnet/aspnetcore-tooling#560)
\n\nCommit migrated from e5a23e0588
2019-05-03 12:15:27 -07:00
Nate McMaster 4a4b80046d Enable resx source generation (dotnet/aspnetcore-tooling#561)
\n\nCommit migrated from 627710fcb8
2019-05-03 12:04:53 -07:00
Ajay Bhargav Baaskaran 9a456a5aeb Fix crash in functions block (dotnet/aspnetcore-tooling#550)
\n\nCommit migrated from 3fe99e9d7f
2019-05-02 13:40:25 -07:00
Ajay Bhargav Baaskaran c21572bf8f Merge pull request dotnet/aspnetcore-tooling#526 from aspnet/ajbaaska/generic-int-fix
Fix invalid cast in non-generic parameterized ChildContent\n\nCommit migrated from e622d7c405
2019-05-01 17:18:31 -07:00
Ajay Bhargav Baaskaran 9860cfc34b do the needful
\n\nCommit migrated from c5a7e9ecce
2019-05-01 14:53:26 -07:00
Ajay Bhargav Baaskaran 67855582bb Update comment
\n\nCommit migrated from f78e4c258e
2019-05-01 14:41:35 -07:00
Ajay Bhargav Baaskaran 2050916767 Add @code directive support for Blazor
\n\nCommit migrated from 7dc5887b49
2019-04-30 21:05:23 -07:00
Ajay Bhargav Baaskaran 3c5903095a Fix invalid cast in non-generic parameterized ChildContent
\n\nCommit migrated from 5ca26a352e
2019-04-30 20:32:16 -07:00
Ajay Bhargav Baaskaran 5f462346c6 Added support for @namespace directive in Blazor (dotnet/aspnetcore-tooling#504)
* Added support for @namespace directive in Blazor
\n\nCommit migrated from 7f6c1422dd
2019-04-30 17:58:13 -07:00
Steve Sanderson ed04f3ebb8 'key' directive attribute for components (dotnet/aspnetcore-tooling#508)
\n\nCommit migrated from 0803d3bbed
2019-04-29 16:16:05 +01:00
Ryan Nowak 9deb4401e4 Fix dotnet/aspnetcore-tooling#5709
Enables the correct processing of data- attributes for components.
\n\nCommit migrated from 7ae8a8c842
2019-04-25 08:27:43 -07:00
Ajay Bhargav Baaskaran 43824a4c12 Verify line pragmas on generated code (dotnet/aspnetcore-tooling#392)
* Verify line pragmas on generated code
\n\nCommit migrated from ca33b2d51b
2019-04-22 14:43:13 -07:00
Ajay Bhargav Baaskaran 956606ee5d Fix TypeInference code gen for non-generic parameter (dotnet/aspnetcore-tooling#433)
\n\nCommit migrated from 4233bc593c
2019-04-19 10:06:13 -07:00
dotnet-maestro[bot] dd5dac97e5 [master] Update dependencies from aspnet/Extensions (dotnet/aspnetcore-tooling#409)
* Update dependencies from https://github.com/aspnet/Extensions build 20190410.2

- Microsoft.AspNetCore.BenchmarkRunner.Sources - 3.0.0-preview5.19210.2
- Microsoft.AspNetCore.Testing - 3.0.0-preview5.19210.2
- Microsoft.Extensions.CommandLineUtils.Sources - 3.0.0-preview5.19210.2
- Microsoft.Extensions.NonCapturingTimer.Sources - 3.0.0-preview5.19210.2
- Microsoft.Extensions.HashCodeCombiner.Sources - 3.0.0-preview5.19210.2
- Microsoft.Extensions.Logging - 3.0.0-preview5.19210.2

Dependency coherency updates

- System.Diagnostics.DiagnosticSource - 4.6.0-preview5.19208.5 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27608-16 (parent: Microsoft.Extensions.Logging)
- System.Text.Encodings.Web - 4.6.0-preview5.19208.5 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27608-16 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.DependencyModel - 3.0.0-preview5-27608-16 (parent: Microsoft.Extensions.Logging)
- Microsoft.NETCore.Platforms - 3.0.0-preview5.19208.5 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27608-16 (parent: Microsoft.Extensions.Logging)

* Try a coherent SDK and Runtime

* Try again

* Fix codecheck

* Update dependencies from https://github.com/aspnet/Extensions build 20190410.2

- Microsoft.AspNetCore.BenchmarkRunner.Sources - 3.0.0-preview5.19210.2
- Microsoft.AspNetCore.Testing - 3.0.0-preview5.19210.2
- Microsoft.Extensions.CommandLineUtils.Sources - 3.0.0-preview5.19210.2
- Microsoft.Extensions.NonCapturingTimer.Sources - 3.0.0-preview5.19210.2
- Microsoft.Extensions.HashCodeCombiner.Sources - 3.0.0-preview5.19210.2
- Microsoft.Extensions.Logging - 3.0.0-preview5.19210.2

Dependency coherency updates

- System.Diagnostics.DiagnosticSource - 4.6.0-preview5.19208.5 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27608-16 (parent: Microsoft.Extensions.Logging)
- System.Text.Encodings.Web - 4.6.0-preview5.19208.5 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27608-16 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.DependencyModel - 3.0.0-preview5-27608-16 (parent: Microsoft.Extensions.Logging)
- Microsoft.NETCore.Platforms - 3.0.0-preview5.19208.5 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27608-16 (parent: Microsoft.Extensions.Logging)

* Try again

* Update dependencies from https://github.com/aspnet/Extensions build 20190410.2

- Microsoft.AspNetCore.BenchmarkRunner.Sources - 3.0.0-preview5.19210.2
- Microsoft.AspNetCore.Testing - 3.0.0-preview5.19210.2
- Microsoft.Extensions.CommandLineUtils.Sources - 3.0.0-preview5.19210.2
- Microsoft.Extensions.NonCapturingTimer.Sources - 3.0.0-preview5.19210.2
- Microsoft.Extensions.HashCodeCombiner.Sources - 3.0.0-preview5.19210.2
- Microsoft.Extensions.Logging - 3.0.0-preview5.19210.2

Dependency coherency updates

- System.Diagnostics.DiagnosticSource - 4.6.0-preview5.19208.5 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27608-16 (parent: Microsoft.Extensions.Logging)
- System.Text.Encodings.Web - 4.6.0-preview5.19208.5 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27608-16 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.DependencyModel - 3.0.0-preview5-27608-16 (parent: Microsoft.Extensions.Logging)
- Microsoft.NETCore.Platforms - 3.0.0-preview5.19208.5 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27608-16 (parent: Microsoft.Extensions.Logging)

* Update dependencies from https://github.com/aspnet/Extensions build 20190412.9

- Microsoft.AspNetCore.BenchmarkRunner.Sources - 3.0.0-preview5.19212.9
- Microsoft.AspNetCore.Testing - 3.0.0-preview5.19212.9
- Microsoft.Extensions.CommandLineUtils.Sources - 3.0.0-preview5.19212.9
- Microsoft.Extensions.NonCapturingTimer.Sources - 3.0.0-preview5.19212.9
- Microsoft.Extensions.HashCodeCombiner.Sources - 3.0.0-preview5.19212.9
- Microsoft.Extensions.Logging - 3.0.0-preview5.19212.9

Dependency coherency updates

- System.Diagnostics.DiagnosticSource - 4.6.0-preview5.19211.22 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27611-18 (parent: Microsoft.Extensions.Logging)
- System.Text.Encodings.Web - 4.6.0-preview5.19211.22 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27611-18 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.DependencyModel - 3.0.0-preview5-27611-18 (parent: Microsoft.Extensions.Logging)
- Microsoft.NETCore.Platforms - 3.0.0-preview5.19211.22 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27611-18 (parent: Microsoft.Extensions.Logging)

* Update dependencies from https://github.com/aspnet/Extensions build 20190413.4

- Microsoft.AspNetCore.BenchmarkRunner.Sources - 3.0.0-preview5.19213.4
- Microsoft.AspNetCore.Testing - 3.0.0-preview5.19213.4
- Microsoft.Extensions.CommandLineUtils.Sources - 3.0.0-preview5.19213.4
- Microsoft.Extensions.NonCapturingTimer.Sources - 3.0.0-preview5.19213.4
- Microsoft.Extensions.HashCodeCombiner.Sources - 3.0.0-preview5.19213.4
- Microsoft.Extensions.Logging - 3.0.0-preview5.19213.4

Dependency coherency updates

- System.Diagnostics.DiagnosticSource - 4.6.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-02 (parent: Microsoft.Extensions.Logging)
- System.Text.Encodings.Web - 4.6.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-02 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.DependencyModel - 3.0.0-preview5-27613-02 (parent: Microsoft.Extensions.Logging)
- Microsoft.NETCore.Platforms - 3.0.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-02 (parent: Microsoft.Extensions.Logging)

* Update dependencies from https://github.com/aspnet/Extensions build 20190414.1

- Microsoft.AspNetCore.BenchmarkRunner.Sources - 3.0.0-preview5.19214.1
- Microsoft.AspNetCore.Testing - 3.0.0-preview5.19214.1
- Microsoft.Extensions.CommandLineUtils.Sources - 3.0.0-preview5.19214.1
- Microsoft.Extensions.NonCapturingTimer.Sources - 3.0.0-preview5.19214.1
- Microsoft.Extensions.HashCodeCombiner.Sources - 3.0.0-preview5.19214.1
- Microsoft.Extensions.Logging - 3.0.0-preview5.19214.1

Dependency coherency updates

- System.Diagnostics.DiagnosticSource - 4.6.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-11 (parent: Microsoft.Extensions.Logging)
- System.Text.Encodings.Web - 4.6.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-11 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.DependencyModel - 3.0.0-preview5-27613-11 (parent: Microsoft.Extensions.Logging)
- Microsoft.NETCore.Platforms - 3.0.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-11 (parent: Microsoft.Extensions.Logging)

* Restore with the appropriate RuntimeFrameworkVersion before building or publishing

* Fix incremental test

* Update dependencies from https://github.com/aspnet/Extensions build 20190416.8

- Microsoft.AspNetCore.BenchmarkRunner.Sources - 3.0.0-preview5.19216.8
- Microsoft.AspNetCore.Testing - 3.0.0-preview5.19216.8
- Microsoft.Extensions.CommandLineUtils.Sources - 3.0.0-preview5.19216.8
- Microsoft.Extensions.NonCapturingTimer.Sources - 3.0.0-preview5.19216.8
- Microsoft.Extensions.HashCodeCombiner.Sources - 3.0.0-preview5.19216.8
- Microsoft.Extensions.Logging - 3.0.0-preview5.19216.8

Dependency coherency updates

- System.Diagnostics.DiagnosticSource - 4.6.0-preview5.19215.16 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27616-01 (parent: Microsoft.Extensions.Logging)
- System.Text.Encodings.Web - 4.6.0-preview5.19215.16 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27616-01 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.DependencyModel - 3.0.0-preview5-27616-01 (parent: Microsoft.Extensions.Logging)
- Microsoft.NETCore.Platforms - 3.0.0-preview5.19215.16 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27616-01 (parent: Microsoft.Extensions.Logging)
\n\nCommit migrated from f9c222d305
2019-04-17 16:16:34 +00:00
Pranav K 2309e56de8 Do not split warning message across multiple lines (dotnet/aspnetcore-tooling#432)
The newline in the warning messages causes the warning message to appear as two separate warnings in the build output:

Microsoft.NET.Sdk.Razor\build\netstandard2.0\Sdk.Razor.CurrentVersion.targets(805,5): warning RAZORSDK1004: One or more Razor view or page files were found, but the project is not configured to add Razor support for MVC. The MSBuild property 'AddRazorSupportForMvc' must be set to correctly
Microsoft.NET.Sdk.Razor\build\netstandard2.0\Sdk.Razor.CurrentVersion.targets(805,5): warning RAZORSDK1004:  compile Razor files that target MVC. For more information, see https://go.microsoft.com/fwlink/?linkid=868374.

This change fixes the warning message to appear as a single warning:

Microsoft.NET.Sdk.Razor\build\netstandard2.0\Sdk.Razor.CurrentVersion.targets(805,5): warning RAZORSDK1004: One or more Razor view or page files were found, but the project is not configured to add Razor support for MVC. The MSBuild property 'AddRazorSupportForMvc' must be set to correctly compile Razor files that target MVC. For more information, see https://go.microsoft.com/fwlink/?linkid=868374.\n\nCommit migrated from 373bf2b74f
2019-04-16 20:44:34 -07:00
Pranav K 92e86f9d02 Check for TargetFramework in addition to version (dotnet/aspnetcore-tooling#428)
* Check for TargetFramework in addition to version

\n\nCommit migrated from a4ed82f823
2019-04-16 11:13:26 -07:00
Doug Bunting ae4af3d154 Shorten Microsoft.AspNetCore.Razor.Language.Test paths (dotnet/aspnetcore-tooling#425)
* Shorten Microsoft.AspNetCore.Razor.Language.Test paths
- aspnet/AspNetCoredotnet/aspnetcore-tooling#9358 and aspnet/AspNetCoredotnet/aspnetcore-tooling#7882
- do 4046 renames
- adjust solutions to renamed directory
- special-case directory of the Microsoft.AspNetCore.Razor.Language.Test project in `TestProject`\n\nCommit migrated from 72b939d855
2019-04-15 10:46:17 -07:00
Pranav K 90eb9e8535 Fixup SDK workarounds (dotnet/aspnetcore-tooling#413)
* Correctly update the .NET Core SDK used in Razor
* Replace LangVersion 8.0 with LangVersion Preview
* Remove AddRazorSupportForMvc from projects that do not require it
* Cleanup how AspNetCore.App is not referenced in the project
* Remove uses of _RazorComponentInclude from tests\n\nCommit migrated from 81ea07caf7
2019-04-12 11:17:09 -07:00
Ajay Bhargav Baaskaran 607f64b386 Don't render text tags for component documents (dotnet/aspnetcore-tooling#391)
\n\nCommit migrated from cb6f5d0dc7
2019-04-06 19:46:24 -07:00
dotnet-maestro[bot] 7957c11d02 [master] Update dependencies from dotnet/arcade (dotnet/aspnetcore-tooling#346)
* Update dependencies from https://github.com/dotnet/arcade build 20190317.10

This change updates the following dependencies
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19167.10

* Update dependencies from https://github.com/dotnet/arcade build 20190320.2

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19170.2

* Update dependencies from https://github.com/dotnet/arcade build 20190321.3

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19171.3

* Update dependencies from https://github.com/dotnet/arcade build 20190321.6

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19171.6

* Update dependencies from https://github.com/dotnet/arcade build 20190325.9

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19175.9

* Update dependencies from https://github.com/dotnet/arcade build 20190326.14

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19176.14

* Update dependencies from https://github.com/dotnet/arcade build 20190327.11

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19177.11

* Update dependencies from https://github.com/dotnet/arcade build 20190329.1

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19179.1

* Update dependencies from https://github.com/dotnet/arcade build 20190329.2

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19179.2

* Update dependencies from https://github.com/dotnet/arcade build 20190401.12

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19201.12

* Update dependencies from https://github.com/dotnet/arcade build 20190402.13

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19202.13

* Update dependencies from https://github.com/dotnet/arcade build 20190403.10

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19203.10

* Update dependencies from https://github.com/dotnet/arcade build 20190404.16

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19204.16

* Update dependencies from https://github.com/dotnet/arcade build 20190405.6

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19205.6

* Use updated Arcade NuSpec helpers
- provide `InitializeStandardNuspecProperties` with expected information
- use `$CommonMetadataElements$` in Microsoft.NET.Sdk.Razor.nuspec

nits:
- correct a typo or two
\n\nCommit migrated from c60b63e296
2019-04-07 00:22:02 +00:00
Ajay Bhargav Baaskaran 35edb562c5 Match component childcontent tag helper from a different namespace (dotnet/aspnetcore-tooling#390)
\n\nCommit migrated from 8a815a1882
2019-04-05 16:00:29 -07:00
Pranav K 5b71a24b4f Fixup
\n\nCommit migrated from f6dd261211
2019-04-04 06:05:46 -07:00
Pranav K 37275e5fd5 Do not generate MVC attributes unless necessary
Fixes https://github.com/aspnet/AspNetCore/issues/8161
\n\nCommit migrated from a976b80c7c
2019-04-03 21:57:08 -07:00
Ajay Bhargav Baaskaran 01e9d70207 Decode HTML entities (dotnet/aspnetcore-tooling#379)
* Decode HTML entities
\n\nCommit migrated from 6b7b9a3bc3
2019-04-03 10:03:42 -07:00
Ajay Bhargav Baaskaran 249752087e Fix csharp intellisense in _Imports.razor (dotnet/aspnetcore-tooling#387)
* Fix csharp intellisense in _Imports.razor

* Feedback
\n\nCommit migrated from 229951a5c8
2019-04-02 21:55:37 -07:00
N. Taylor Mullen ea5d10509e Expand RazorProject.GetItem to take in FileKinds when getting items.
- Obsoleted old `GetItem` API.
- Updated tests to take new API.
- Added a new test to verify the broken scenario.

dotnet/aspnetcore-tooling#8972
\n\nCommit migrated from 2dd34b8dd8
2019-04-02 13:32:35 -07:00
Pranav K d365a92ca4 Ensure _TargetingNETCoreApp30OrLater is available for older design time targets (dotnet/aspnetcore-tooling#386)
* Ensure _TargetingNETCoreApp30OrLater is available for design time targets

\n\nCommit migrated from 9d7fd089a6
2019-04-02 13:00:22 -07:00
Pranav K 8bc448e255 Prevent build failures and warnings when building 2.x projects (dotnet/aspnetcore-tooling#382)
* Move targets for component design time generation to
Components.targets

* Provide a better error message when referencing a 2.x Razor.Design
package in a 3.0 project

* Do not produce a warning for unresolved configuration when building
2.x projects\n\nCommit migrated from b5b1647646
2019-04-01 22:38:09 -07:00
Ryan Nowak 2ff5e7301e Fixes: dotnet/aspnetcore-tooling#5640 FormatException from diagnostic
This was just a badly written diagnostic format string
\n\nCommit migrated from ef7d82a7ff
2019-04-01 20:44:26 -07:00
Ajay Bhargav Baaskaran 8bb16c28aa Prevent newlines from being encoded in the output (dotnet/aspnetcore-tooling#374)
* Prevent newlines from being encoded in the output
\n\nCommit migrated from 5f74fae0d2
2019-03-29 13:04:15 -07:00
Steve Sanderson 8a8e144653 Remove base.BuildRenderTree calls (dotnet/aspnetcore-tooling#368)
\n\nCommit migrated from bcc77db762
2019-03-28 12:46:36 +00:00
Ajay Bhargav Baaskaran 8eee2d5bc4 Skip running ModelDirective pass for component documents (dotnet/aspnetcore-tooling#372)
\n\nCommit migrated from 6824620cb0
2019-03-27 09:52:34 -07:00
Ajay Bhargav Baaskaran 730f3cdc6b Better support for _Imports.razor (dotnet/aspnetcore-tooling#357)
* Better support for _Imports.razor

* Special case component imports when generating code

* Prevent a future VS crash

* Rebased and updated

* update

* Removed unnecessary newline
\n\nCommit migrated from abbfe00bdc
2019-03-26 17:58:37 -07:00
N. Taylor Mullen 784596aba6 Add support for C# 8 using variable declarations and add more C# 8 coverage.
- When adding additional C# 8 tests found that we didn't fully support this.
- Updated the C# 8.0 test to fully encompass everything C# 8.0.
- Added a feature flag to control using variable declaration errors when not top level.
- Added using variable declaration specific tests.

aspnet/AspNetCoredotnet/aspnetcore-tooling#5092
\n\nCommit migrated from ac08ad3659
2019-03-26 17:37:12 -07:00
Pranav K 6eb9044660 Fixup invalid configuration error message (dotnet/aspnetcore-tooling#365)
* Fix invalid parameter used in error message
* Re-organize test code\n\nCommit migrated from 5a73c2abe9
2019-03-26 08:58:38 -07:00
Javier Calvarro Nelson 9c35c07a0b bind-Value on EditText often results in the wrong thing (dotnet/aspnetcore-tooling#364)
Updates the bindtaghelperdescriptorprovider to use the changed event property type name on the bound attribute instead of the value property type attribute.\n\nCommit migrated from 3009045206
2019-03-26 10:06:18 +01:00
N. Taylor Mullen f98ffcd759 Update more test files.
\n\nCommit migrated from 76c1352d2c
2019-03-25 20:26:36 -07:00
N. Taylor Mullen 40340e9b91 Design update.
\n\nCommit migrated from c9e0d2a60f
2019-03-25 20:26:36 -07:00
N. Taylor Mullen f33e1fca53 Enforce nullability for user code.
- Expanded the `ProjectWorkspaceStateGenerator` to extract the C# language version when building the `ProjectWorkspaceState`. This approach enables all platforms to get nullability support without any changes (as long as they support `ProjectWorkspaceState`, which they do). Also, Roslyn suggested that we avoid dealing with LangVersion directly because there are several factors that impact its "effective" value on a project when run in tooling.
- Updated the `LinePragma` code generation to include `#nullable restore` and `#nullable disable` lines to allow for project restored nullability state for user code.
- Added a new `RazorProjectEngineBuilderExtensions` class that adds Roslyn specific project engine modifications. In this case it allows us to set the C# language version for a project engine and configure underlying features accordingly.
- Added a `SuppressNullabilityEnforcement` flag that only turns on if C# < 8 is specified.
- Updated LiveShare, VS4Mac and RazorGenerate to understand CSharpLanguageVersion.
- Added a single test output to show the change.

dotnet/aspnetcore-tooling#5092
\n\nCommit migrated from 1df8128b87
2019-03-25 20:26:36 -07:00
Pranav K 31e916cdfd Add .razor files to UpToDateCheckInput (dotnet/aspnetcore-tooling#359)
Fixes https://github.com/aspnet/AspNetCore/issues/8181\n\nCommit migrated from da168188b4
2019-03-23 14:05:21 -07:00
Ajay Bhargav Baaskaran 1d53925b8e Fixed generic components with fully qualified names (dotnet/aspnetcore-tooling#356)
\n\nCommit migrated from b7392f1f84
2019-03-22 14:22:12 -07:00
Ajay Bhargav Baaskaran 92d931c229 Support importing components with @using directives (dotnet/aspnetcore-tooling#276)
* Support importing components with @using directives

* Suppress taghelper directive completion in component documents

* feedback

* More feedback

* Update tests

* Update CodeAnalysis.Razor tests

* Flow filekind

* Changes

* More code gen tests

* More tests

* fix

* Added more tests

* Made stuff internal

* Filter out temporary tag helper descriptors

* update

* Do the needful
\n\nCommit migrated from 343f37748e
2019-03-22 10:29:38 -07:00
Ajay Bhargav Baaskaran 91a383ad3b Add support for _Imports.razor (dotnet/aspnetcore-tooling#354)
* Added support _Imports.razor

* Feedback
\n\nCommit migrated from 14704054f2
2019-03-22 09:19:56 -07:00
Ajay Bhargav Baaskaran 62199e2195 Bring back errors for missing tags in component documents (dotnet/aspnetcore-tooling#351)
\n\nCommit migrated from ca1e656f6b
2019-03-21 12:22:28 -07:00
Pranav K b2b207faa1 Allow some warnings (dotnet/aspnetcore-tooling#353)
Fixes https://github.com/aspnet/AspNetCore-Internal/issues/2050\n\nCommit migrated from e2b1df744e
2019-03-21 12:10:16 -07:00
Pranav K cf116d619b Do not restore as part of test (dotnet/aspnetcore-tooling#350)
\n\nCommit migrated from 84bc53671f
2019-03-21 09:28:44 -07:00
N. Taylor Mullen e5064d3c76 Allow markup in local functions and @functions.
- Allow markup to exist in all code blocks. Prior to this change whenever we'd see nested curly braces we would do dumb brace matching to skip over any potentially risky code; now we treat every curly brace as an opportunity to intermingle Markup.
- One fix I had to introduce was now that functions blocks are parsed like `@{}` blocks I ran into cases where certain reserved keywords would get improperly parsed. This exposed a bug in our parsing where we’d treat **class** and **namespace** as directives without a transition in a `@{}` block. For instance this:
```
@{
    class
}
```
would barf in the old parser by treating the `class` piece as a directive even though it did not have a transition. To account for this I changed our reserved directives to be parsed as directives instead of keywords (it's how they should have been parsed anyhow). This isn't a breaking change because the directive parsing logic is a subset of how keywords get parsed.

- One quirk this change introduces is a difference in behavior in regards to one error case. Before this change if you were to have `@if (foo)) { var bar = foo; }` the entire statement would be classified as C# and you'd get a C# error on the trailing `)`. With my changes we try to keep group statements together more closely and allow for HTML in unexpected or end of statement scenarios. So, with these new changes the above example would only have `@if (foo))` classified as C# and the rest as markup because the original was invalid.
- Added lots of tests,
- Modified the feature flag to maintain the old behavior when disabled.

aspnet/AspNetCoredotnet/aspnetcore-tooling#5110
\n\nCommit migrated from 5ffd84e56d
2019-03-20 10:38:50 -07:00
Pranav K 25e5a4ffab Infer Razor Configuration \ RazorLangVersion based on TFM (dotnet/aspnetcore-tooling#343)
* Infer Razor Configuration \ RazorLangVersion based on TFM

Fixes https://github.com/aspnet/AspNetCore/issues/6392
\n\nCommit migrated from cfee40a19e
2019-03-19 16:33:26 -07:00
Ajay Bhargav Baaskaran 2c39457306 Flow RootNamespace from MSBuild (dotnet/aspnetcore-tooling#331)
- Flow Root namespace through in command line builds

- Flow Root namespace through in design time builds

- Feedback\n\nCommit migrated from 057d4f3570
2019-03-13 14:18:07 -07:00
Andrew Stanton-Nurse eeabe9ee71 skip flaky razor build integration test (dotnet/aspnetcore-tooling#326)
mitigates aspnet/AspNetCore-Internaldotnet/aspnetcore-tooling#1931\n\nCommit migrated from 128efdd177
2019-03-12 09:51:35 -07:00
Ajay Bhargav Baaskaran c5c30e460e Preserve diagnostics when rewriting Red nodes (dotnet/aspnetcore-tooling#319)
\n\nCommit migrated from 276532454e
2019-03-11 10:31:37 -07:00
N. Taylor Mullen b3d727b631 Enable IntelliSense for new component parameters.
- Added a `FilePathComparison` object since not all string methods allow a comparer.
- Updated `RazorDirectiveCompletionProvider` to also understand `.razor` files. This is an edge case scenario where users have disabled modern completion and are using Razor components (you need a reg key to disable the modern completion or MS needs to disable it).
- Tested this in VS by referencing the latest Razor SDK (preview 3) from NuGet and then replacing the Razor design time targets in VS to be the ones from the preview 3 package.
- Added workspace project state change detector tests.

dotnet/aspnetcore-tooling#8064
\n\nCommit migrated from 6a83ed13fc
2019-03-08 09:01:03 -08:00
Ajay Bhargav Baaskaran 1657080589 Correctly normalize file path from network shares (dotnet/aspnetcore-tooling#298)
* Correctly normalize file path from network shares

* Feedback
\n\nCommit migrated from 8ee676d84c
2019-03-05 15:13:54 -08:00
Ajay Bhargav Baaskaran 8775af3309 Re-enable skipped test (dotnet/aspnetcore-tooling#303)
\n\nCommit migrated from 14eee079bf
2019-03-05 12:22:21 -08:00
N. Taylor Mullen 9ffd08c061 Remove rarely used public obsolete public API.
- The `DocumentWriter` case should never be called because you need to override a lot of the internals of the RazorEngine to get to the document writer. Therefore, little harm in removing the method.
- `ProjectChangeEventArgs` used to be uised by the LiveShare extension. We've since taken ownership of those bits and no longer need to maintain those constructors.
- `DefaultTagHelperDescriptorProvider.DesignTime` didn't actually do anything. Removing since the code was truly dead and did nothing functionally.

dotnet/aspnetcore-tooling#7146
\n\nCommit migrated from ba6450a695
2019-03-04 19:35:17 -08:00