Commit Graph

1393 Commits

Author SHA1 Message Date
Nate McMaster 13824c418e Catch 15.7 up with dev
This change integrates most of the non-breaking work that we did in 2.1
including the updates to make Razor less coupled to MVC.
2018-02-19 10:46:16 -08:00
Ryan Nowak c1b96eaabc Update KoreBuild
This branch roughly tracks our preview2 stuff for now
2018-02-19 10:45:33 -08:00
Ryan Nowak f13577ca95 Update KoreBuild
This branch roughly tracks our preview2 stuff for now
2018-02-06 18:44:28 -08:00
Ryan Nowak 870f023aa9 Add prelimianry support for extensions to Razor (#2012)
* Add prelimianry support for extensions to Razor

This PR adds MSBuild insfrastructure to the SDK that can understand
concepts we need to expose to the project, code generator and runtime
like:
- Language version
- Configuration
- Extensions (plugins)

As an example of how this works, I've done the wireup for MVC. This will
now generate assembly attributes in your application that can act as a
source-of-truth for what should be included in runtime compilation, and
it's all based on the project-file. This means that it can be delivered
and configured by packages.

The next step here is to implement a loader for RazorProjectEngine based
on these primitives, and then use it in our CLI tools and MVC.

The next step after that is to expose it in VS and VS4Mac through the
project system.

(cherry picked from commit 5b28c06d64)
2018-02-03 20:13:24 -08:00
Ryan Nowak eb5abc6ac5 Add CPS dependencies
Getting this in to avoid pain when rebasing/merging.
2018-02-02 13:16:24 -08:00
N. Taylor Mullen a01fa1c5b6 Flow RazorLanguageVersion to RazorEngine.
- Restructured RazorLanguageVersion to be a sealed concrete type to enable things like `RazorLanguageVersion.Latest`; it also allows us to make broader changes in the future. Also, in the future if we want to add support for overriding operators to enable greater than comparisons we can as well.
- Removed version validity checks because we restrict who can construct a `RazorLanguageVersion` now. This way we don't have to check for valid versions all throughout our code.
- Added a simple `ProjectExtensibilityConfiguration` => `RazorLanguageVersion` method in the `DefaultProjectExtensibilityConfigurationFactory` to temporarily enable letting the system operate on the `RazorLanguageVersion`. Eventually that entire class will change.

#1961
2018-01-25 09:17:37 -08:00
N. Taylor Mullen af12a455ff Update RazorExtensions VSIX version to 15.7. 2018-01-23 12:08:15 -08:00
N. Taylor Mullen 92111ea515 Make Block and Span cache Length.
- Part of caching length required the `Span`'s `ReplaceWith` method to propagate its changes to its parent so that it can propogate the change to invalidate all parent length caches.
- Added Span and Block tests to validate the interaction of caching.

#1927
2018-01-16 20:53:35 -08:00
N. Taylor Mullen 5e0e09ac06 Remove MPack assets. 2018-01-16 20:19:11 -08:00
Nate McMaster 141b0b4763 Upgrade to build tools 2.1.0-preview1-15651 2018-01-16 20:19:11 -08:00
Nate McMaster 23e3a872af Update build tools to 2.1.0-preview1-15670 and update list of exclusions for Razor.Design 2018-01-16 20:19:11 -08:00
ASP.NET CI e35bc1176c Update dependencies.props
[auto-updated: dependencies]
2018-01-16 20:19:11 -08:00
ASP.NET CI 03ef44aa1d Update dependencies.props
[auto-updated: dependencies]
2018-01-16 20:19:11 -08:00
Nate McMaster c88f7be1ab Include the VSIX and MPack files in the bill of materials 2018-01-16 20:19:11 -08:00
ASP.NET CI f578819c6e Update dependencies.props 2018-01-16 20:19:11 -08:00
ASP.NET CI 3413c74c2d Update dependencies.props
[auto-updated: dependencies]
2018-01-16 20:19:11 -08:00
Pranav K ec4e127a70 Use MicrosoftNETCoreApp21PackageVersion to determine the runtime framework in netcoreapp2.1 2018-01-16 20:19:11 -08:00
Ryan Brandenburg 9edbf87f31 Remove unneeded exclusion 2018-01-16 20:19:11 -08:00
Ryan Brandenburg 4b81c9261b Update bootstrappers 2018-01-16 20:19:11 -08:00
Pranav K a5ddd2baf1 Specify runtime versions to install 2018-01-16 20:19:11 -08:00
Pranav K 50fa43d35b Replace aspnetcore-ci-dev feed with aspnetcore-dev 2018-01-16 20:19:11 -08:00
Nate McMaster 89243f8bb8 Use MSBuild to set NuGet feeds instead of NuGet.config 2018-01-16 20:19:11 -08:00
N. Taylor Mullen 4af7a47aac Change code document provider to work in old Razor.
- Prior to this the old code document provider would utilize the editor factory service which would incorrectly create a parser for older Razor documents. This was wrong on many levels.
- Updated tests to react to new expectations.
2017-11-20 02:26:14 -08:00
N. Taylor Mullen 4f7aab7720 Prevent Razor Core from running in non-core scenarios.
- Also added tests.

#1776
2017-11-16 16:23:24 -08:00
N. Taylor Mullen fa2d79296a Merge branch 'dev' into rel/vs15.6 2017-11-15 16:55:09 -08:00
Ajay Bhargav Baaskaran 9a2e3ceab6 Added public api changes for TagHelper project system 2017-11-15 15:52:02 -08:00
N. Taylor Mullen 6cf78ceb1b Move TagHelperCompletionService to VS.Editor.Razor and export it.
- Moved service poco types: `AttributeCompletionContext`, `AttributeCompletionResult`, `ElementCompletionContext` and `ElementCompletionResult`.
- Exported DefaultTagHelperCompletionService.

#1762
2017-11-15 13:01:06 -08:00
N. Taylor Mullen 458111ad03 Move TagHelperFactsService and export it.
- Created a `TagHelperFactsServiceInternal` and export its public counterpart in `Microsoft.VisualStudio.Editor.Razor`.
- Updated tests to react to new naming.

#1762
2017-11-15 13:01:06 -08:00
N. Taylor Mullen 520876e55d Re-add some Legacy ITagHelperResolver infrastructure.
- This is required until the TagHelperProjectSystem is completed.
2017-11-14 16:49:35 -08:00
N. Taylor Mullen 44b4bf6bc6 Cleanup legacy and unintentionally public bits.
- Made `RazorTemplateEngineFactoryService`, `TagHelperResolver`, `RazorDiagnosticJsonConverter` and `RazorLanguageServiceException` internal.
- Deleted all items in the Legacy folder in VisualStudio.LanguageServices.Razor and `RazorLanguageServiceException`.

#1762
2017-11-14 15:42:40 -08:00
N. Taylor Mullen 44e5874029 Move RazorSyntaxFactsService to VS.Editor.Razor and export it.
- Moved service poco types: `AcceptedCharacters`, `BlockKind`, `ClassifiedSpan`, `SpanKind` and `TagHelperSpan` into VS.Editor.Razor.

#1762
2017-11-14 15:42:40 -08:00
N. Taylor Mullen de23788019 Move indentation service to VS.Editor.Razor and export it.
- Removed indentation service extensions and made `GetDesiredIndentation` understand `ITextSnapshot`s and `ITextLineSnapshot`.
- Updated our test `StringTextSnapshot` implementation to have the required features our indentation tests require.
- Updated indentation service tests to use new API.

#1762
2017-11-14 15:42:40 -08:00
N. Taylor Mullen 44a47182b2 Add EditorSettingsManager as an exported MEF component.
- Internalized the core implementation of `EditorSettingsManagerInternal`.
- Added a `VisualStudioWorkspaceAccessor` to enable the `Microsoft.VisualStudio.Editor.Razor` project to have access to the current workspace. Only added the Windows specific implementation of this type since the VS for mac implementation will require infrastructural work to make happen.

#1762
2017-11-14 15:42:40 -08:00
Pranav K 82247fbb09 Update samples and tests to target netcoreapp2.1 2017-11-14 09:45:28 -08:00
Pranav K c61e9b3e84 Preparing to update to 2.2 SDK 2017-11-09 16:45:26 -08:00
Nate McMaster 809dedd40c Preserve DotNetPackageVersionPropsPath when restoring with msbuild.exe 2017-11-08 10:17:50 -08:00
N. Taylor Mullen 80fdad0551 Revert "Only use release VS."
This reverts commit 834fd5a5d0.
2017-11-08 09:35:47 -08:00
N. Taylor Mullen 801ad07560 Add TextBuffer snapshot restriction back to VisualStudioRazorParser. 2017-11-07 10:50:06 -08:00
N. Taylor Mullen 399dcca4f2 Make Foreground dispatchable methods noop if parser is disposed.
- Added tests to validate each of the new noopable methods.

#1750
2017-11-06 16:18:43 -08:00
N. Taylor Mullen 834fd5a5d0 Only use release VS. 2017-11-06 15:06:06 -08:00
N. Taylor Mullen a2972ebf1c Dispatch DocumentStructureChanged event on foreground thread.
- Had to add extra logic to track document structure changes so listeners could know if an event was on its way or not.
- Added and fixed some tests.

#1748
2017-11-06 14:49:18 -08:00
Ajay Bhargav Baaskaran 7002dbf20a Added Name and Documentation to DirectiveTokenDescriptor 2017-11-06 10:55:52 -08:00
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
Nate McMaster 6c7551d9c7 Require the Microsoft.VisualStudio.Component.VSSDK workload to be installed 2017-10-30 08:59:20 -07:00
N. Taylor Mullen ab62ea9321 React to API feedback on VisualStudioRazorParser.
- Changed `ReparseAsync` to be `QueueReparse`. It's now async void to not give the misconception that it blocks until a reparse has been completed.
- Removed `IContextChangedListener`. People can get the same effect of the interface by retrieving the document tracker interface via the `RazorEditorFactoryService` and then when its context changes getting the parser.
- Exposed `TryGetParser` to aid in replacing `IContextChangedListener`.
- Updated tests to not rely on `IContextChangedListener`.
2017-10-25 10:28:01 -07:00
N. Taylor Mullen d027697389 Merge branch 'rel/vs15.5' into dev 2017-10-25 09:45:28 -07:00
N. Taylor Mullen 6ac0137a9f Make AtDirectiveCompletionPoint resilient to null owners.
- Added a test to verify the new owner == null case.

#1733
2017-10-25 09:44:33 -07:00
N. Taylor Mullen fb8aff12f1 Add EditorSettings management to workspaces.
- Built a design where there's a singleton `EditorSettingsManager` that handles the "current" settings state in the world. When it detects that settings have changed via an update method being called it dispatches a `Changed` event.
- Exposed editor settings on the document tracker. When the editor settings change the document tracker dispatches to any listeners that its context has changed.
- Added tests to validate all the various settings management.

#1718
2017-10-24 10:42:49 -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
Sergei Dorogin a0733ffa91 RazorPageGenerator: extracted creating RazorEngine into a method [refactoring] (#1727)
* RazorPageGenerator: extracted creating RazorEngine into a method to simplify reusing logic in custom generators

RazorPageGenerator: added optional cli argument with base directory  (previously current dir always was used)
2017-10-23 12:44:29 -07:00