Commit Graph

6 Commits

Author SHA1 Message Date
N. Taylor Mullen b538ceba93 Change final code documents to not contain non-existent imports.
- Existent imports are imports that have content that contribute to the processing of a Razor document. Prior to this we had a legacy expectation that code documents had empty markers in them for all of their import locations. This proved troublesome when cross-referencing files that had file paths and were supposed to be existent but weren't in metadata. Now that we have a project engine with a de-coupled import feature we can rely on the import feature for finding all locations of important files and then strip out any non-existent items.
2018-02-23 16:30:22 -08:00
N. Taylor Mullen e200b69511 Change IImportProjectFeature to consume RazorProjectItems.
- Updated all implementations of `IImportProjectFeature`; for MVC I went ahead and made a single project item that's always returned for MVC scenarios. That project item is smart about returning its content in a light-weight stream fashion.
- Had to add a `RazorProjectItem` => `RazorSourceDocument` conversion mechanic into `DefaultRazorProjectEngine`.
- Added tests for `DefaultRazorProjectItem.ConvertToSourceDocument`.
- Removed the `ProjectEngine` API from `VisualStudioRazorParser`. This was unrelated but was missed feedback.

#2068
2018-02-15 11:31:18 -08:00
N. Taylor Mullen 3375fc8b99 Change RazorProjectEngine to operate on RazorProjectItems.
- Removed the `Process(string)` overload to make it extra clear that you must operate on project items. This way we also don't need to worry about the various formats of paths that can flow through the system.
- Updated tests to use the new project item format.
- Did a few formatting fixes on unrealted files.

#2049
2018-02-09 17:24:27 -08:00
N. Taylor Mullen aa3fb32220 Revert "Revert "Add contracts for RazorProjectEngine.""
This reverts commit f301d92332.
2018-01-24 11:20:18 -08:00
N. Taylor Mullen f301d92332 Revert "Add contracts for RazorProjectEngine."
This reverts commit 59f2cf8e66.
2018-01-23 11:42:38 -08:00
N. Taylor Mullen 59f2cf8e66 Add contracts for RazorProjectEngine.
- These contracts introduce a new `RazorProjectEngine` concept which allows for users to configure 1 entity that's responsible for the RazorEngine and project.
- The `RazorProjectEngineBuilder` has a collection of features that are dispersed on the created `RazorEngine` and the `RazorProjectEngine`.
- Included a complete implementation of `RazorProjectEngine` it introduces the extension points for the project engine. The primary one includes the `IRazorImportFeature`, the default behavior is to return 0 imports.
- Included a complete project engine builder implementation.

#1828
2018-01-22 17:05:43 -08:00