Skip to content

Conversation

@lambdageek
Copy link
Member

Instead of using reflection to call deep into the Roslyn EnC feature, instead call the high-level WatchHotReloadService.

Still need to use reflection because the class is internal, but the service encapsulates most of the complicated details, so we don't have to. As a result delete a lot of dead code.

A nice benefit is that the roslyn debug information is properly initialized:

https://github.com/dotnet/roslyn/blob/fd67237da22ead61eba09734375d6dea791b0db8/src/Features/Core/Portable/EditAndContinue/DebuggingSession.cs#L403-L407

As a result, roslyn can generate EnCLogs for functions that contain lambdas that preserve the identity of the lambda instead of emitting new fields and methods for the closure.


Unrelated bugfix the frontend programs weren't returning the exit code. Now they do. So if the library returns with a non-zero exit code we actually exit with that exit code.


Bump version to 1.0.2 - this change is worth it.

@lambdageek lambdageek force-pushed the using-watch-service branch from e45f8d8 to be5df5d Compare July 29, 2021 13:05
lambdageek and others added 13 commits July 29, 2021 09:11
Wrapping WatchHotReloadService from the roslyn API.

Because the API is an internal class, we have to invoke it using reflection.
We also have to wrap its result Update struct.
There is a lot of dead code from the old API now;
also some of the runner code doesn't make a lot of sense anymore

also two broken things:
1. We always pass Baseline capabilities to the service
2. consecutive DeltaProjects probably don't work because the old code
   wanted access to a new EmitBaseline which is encapsulated in
   the service now.
otherwise we always exit successfully even if there was a DiffyException
Otherwise for some reason WatchHotReloadService refuses to apply
updates to it and doesn't give any diagnostics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant