dotnet / project-system

The .NET Project System for Visual Studio
MIT License
971 stars 388 forks source link

Move content file watching from Roslyn to Project System #5457

Open tmat opened 5 years ago

tmat commented 5 years ago

The Project System is responsible for tracking all outputs of a (design-time) build, which includes the content of the files generated by various targets to obj directory that are part of the compilation.

In a cloud environment Roslyn services might run on a different machine than DTB and thus can't watch for file changes made during DTB. We need the Project System to notify Roslyn of all DTB outputs that affect the compilation.

Note that this also affects fully local scenarios, such as Edit and Continue in WPF projects. Currently the Roslyn file watchers detect changes made by WPF single file generators during build after the debugging session have started. See https://dev.azure.com/devdiv/DevDiv/_workitems/edit/970821

tmat commented 5 years ago

/cc @tmeschter

davkean commented 5 years ago

How are normal source files affected by this? I would have thought the Roslyn server would be watching these files alongside the DTB.

tmat commented 5 years ago

Roslyn service won't be watching any files. Roslyn services operate on a solution snapshot.

The snapshot should be provided by a service that combines source files from git repo, source files updated by any client operating on the repository instance but not committed to the git repo yet, and the build output (generated files).

We don't have such service yet but regardless, there will need to be a mechanism on the build server that detects what files were generated by a build run for a particular repo snapshot and makes these files available to the above service.

tmeschter commented 5 years ago

@tmat Can you be more specific about what files you need to be notified about?

tmat commented 5 years ago

All source files that are generated during DTB (or by single file generators) that are included to the compilation.