-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Use InterceptorsNamespaces feature name instead of InterceptorsPreviewNamespaces #74865
Conversation
@@ -218,12 +218,14 @@ There is an experimental public API `GetInterceptorMethod(this SemanticModel, In | |||
|
|||
### User opt-in | |||
|
|||
To use interceptors, the user project must specify the property `<InterceptorsPreviewNamespaces>`. This is a list of namespaces which are allowed to contain interceptors. | |||
To use interceptors, the user project must specify the property `<InterceptorsNamespaces>`. This is a list of namespaces which are allowed to contain interceptors. |
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.
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.
In the issue there seemed to be agreement on the name InterceptorsNamespaces
, i.e. the namespaces which contain interceptors. So I prefer to keep this name.
It's expected that each entry in the `InterceptorsPreviewNamespaces` list roughly corresponds to one source generator. Well-behaved components are expected to not insert interceptors into namespaces they do not own. | ||
It's expected that each entry in the `InterceptorsNamespaces` list roughly corresponds to one source generator. Well-behaved components are expected to not insert interceptors into namespaces they do not own. | ||
|
||
For compatibility, the property `<InterceptorsPreviewNamespaces>` can be used as an alias for `<InterceptorsNamespaces>`. If both properties have non-empty values, they will be concatenated together in the order `$(InterceptorsNamespaces);$(InterceptorsPreviewNamespaces)` when passed to the compiler. |
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.
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.
I think that test GetInterceptorMethod_10
shows that we don't behave badly if the same namespace is included multiple times.
@jaredpar for review. Mainly I'm unsure about my assumption that compiler and build tasks will be in sync here. Is it possible for example that an older version of the build task would end up getting used to pass arguments to a newer compiler? |
Generally speaking no. The compiler and build task are always in sync. The one exception is if the build parameters |
@dotnet/roslyn-compiler for second review |
@@ -218,12 +218,14 @@ There is an experimental public API `GetInterceptorMethod(this SemanticModel, In | |||
|
|||
### User opt-in | |||
|
|||
To use interceptors, the user project must specify the property `<InterceptorsPreviewNamespaces>`. This is a list of namespaces which are allowed to contain interceptors. | |||
To use interceptors, the user project must specify the property `<InterceptorsNamespaces>`. This is a list of namespaces which are allowed to contain interceptors. |
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.
Nit: it feels a bit inconsistent that the "Interceptors" part is plural, I would expect this to be named like InterceptorNamespaces
.
Closes #74511
Here I am making an assumption that the build tasks and the associated compiler will be in sync. If that assumption is wrong, then this handling will probably have to be pushed into the command line layer (i.e. concat'ing
/features:InterceptorsNamespaces=...
and/features:InterceptorsPreviewNamespaces=...
.