Commit Graph

126 Commits

Author SHA1 Message Date
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
N. Taylor Mullen 53392ba761 Add LanguageServer Common IVTs
\n\nCommit migrated from 29b0e92bcd
2019-03-04 15:08:49 -08:00
Ajay Bhargav Baaskaran ede3a6809e Temporarily skip test (dotnet/aspnetcore-tooling#288)
\n\nCommit migrated from 0598ec4497
2019-03-01 11:48:46 -08:00
Pranav K 1af49ef26f Reference the SDK project to make build time restore actually work (dotnet/aspnetcore-tooling#278)
\n\nCommit migrated from 22f4c134c1
2019-03-01 09:35:52 -08:00
Ajay Bhargav Baaskaran c7b34a9184 Unskip test (dotnet/aspnetcore-tooling#231)
* Unskip test

* Better test
\n\nCommit migrated from 933d0919ad
2019-02-28 17:21:55 -08:00
N. Taylor Mullen 875e40a5c1 Skip first run experience locally and on azure pipelines.
- This would cause our functional tests to time out and occasionally crash due to dotnet first run experience sentinels being locked.

aspnet/AspNetCore-Internaldotnet/aspnetcore-tooling#1859
\n\nCommit migrated from 2668a0e8a9
2019-02-28 15:25:50 -08:00
Ryan Nowak 6274d4ec86 Update naming and branding for components
\n\nCommit migrated from f820894941
2019-02-25 19:17:00 -08:00
Ryan Nowak 8f76b90585 Add new nesting capability
\n\nCommit migrated from 2ca30ed836
2019-02-25 17:39:44 -08:00
N. Taylor Mullen 921373b0a6 Add IVT to OmniSharpPlugin.StrongNamed.
\n\nCommit migrated from b66f016af8
2019-02-22 16:59:34 -08:00
Nate McMaster d05aa84ec3 Merge branch 'release/3.0-preview3'
\n\nCommit migrated from ce4813df7d
2019-02-22 10:26:10 -08:00
Nate McMaster 61e85256a6 Update dependencies and remove some unused version variable overrides (dotnet/aspnetcore-tooling#238)
* Update dependencies
* Add workaround for dotnet/sdkdotnet/aspnetcore-tooling#2976
* Remove unused NETStandard package version variable and overrides
* Update xunit to 2.4.1
\n\nCommit migrated from 67082970b7
2019-02-22 10:24:51 -08:00
Ryan Nowak 81ac40e82d Fix a bad copy-paste
\n\nCommit migrated from d63c6bbc2c
2019-02-21 15:23:43 -08:00
Ajay Bhargav Baaskaran ca3e094bee Fixed an assumption in ComponentLoweringPass (dotnet/aspnetcore-tooling#226)
\n\nCommit migrated from 87bb138304
2019-02-20 09:25:12 -08:00
Ryan Nowak 54e79153ec Add compiler support for EventCallback (dotnet/aspnetcore-tooling#222)
* Add new APIs to ComponentShim

* Add new APIs to ComponentsApi

* Add EventCallback metadata

* Add discovery of EventCallback properties

* Errata for Runtime APIs

* Add ability to use EventCallback as parameter

* Add support for bind to component

* Use EventCallback for bind-... to elements

* Use EventCallback<T> for event handlers
\n\nCommit migrated from a0b6bc0e52
2019-02-19 12:39:34 -08:00
N. Taylor Mullen 1243e07e56 Make TagHelper & Razor comments locatable at design time.
- Added a step to full fidelity verification that does a `LocateOwner` at every source location. If we find a `null` owner we build a snippet with a detailed response to enable us to diagnose the problem.

Addresses aspnet/AspNetCoredotnet/aspnetcore-tooling#7718
\n\nCommit migrated from 08587a30fd
2019-02-19 12:31:36 -08:00
Steve Sanderson 82d850d3a7 Components that accept bind-Something can request SomethingExpression (dotnet/aspnetcore-tooling#213)
* In binding to components, automatically supply FooExpression when requested

* Fix tests

* CR feedback
\n\nCommit migrated from ca9de74f4e
2019-02-18 09:37:41 +00:00
Ajay Bhargav Baaskaran 0ab2a1e586 Fix an assumption in ComponentBindLoweringPass (dotnet/aspnetcore-tooling#212)
\n\nCommit migrated from 315f804d6e
2019-02-14 17:25:52 -08:00
N. Taylor Mullen 67ef6b7e3c Merge branch 'release/vs16.0-preview4'
\n\nCommit migrated from f547905bc6
2019-02-12 12:40:11 -08:00
Pranav K 8b61ae7196 Use new PreserveCompilationReferences in Razor Sdk (dotnet/aspnetcore-tooling#187)
* Use new PreserveCompilationReferences in Razor Sdk

Fixes https://github.com/aspnet/AspNetCore/issues/6512
\n\nCommit migrated from f58c436961
2019-02-11 19:54:04 -08:00
N. Taylor Mullen abd5ab8080 Add @await foreach for C# 8
- Added general C# 8 tests that we can use to include nullability when the time comes.
- Added statement test to ensure syntax tree is correct for await foreach.

aspnet/AspNetCoredotnet/aspnetcore-tooling#5078
\n\nCommit migrated from 27e1d8c011
2019-02-11 09:45:02 -08:00
N. Taylor Mullen 824796b4e4 Add IVT to LanguageServer.Common project.
\n\nCommit migrated from b18dcbff57
2019-02-08 17:32:39 -08:00
Ajay Bhargav Baaskaran 990c585eba Merge branch 'release/vs16.0-preview4'
\n\nCommit migrated from 408b123a64
2019-02-07 15:08:16 -08:00
Ajay Bhargav Baaskaran daeb4f80d1 Fix invalid cast with end script tag containing code (dotnet/aspnetcore-tooling#193)
\n\nCommit migrated from 56fa17b094
2019-02-07 15:06:26 -08:00
Ajay Bhargav Baaskaran 73ca91f603 Handle multiple nested sections correctly (dotnet/aspnetcore-tooling#196)
\n\nCommit migrated from 26e8d86b21
2019-02-07 14:04:57 -08:00
Ajay Bhargav Baaskaran 57c10c0321 Fixed null-ref with reserved word inside a code block (dotnet/aspnetcore-tooling#192)
\n\nCommit migrated from 10dbc434ee
2019-02-07 14:03:23 -08:00
Ajay Bhargav Baaskaran b15af76917 Fix crash with code blocks in tag helper attributes (dotnet/aspnetcore-tooling#190)
* Fix crash with code blocks in tag helper attributes

* Better fix

* Fixed another case
\n\nCommit migrated from 9e97ba9b97
2019-02-07 14:02:10 -08:00
Pranav K 1cbc513cfb Restore packages as part of build to avoid restore timeouts as part of running tests
Fixes https://github.com/aspnet/AspNetCore-Internal/issues/1701
\n\nCommit migrated from 7f49b97eb5
2019-02-06 14:04:24 -08:00
N. Taylor Mullen cbaadeff26 Merge branch 'release/vs16.0-preview4'
\n\nCommit migrated from ce9f141521
2019-02-05 12:06:56 -08:00
N. Taylor Mullen 1ad018c1ff Merge remote-tracking branch 'origin/release/vs16.0-preview4'
\n\nCommit migrated from ef2f8975db
2019-02-04 09:55:15 -08:00
N. Taylor Mullen 3c6f99b3f1 Merge branch 'release/vs16.0-preview4'
\n\nCommit migrated from 5af7556663
2019-02-01 11:08:57 -08:00
N. Taylor Mullen 83c8c0cba2 Don't associate Roslyn workspace project with ProjectSnapshot.
- Removed the differences of workspace project and `HostProject` in regards to `ProjectSnapshotManager` methods. We now just have `ProjectAdded`, `ProjectRemoved` etc.
- Obsoleted Workspace related members from the `ProjectSnapshot`in order to ensure that current LiveShare continues to work. Once LiveShare has been incorporated into Razor we can remove these members from the project snapshot.
- Removed several TagHelper calculating logic pieces from the document tracker. This is now done entirely from the ProjectSnapshotManager so there's no secondary route that needs to be taken in order to resolve TagHelpers for VS windows cases.
- Updated the `ProjectState` to take in TagHelpers and removed the internal logic it had to resolve TagHelpers.
- Added a TagHelpers property to ProjectSnapshot to indicate that they're no longer calculated, they're part of the project inputs.
- Added a ProjectWorkspaceChange generator to be responsible for calculating any workspace related information that is needed for a `ProjectSnapshot`. For now, this just calculates TagHelpers but in the future it may do more.
- Added a `FilePathComparison` static helper class which acts similarly to `FilePathComparer`.
- Changed our dynamic file info provider to no longer care about `ProjectIds`. Before this, it kept track of the project ids internally but never used them so this is a noop functional change.
- Changed how the out of process remote TagHelper resolution flow works. Prior to this you'd pass a Project across the wire as part of a project snapshot handle and then resolve TagHelpers the old fashioned way.
- Updated all existing tests to respect the new `ProjectWorkspaceState` flows.
- Added tests for new APIs.

dotnet/aspnetcore-tooling#6672
\n\nCommit migrated from a5621641f8
2019-02-01 11:06:20 -08:00
N. Taylor Mullen 12a6864710 Prioritize local dotnet when running SDK Razor tests.
- The SDK tests were occasionally failing with access denied due to the test using the machines dotnet.exe (instead of the local projects dotnet.exe).

dotnet/aspnetcore-tooling#1667
\n\nCommit migrated from 1a96714921
2019-02-01 11:06:19 -08:00
Ajay Bhargav Baaskaran b87b984902 Merge branch 'release/vs16.0-preview3'
\n\nCommit migrated from 77532db903
2019-02-01 10:59:34 -08:00
Ajay Bhargav Baaskaran 57211a33db Fix: Exception for empty data- attributes in tag helpers (dotnet/aspnetcore-tooling#173)
\n\nCommit migrated from 6d71b6a265
2019-01-30 09:12:37 -08:00
Pranav K 4505f76987 Ensure TagHelpers from the current project are discovered for projects targeting 2.x
As part of migrating the CodeGeneration targets in to the Razor.Sdk,
the SDK broke the contract that RazorReferencePaths includes the full closure
of assemblies during tag helper discovery.

This change restores the behavior to be compatible with the 2.x Razor.Design
package and adds tests to verify TagHelper discovery works in a range of projects.

Fixes https://github.com/aspnet/AspNetCore/issues/6825
\n\nCommit migrated from 99938c9b7e
2019-01-29 11:21:27 -08:00
Ryan Nowak d4c3a2fbd9 Fix dependency to aspnet/AspNetCore-Tooling (dotnet/aspnetcore-tooling#170)
* Remove unused package versions
* Remove references to Html.Abstractions
Removing this package since it's from the aspnet/AspNetCore.

* Remove System.ValueTuple package inside remove
* Add versions.details.xml items from corefx
* Add Microsoft.NETCore.App
* Fill up Version.Details.xml
* Update dependencies
* Fix failing test
\n\nCommit migrated from bd7fc9ddf6
2019-01-24 16:57:16 -08:00