Commit Graph

30 Commits

Author SHA1 Message Date
N. Taylor Mullen 80f943caef 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-29 16:08:17 -08:00
N. Taylor Mullen f025a27f04 Unify how AdhocWorkspace is constructed.
- Created a new `TestWorkspace` type to lock on `AdhocWorkspace` construction. This type can't be constructed/changed in parallel.
- Updated test usages of `AdhocWorkspace` to make use of `TestWorkspace`.
- Added a `Microsoft.CodeAnalysis.Razor.Workspaces.Test.Common` project to have the `TestWorkspace` type.

#1913
2018-01-12 17:54:53 -08:00
N. Taylor Mullen 8d6b86c76a Add `RazorLanguage.CoreContentType`.
#1852
2018-01-09 14:59:01 -08:00
Ajay Bhargav Baaskaran 52a06e93bc Added test for DefaultRazorSyntaxFactsService 2017-12-29 17:02:35 -08:00
N. Taylor Mullen 66d244aafc Make unit test work on linux 2017-12-22 14:33:08 -08:00
N. Taylor Mullen d4994eb4a4 Added DefaultRazorIndentationFactsService unit tests.
- Already had a good variety of integration tests so refactored the service to properly unit test each piece.
- Found several pieces of unneeded code (wasn't being used) so removed it.
- Removed the `LocateOwner` logic that was embedded in the service. We already have an equivalent locate owner on our `SyntaxTreeNode` items.

#1698
2017-12-22 14:31:14 -08:00
N. Taylor Mullen 463e11b739 Make SyntaxTree mutations not leak.
- Prior to this when the partial parser would successfully parse a change we'd mutate the returned syntax tree so any data inquired about the tree would then be wrong. We now isolate mutations to copied versions of the syntax tree.
- Added copy tests to ensure that we were appropriately copying all the various syntax node types.

#1793
2017-12-18 11:50:07 -08:00
N. Taylor Mullen 4164821e4c Add VS agnostic non-OOP DefaultTagHelperResolver.
- Added tests for the VisualStudio.Editor tag helper resolver.

#1789
2017-12-14 11:28:30 -08:00
N. Taylor Mullen 1aff9d0031 Make RazorEditorFactoryService VS agnostic.
- Moved the editor factory service into the Editor dll. It did not have any windows specific functionality within it.

#1789
2017-12-13 17:11:48 -08:00
Ajay Bhargav Baaskaran 7654f73c54 Assert foreground thread before dispatching events 2017-12-12 16:18:49 -08:00
N. Taylor Mullen 4476a72ecf Refactor `ImportDocumentManager` to not be windows specific.
- Added a `FileChangeTracker`, `FileChangeTrackerFactory` and corresponding implementations. These types now enable us to implement Windows and Mac file change tracking instead of replacing the entire import manager.
- Changed the import manager to be a Roslyn based service.
- Moved import manager implementation to the editor.razor assembly now since it no longer depends on windows.
- Updated import manager unit tests.
- Added import manager integration test
- Added file change tracking tests.

#1804
2017-12-08 16:34:43 -08:00
N. Taylor Mullen 37eed518f8 Make VisualStudioRazorParserFactory VisualStudio agnostic.
- Removed the `Microsoft.VisualStudio.Language.IntelliSense` dependency from `Microsoft.VisualStudio.Editor.Razor` because it isn't supported in VS for mac.
- Replaced `ICompletionBroker` usage in the VS agnostic dll with a new abstract type `VisualStudioCompletionBroker`. This also enables us to implement completion
- Added Mac implementation of new `VisualStudioCompletionBroker`.

#1789
2017-12-08 16:34:43 -08:00
Ajay Bhargav Baaskaran f708c463d9 Export RazorDocumentManager using roslyn services 2017-12-07 15:50:30 -08:00
N. Taylor Mullen ba496bf1af Add a way for tooling to determine if a span corresponds to a TagHelper.
- This enables the editor to ask us if an HTML parent happens to be a TagHelper.

#1778
2017-12-06 11:49:20 -08:00
Ajay Bhargav Baaskaran 8abbaa46cc Added imports tracking to TagHelper project system
- #1744
2017-12-01 16:54:36 -08:00
N. Taylor Mullen 182714c324 Move away from WPF text view connection listener.
- Had to add a new NuGet feed to access latest VS bits.
- Updated tests to react to new ITextViewConnectionListener.

#1735
2017-11-28 10:42:35 -08:00
N. Taylor Mullen 345eb29c62 Update code doc provider to only rely on VSRazorParser.
- Prior to this change the code document provider took in many sub-providers to allow for understanding of the old RazorEditorParser AND VisualStudioRazorParser. Now that RazorEditorParser is gone we can also change the code doc provider.
2017-11-27 16:54:53 -08:00
Ajay Bhargav Baaskaran 0a76ad7017 Added TagHelper discovery to Razor project systen 2017-11-22 10:56:52 -08:00
Ajay Bhargav Baaskaran 90120f6a3b Added necessary infrastructure for Tag helper project system imports
tracking
2017-11-22 08:48:57 -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 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 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 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 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
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 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 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
N. Taylor Mullen 31c16af40b Add smart indentation for brace completion.
- Added a standalone brace smart indenter that listens to `ITextBuffer` changed events to determine when a brace completion event needs to be handled.
- Added methods to deal with getting document trackers from `ITextBuffer`s.
- Added a `BraceSmartIndenterTest` and `BraceSmartIndenterIntegrationTest` to verify all parts of the smart indenter.
- Moved private test infrastructure classes into their own files and expanded on their functionality to enable the brace completion smart indent scenarios.

#1538
2017-10-12 15:30:28 -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