Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legacy editor shim layer #8941

Merged
merged 15 commits into from
Jul 14, 2023
Merged

Conversation

DustinCampbell
Copy link
Member

@DustinCampbell DustinCampbell commented Jul 11, 2023

This change adds a shim layer for the Razor legacy editor to insulate the legacy editor from upcoming structural and API changes.

The approach taken here is to expose new internal types to the legacy editor via an "external access" assembly. Those internal types wrap existing Razor types without exposing them. Most of the "magical code" is in RazorWrapperFactory.cs. Care has been taken to avoid exposing any of the dependencies of that assembly so that the legacy editor doesn't transitively reference the compiler or tooling layers.

Next steps:

  • Once this is merged, we can follow up with a change in Web Tools (already prepared) to use the new shim. Until that change is made, the legacy editor will continue to work against the existing Razor types.
  • Add more tests for the shim layer to build confidence when we refactor the compiler.
  • Further work could be done to simplify the contract with the legacy editor. In its current state, the shim really just wraps objects that the legacy editor uses. The legacy editor uses those wrapper objects directly to build completion lists, classify tokens, etc. However, with further refactoring of Web Tools we could provide a higher level shim API. It's not clear if that'll be needed.

@DustinCampbell DustinCampbell requested review from a team as code owners July 11, 2023 18:58
@jaredpar jaredpar added the area-compiler Umbrella for all compiler issues label Jul 11, 2023
Copy link
Member

@333fred 333fred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looking good. A few questions/suggestions.

DustinCampbell and others added 2 commits July 12, 2023 13:47
…Editor/RazorSourceSpan.cs


Fix whitespace

Co-authored-by: Fred Silberberg <fred@silberberg.xyz>
@jaredpar jaredpar modified the milestones: 17.8 P1, 17.8 Planning Jul 12, 2023
@DustinCampbell
Copy link
Member Author

@333fred: I believe I've addressed all of your feedback. Let me know if you have any other concerns. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-compiler Umbrella for all compiler issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants