-
Notifications
You must be signed in to change notification settings - Fork 199
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
Clean up public surface area #9076
Clean up public surface area #9076
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
} | ||
|
||
public EditorSettings Settings { get; } | ||
public EditorSettings Settings { get; } = settings ?? throw new ArgumentNullException(nameof(settings)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for this PR, but given we can now categorically say we have no public API, and we're (mostly) nullable enabled, is there any valid reason for keeping all of our argument validation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only reason that gives me pause is that it's a potentially disruptive change. I've seen a fair amount of test code passing null
where it shouldn't.
Aside: @ryzngard, this is a potential reason in favor of enabling nullability in tests -- to spot these concerns quickly.
} | ||
|
||
public override string ExtensionName { get; } | ||
public override string ExtensionName { get; } = extensionName ?? throw new ArgumentNullException(nameof(extensionName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓does this still throw on initialization? primary constructors are weird
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll get used to them. 😄 I tried not to change any existing behavior in this PR, but I did employ primary constructors in a few places to remove boilerplate.
Now that the legacy editor shim is in place, we can go ahead and clean up our public surface area and mark types as internal. In addition, there are several files in
MS.VS.Editor.Razor
that are no longer used by Web Tools and can be safely deleted.I've enabled the public API analyzers for most of the tooling projects to ensure that we don't unintentionally add public surface area. I'm a little concerned about the
MS.VS.LiveShare.Razor
project (because I'm not sure how to validate it!), but I marked types that looked safe as internal.Please let me know if I've missed something!
Note: This fails integration tests because the machines need to be updated in order for tests to pass. The test machines have a version of Web Tools that is still using public types from
MS.VS.Editor.Razor
.