Skip to content
This repository was archived by the owner on Jun 30, 2023. It is now read-only.

Conversation

@kzu
Copy link
Member

@kzu kzu commented Jul 2, 2017

Adds analyzer and codefix to detect ProxyGenerator-annotated method invocations
and generates and adds a proxy for them in the IDE via a codefix.

This required a minor refactoring of the proxy generation we had, pretty much
everything is reused as-is.

Created a separate Proxy.Sdk that contains the document visiting/generation
interfaces so that third parties can extend this process via MEF in the IDE
natively, or via the existing MSBuild-based mechanism for the compile-time
generation and discovery.

kzu added 17 commits July 2, 2017 12:09
Adds analyzer and codefix to detect ProxyGenerator-annotated method invocations
and generates and adds a proxy for them in the IDE via a codefix.

This required a minor refactoring of the proxy generation we had, pretty much
everything is reused as-is.

Created a separate Proxy.Sdk that contains the document visiting/generation
interfaces so that third parties can extend this process via MEF in the IDE
natively, or via the existing MSBuild-based mechanism for the compile-time
generation and discovery.
This makes the code a bit cleaner and easier to follow
By switching to None cancellation token, we make it easier to debug and
pause for longer times while inspecting the code generation from within
the IDE, that would otherwise be canceled automatically by VS.
This ensures that P2P nuget references get the right dependency versions
Ultimately applying the changes in the doc should be a responsibility of the
caller that's transforming the doc. In a codefix (IDE-based generation of the
proxy), this method is called to display a preview of the changes, so we most
certainly don't want to force it to apply to the current workspace (the opened
solution!) before the user actually commits the changes. VS handles that for
us automatically.

Also, since the IProxy interface is added at the Rewrite phase after the other
types have been visited, it's not necessary to skip applying code fixes for it
since there will never be any.
The preview now works with project references and in VB too.
No need for the overhead of compile-time generated ones.
This is super useful when the Returns invocation itself modifies
parameters or state, so the callback can use those.
Simplified formatting and whitespacing.
… name

The only way to now generate proxies that do not contain the additional
interface names in the proxy name is by using the MEF document visitors.

This simplifies the code and makes it easier to reuse from the code fixes.
The <CompilerGenerated> attribute was not properly separated from
the namespace declaration.
@kzu kzu merged commit 1fbca72 into master Jul 8, 2017
@kzu kzu deleted the analyzed branch July 8, 2017 06:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants