Commit Graph

69 Commits

Author SHA1 Message Date
Nate McMaster 4d737af167 Pin tool and package versions to make builds more repeatable
Part of aspnet/Universe#575
2017-11-01 18:12:08 -07:00
N. Taylor Mullen 212d97e511 Manage VisualStudioRazorParser lifetime.
- Exposed `VisualStudioRazorParser`, `DocumentStructureChangedEventArgs` and `ICanHasContextChangedListener` as ways to consume the new parser for a Razor document.
- Split the `VisualStudioRazorParser` into an abstract base and an implementation to avoid internal constructors.
- Changed the parser and corresponding smart indenter to take in document trackers, template engine factories and parser context change listeners. Of these additions the parser context change listeners will be deprecated once we own the TagHelper discovery mechanisms.
- Changed how the parser manages its internal parsing life cycle. It now creates template engines when the document tracker tells it to. So when project changes happen or new documents are opened the parser will re-instantiate its internal parser to ensure that it is parsing against the correct configurations.
- Removed all accessor services in favor of a singular RazorEditorFactoryService. This service is responsible for retrieving/creating various Razor components.
- Changed the code document provider to now use the parser provider in order to locate code documents associated with buffers. Prior to this that logic was hard coded.
- Removed old template engine reconstruction logic in the document tracker now that the parser owns that piece.
- Updated tracker to notify listeners when it's unsubscribing. This is how listeners can know when to tear bits down.
- Refactored/added pieces to the `DefaultVisualStudioRazorParser` in order to improve its unit/integration testing ability.
- Updated existing tests to react to new signatures.
- Added new visual studio razor parser tests, uncommented existing ones, and re-enforced ones that were previously flakey.
- Added various tests for the new services added, i.e. text buffer factory service tests.

#1630
2017-10-23 14:39:15 -07:00
Ryan Nowak b6d01fda46 Target 15.6 for the VSIX in dev 2017-10-20 14:10:18 -07:00
N. Taylor Mullen 88a950d436 Revert "Revert MonoAddin build steps."
This reverts commit 44519485fd.
2017-10-02 11:56:45 -07:00
N. Taylor Mullen 44519485fd Revert MonoAddin build steps. 2017-10-02 11:34:41 -07:00
N. Taylor Mullen 059264ba34 Fix RazorAddin project.
- Move assembly attributes to work with incremental compilation.
- Utilize Mono.Addins from nuget.org.
2017-09-29 17:46:51 -07:00
N. Taylor Mullen 3c73812f8a Revert "Revert "Add Microsoft.MonoDevelop.RazorAddin.""
This reverts commit fa0990fe00.
2017-09-29 17:17:44 -07:00
N. Taylor Mullen fa0990fe00 Revert "Add Microsoft.MonoDevelop.RazorAddin."
This reverts commit fca4f23895.
2017-09-29 17:08:17 -07:00
N. Taylor Mullen fca4f23895 Add Microsoft.MonoDevelop.RazorAddin.
- As part of this work I also added `Microsoft.VisualStudio.Mac.LanguageServices.Razor` to be the Visual Studio for Mac specific Razor code.
- Added MSBuild infrastructure to automate creation of MonoDevelop addins (MPacks). This work enables us to not have a dependency on a specific version of monodevelop and does not require us to have tool-prerequisites on the box. Every build outputs the mpacks into the artifacts/build directory.
- Built in build-level metadata pieces to workaround how addins are typically developed. They are usually authored C# first and then config files are generated after the fact; with this changeset we auto-generate the addin.info and its corresponding assembly attributes. Both of these take information directly from the build system.

#1696
2017-09-29 16:26:50 -07:00
N. Taylor Mullen 6c8286eed7 Split LanguageServices.Razor.
- Created a new `Microsoft.VisualStudio.Editor.Razor` assembly to contain Visual Studio platform agnostic info.
- Added a new `Microsoft.VisualStudio.Editor.Razor.Test.Common` project to be the centerfold for all VisualStudio agnostic test pieces.
- Added a `Microsoft.VisualStudio.Editor.Razor.Test` project and pulled in LanguageService test files into the the Editor.Razor.Test project to correspond to their movement in the src project.

#1690
2017-09-29 16:26:50 -07:00
N. Taylor Mullen edcf6857d1 Add x64 service hub json.
- Updated corresponding entries in manifest and csproj to reflect the new json addition.

#1705
2017-09-29 12:01:58 -07:00
Ryan Nowak 6e6a24cbb4 Add a background listener for notifications
This change adds an actual background worker for listening to project
change notifications and starts sending updates when the project's razor
dependencies change.

I had to do a litle surgery to get things working. There were plenty of
small bug fixes.

Additionally I got rid of the WeakReferences for tracking listeners. I
was seeing TextBuffers hanging around in VS longer than I expected and
the WeakReferences weren't getting cleaned up. I think it's better that
we just track the lifetime.
2017-09-18 16:56:53 -07:00
Ryan Nowak 00dc95098f Update our diagnostics window
Updates our diagnostics window to use the 'in the box' version of the
assembly/version discovery logic.
2017-09-06 15:37:06 -07:00
Ajay Bhargav Baaskaran 5cb11b9bf4 Implmement a project system for Razor 2017-08-30 12:58:38 -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
Nate McMaster 4094e8b8f3 Use PackageReference instead of project.json in the VSIX project (#1642) 2017-08-24 09:30:29 -07:00
Nate McMaster 4cadee2762 Use Directory.Build.props/targets (#1641) 2017-08-23 12:24:57 -07:00
Ajay Bhargav Baaskaran dbcac41be7 Get the correct version of Mvc for multitargeting 2017-08-07 12:55:37 -07:00
Ryan Nowak 5161ebaf8a Enables the Razor Document Tracker
This enables the tracking of events that change the 'razor' state of a
document that's open in the editor.

Also fixed a crash that can occur when creating a new project with the
Razor Info window open.
2017-08-07 12:36:13 -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
Ryan Brandenburg 643efbe660 Change version on Binding redirects 2017-07-24 14:50:30 -07:00
Mike Harder 01fe818dcd Update dependencies to match Visual Studio 15.3 (#1534) 2017-07-11 16:34:32 -07:00
Ryan Nowak 1d5dfcc6b4 Update our VSIX version to 15.5 2017-07-10 08:08:09 -07:00
Ryan Nowak 95c5049dd0 Add DisplayName and Description for directives
Renamed Name -> Directive so that it doesn't overlap with DisplayName.
2017-06-07 13:37:34 -07:00
Ryan Nowak fcb8669c98 Use project.json for the VSIX project
Also did some spring cleaning on redundent references in the language
services package.

Note that the 'immutable' packages are now totally redundant with
Shell.15.0. You're supposed to use one or the other. Since our minimum VS
is 15, I just went with shell 15.0.

Now the VSIX project doesn't have many references in it.
2017-06-03 17:27:35 -07:00
N. Taylor Mullen 5aababce6e Remove magic string keys from TH builders.
- Replaced the magic strings with extension methods that produce the same behavior as the string keys did.
- Added tests to validate new extension methods.

#1307
2017-05-19 11:15:38 -07:00
Ryan Nowak f96b22ffc3 Bump VSIX version up to 15.4.XXXXX 2017-05-17 13:38:32 -07:00
N. Taylor Mullen 577511945b Merge branch 'rel/15.3' into dev 2017-05-16 14:54:36 -07:00
N. Taylor Mullen a18b96cbf3 Suppress unneeded dlls from Razor VSIX
#1349
2017-05-16 14:53:25 -07:00
N. Taylor Mullen 01ec2202b2 Remove assembly name filter from THD API.
- This parameter was always passed `null` by tooling in the past.

#1279
2017-05-16 11:06:07 -07:00
Ryan Nowak b17e506ce8 Some API cleanup around directivest 2017-05-12 13:27:28 -07:00
Ryan Nowak 3969c23316 Adds a tracking system for Razor documents
This is a MEF service that can actively or passively track open ITextViews
and give us information about the Razor initialization state and eventing
when it changes.

The purpose of this is to act as a bridge between the VS mef world and the
roslyn world.

For now this doesn't do any passive tracking of Razor documents, it's only
on demand. That means it will only be initialized and used right now when
you are using the Razor developer tools. This is just to reduce our risk,
it's not ideal to ship code in VS that's doing something without anyone
looking at the result.
2017-05-11 08:24:37 -07:00
Ryan Nowak 8881d73598 Bump our VSIX version to 15.3.XXXXX 2017-04-26 10:06:31 -07:00
Ryan Nowak 27148c05f6 Update our Roslyn dependencies to 15.3 2017-04-24 18:59:06 -07:00
N. Taylor Mullen 1d10293db5 Revert "Uncap version max for vsix manifest."
This reverts commit ee1fd61e64.
2017-04-14 16:19:03 -07:00
N. Taylor Mullen ee1fd61e64 Uncap version max for vsix manifest. 2017-04-14 14:12:47 -07:00
N. Taylor Mullen 1b8a4e704c Rename ITagHelperDescriptorBuilder => TagHelperDescriptorBuilder.
#1210
2017-04-11 17:08:38 -07:00
N. Taylor Mullen 0618bae3bd Rename Microsoft.AspNetCore.Razor.Evolution => Microsoft.AspNetCore.Razor.Language.
- Also updated corresponding test project to go from Evolution => Language.
- Regenerated test files to reflect new file paths.

#1169
2017-04-10 10:20:04 -07:00
Pranav K 1bd31f42c0 Updating versions to 2.0.0-preview1 2017-04-03 22:31:17 -07:00
Pranav K ac176f8671 Revert package version changes
Fixes #1098
2017-04-03 15:46:46 -07:00
Pranav K 468c090272 Update vsix metadata 2017-03-31 14:37:50 -07:00
Ryan Brandenburg 9ffc745e76 Add Mvc.Razor.Extensions to VSIX 2017-03-24 11:45:04 -07:00
N. Taylor Mullen 8f9ff1abd9 Clean up TagHelperDescriptor APIs.
- Removed all design time descriptors and put their API surface into their corresponding descriptor. Part of removing the design time API surface was removing the tracking of `<Remarks>`, it wasn't used so there's on need to track it until we need it.
- Removed the Type requirement from `TagHelperDescriptor`. With this separation we'll be able to have abstract `TagHelper`s that aren't based on a class implementation.
- Removed Prefix from the `TagHelperDescriptor` API surface. It was a legacy requirement based on how the Razor parser was put together. We can work around this now.
- Stripped correlation information from the immediate `TagHelperDescriptor` API surface. Instead this information is now tracked in `TagMatchingRule`s. This change means that you will not have multiple `TagHelperDescriptor`s per `TagHelper`; instead it's all tracked in a single descriptor. A side effect of this change was the transformation of `IsIndexer` => 3 new properties.
- Renamed many descriptor types and property names.
- Added builder APIs to construct TagHelpers since they're inherently immutable in their API surface.
- Added `ITagHelperDescriptorBuilder` to represent `TagHelper`s that are built from an `ITagHelper` implementing class. It re-introduces the `TypeName` association of a `TagHelper`.
- Added `ITagHelperBoundAttributeDescriptorBuilder` to represent that an attribute was associated with a property.
- Added validation methods to the descriptor builders to enable consumers to validate the current state of the builder and add diagnostics as necessary.
- Moved descriptors away from RazorError.
- Updated the various comparers to understand the descriptors new API.
- Added a new `RazorDiagnosticFactory` abstraction to handle `RazorDiagnostic`s and their corresponding errors/ids etc. This new API should allow for easy addition of new `RazorDiagnostic` errors.
- Updated the `DefaultTagHelperDescriptorFactory` to construct `TagHelperDescriptor`s using the new builder APIs and in the new descriptor format (1 descriptor per type).
- Updated `ViewComponentTagHelperDescriptorFactory` to construct `TagHelperDescriptor`s with the builder API.
- With both factory implementations code was duplicated because the ViewComponent work will be moving outside of Razor once we have the proper hooks.
- Updated `TagHelper` binding bits to capture a binding result in order to query which rules appy to a given tag name.
Addressed feedback
- Update tests to react to new `TagHelperDescriptor` API.
- Remove case sensitive comparers and some cleanup
- Added TagHelperDescriptorJsonConverter, RazorDiagnosticJsonConverter and added serialization tests
2017-03-17 12:18:05 -07:00
Pranav K ff197e6fed Bump up version of the vsix
Add an icon to the vsix
Change minimum requirement of the vsix to VS RTM

Fixes #1064
Fixes #1056
2017-03-13 13:28:33 -07:00
Ryan Nowak 871f9e43ca Update versions of VS and Roslyn 2.0.0 dependencies
VS has gone RTM so, updating to the RTM versions of those dependencies.

Roslyn does not publish our shim packages on NuGet.org, so updating those
to a non-ancient version for projects that use 2.0.0. The projects that
use 1.3.x are staying put for now.

The code change is dealing with something that was obsoleted.
2017-03-08 08:57:49 -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
Ryan Nowak 04395b8bfa Update VSIX version 2017-02-23 15:53:10 -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