Commit Graph

1426 Commits

Author SHA1 Message Date
Ajay Bhargav Baaskaran bace4a3818 Revert "Include LineIndex and CharacterIndex when comparing SourceLocation"
This reverts commit 0e20ea5178.
2017-12-19 18:04:18 -08:00
Ajay Bhargav Baaskaran 0e20ea5178 Include LineIndex and CharacterIndex when comparing SourceLocation 2017-12-19 15:59:45 -08:00
Ajay Bhargav Baaskaran 808f539297 Moved CSharpCodeParser out of LegacyRazorDiagnostic 2017-12-19 15:59:37 -08:00
N. Taylor Mullen 926dae0d88 Move DefaultTagHelperTargetExtension errors to use RazorDiagnosticFactory.
- Added tests validating these errors because we didn't have any before.

#1827
2017-12-19 15:28:24 -08:00
Ryan Nowak b900a82bc3 Refocus Razor runtime assemblies
Microsoft.AspNetCore.Razor becomes the home for TagHelper-related types
that you use in your code.

Microsoft.AspNetCore.Razor.Runtime becomes the home type types you need
to build a view engine. User code should not need this package anymore.

None of these are breaking changes due to typeforwards.
2017-12-19 13:26:07 -08:00
N. Taylor Mullen 4b93741610 Add Mac project build change trigger.
- Added a Mac specific implementation of the project build change trigger. It applies to all types of project builds so we need to do a little extra filtering to ensure that we're not operating on a non-ASP.NET Core project.
- Added tests to validate that the project build event fires correctly.

#1851
2017-12-18 17:23:43 -08:00
Ryan Nowak 06c2cf31d4 Hardcode Debug in test 2017-12-18 14:15:30 -08:00
Ryan Nowak 5425c69df6 Use path.combine instead 2017-12-18 13:28:14 -08:00
Ryan Nowak a3fef5eeaa Adds support for Razor compilation at build-time
This PR adds two new tools as well as a tasks project. None of these
projects produce a package and they ship as part of
Microsoft.AspNetCore.Razor.Design. For now this is a 'fat' package that
contains all of the dependencies, but we plan to strip them out in the
future.

The support for compilation at build-time will start as **off** by
default. The immediate goal here is to get this to flow through the
build so that we can test it as part of the inner loop effort. We will
enable this feature by default once we've done more thorough testing.

Since this is mostly a code dump, I plan to address blocking and minor
feedback only. If there are design issues that are non-critical, I will
open follow up items.

The next step will be to start adding more detailed tests.
2017-12-18 13:01:14 -08:00
Ajay Bhargav Baaskaran 18ce7f07ac Moved CSharpTokenizer errors out of legacy diagnostic 2017-12-18 11:51:08 -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
Ryan Nowak c0eecc87e7 Add tools and tasks for Razor MSBuild support 2017-12-18 11:19:24 -08:00
Ajay Bhargav Baaskaran 05e1271b3c Goodbye Slim :( 2017-12-18 11:12:07 -08:00
Ajay Bhargav Baaskaran 8fcb046345 Moved the test infrastructure to depend on RazorDiagnostic instead of RazorError 2017-12-15 17:22:00 -08:00
N. Taylor Mullen 7234850c9a Update MonoDevelop.Sdk to 1.0.1.
- The update includes properly signed binaries so they can be used in tests.
2017-12-15 16:20:18 -08:00
Ajay Bhargav Baaskaran 085838e83a Make ErrorSink and Tokenizer depend on RazorDiagnostic instead of RazorError 2017-12-14 18:32:58 -08:00
Ajay Bhargav Baaskaran 6bbd063e26 Use DefaultRazorDiagnostic in DefaultDirectiveSyntaxTreePass 2017-12-14 16:35:13 -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
N. Taylor Mullen f7636fdfc0 Add TextBufferProjectService Mac implementation.
- Was unable to test the text buffer project service class due to signing issues with the MonoDevelop.Sdk dependency.

#1789
2017-12-13 15:46:52 -08:00
Ryan Nowak 1962989ffc Implement a .Design package and some testing for MSBuild
This is the first step in adding support for Razor compilation at build
time. Additional steps will complete this by adding tag helper
discovery, code generation and finally a call to CsC.

I want to get this in now to get the package into the build system and
to lay down the general infrastructure for testing.

---

The strategy for testing here is to use checked in projects that have
everything Razor needs to compile code. We already have shims for the
APIs Razor uses by default in this repo and I'm using them in the
project.

The test infrastructure creates a temporary directory, copies the
project, and fixes up a few small things to cooperate with outputs we've
already built so that the test can use the new versions of Razor bits
built from this repo.

We can then call various MSBuild targets and verify the files on disk. I
envision tests that verify incrementalism as well as the basic E2E.

We will test the E2E in general in other places, since it's part of the
new default experience. This repo will test things at a higher level of
detail, but in slightly artifical scenarios.
2017-12-13 15:06:10 -08:00
ASP.NET CI 1c9c05b64d Update dependencies.props
[auto-updated: dependencies]
2017-12-13 21:33:19 +00:00
N. Taylor Mullen 1e1630068f Make DefaultTagHelperResolver use the correct GetTagHelpersAsync.
- Prior to this we weren't overriding the `GetTagHelpersAsync` method resulting in our TagHelper discovery being executed in-process.
- Removed legacy `ITagHelperResolver` legacy types.
2017-12-12 16:26:55 -08:00
Ajay Bhargav Baaskaran 7654f73c54 Assert foreground thread before dispatching events 2017-12-12 16:18:49 -08:00
N. Taylor Mullen b73c50be41 Add Mac implementation of FileChangeTracker.
- Added a LanguageServices Mac test project.
- Added a few tests for the new `DefaultFileChangeTracker`. There's currently an issue with the MonoDevelop.Core binaries we're compiling against which doesn't allow me to unit test other pieces of the class (they depend on instantiating mono develop objects).
- Added IVT from product projects to new mac testing project.

#1789
2017-12-12 15:47:16 -08:00
Ajay Bhargav Baaskaran f208b27bd7 Moved TextBufferProjectService from Mef to ILanguageService 2017-12-11 18:06:11 -08:00
Ajay Bhargav Baaskaran 6b8223b544 Moved RazorTextBufferProvider from Mef to ILanguageService 2017-12-11 17:08:54 -08:00
Ajay Bhargav Baaskaran fb68a31ad5 Moved RazorCodeDocumentProvider from Mef to ILanguageService 2017-12-11 16:11:49 -08:00
ASP.NET CI 3ee6426503 Update dependencies.props
[auto-updated: dependencies]
2017-12-10 13:37:33 -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 65cdddf5d9 Make DefaultVisualStudioDocumentTrackerFactory VS agnostic.
- Moved `DefaultVisualStudioDocumentTrackerFactory` from language services Razor to editor Razor.

#1789
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 7cd1b6a5d0 Make BraceSmartIndenterFactory VisualStudio agnostic.
- Moved the `BraceSmartIndenterFactory` into the `Microsoft.VisualStudio.Editor.Razor` assembly so it can be used on Windows and Mac.
- Changed how the factory is exported since its only used internally. It now uses Roslyn services in the context of a Razor language service to be consistent with how the rest of Razor works.

#1789
2017-12-07 09:58:05 -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 6be80e7bed Use windows VS error reporter instead of the no-op default 2017-12-05 13:02:37 -08:00
N. Taylor Mullen 7ec0e9fb23 Make GenerateMPack target more resilient. 2017-12-05 11:59:42 -08:00
N. Taylor Mullen a0f4101453 Add Mac implementation of ErrorReporter.
- Moved the existing error reporter factory temporarily into the windows specific language service assembly so it did not conflict with the Mac specific implementation. The Windows VS API will be exposed later via https://github.com/aspnet/Razor/issues/1795.
- Updated the error reporter factory to specify service layers so the VS for mac implementation took priority.

#1789
2017-12-05 11:51:25 -08:00
N. Taylor Mullen bc8b2c86fd Add Mac implementation of VisualStudioForegroundDispatcher.
#1789
2017-12-05 10:11:14 -08:00
N. Taylor Mullen f67670927f Add Mac implementation of VisualStudioWorkspaceAccessor.
#1789
2017-12-05 10:01:51 -08:00
N. Taylor Mullen cd1d57f97b Add MonoDevelop.Core and MonoDevelop.Ide addin dependencies.
- Added the runtime package dependency to allow for proper assembly building.
- Added a new external package source for the MonoDevelop.Sdk.
- Had to change the MPack version to be compliant with VS for mac versioning support.

#1789
2017-12-04 17:35:54 -08:00
Ryan Brandenburg 3da41ae4bb Remove unneeded exclusion 2017-12-04 12:49:33 -08:00
Ajay Bhargav Baaskaran 8abbaa46cc Added imports tracking to TagHelper project system
- #1744
2017-12-01 16:54:36 -08:00
Ryan Brandenburg 99cb120571 Update bootstrappers 2017-12-01 12:29:02 -08:00
N. Taylor Mullen b6fb9bda50 Remove flaky, already tested test.
- This test was flaky due to the nature of what it was testing and had negative value due to the testing complexities. In the integration test pieces (running VS) this is already tested thoroughly.
2017-11-30 10:41:26 -08:00
Pranav K ee3bc17559 Specify runtime versions to install 2017-11-29 14:09:29 -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 df1d0bbcd4 Change text buffer code document provider to follow our public API MEF rules. 2017-11-27 17:28:18 -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