Skip to content
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

Reload and update MSBuild projects in response to dotnet restore #1003

Merged
merged 11 commits into from
Nov 6, 2017

Commits on Nov 1, 2017

  1. Properly add/remove metadata references in MSBuild project system

    I recently noticed an issue that has likely been present for a long while. Essentially, metadata
    references are never removed from the workspace. The reason for this is because Roslyn's MetadataReference
    class does not implement value equality -- it just inherits the default `Equals()`/`GetHashCode()`
    implementations from `System.Object`. However, the algorithm for adding and removing metadata references
    assumes value equality. This is easily fixed by adding our own `IEqualityComparer<MetadataReference>`
    that first checks to ensure that `MetadataReferences` are `PortableExecutableMetadataReferences` and then
    uses their file paths for equality.
    DustinCampbell committed Nov 1, 2017
    Configuration menu
    Copy the full SHA
    17fa11d View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2017

  1. Refactor file watching/notification

    This change unifies file and directory watching, separates watching and notification concerns in the API,
    and fixes the following issues:
    
    1. Paths are treated case-insensitively as they are in the rest of OmniSharp.
    2. Access to the internal dictionary of callbacks is synchronized.
    DustinCampbell committed Nov 2, 2017
    Configuration menu
    Copy the full SHA
    797455a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a38a707 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2560f7a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    941d52e View commit details
    Browse the repository at this point in the history
  5. Introduce ProjectManager class to manage MSBuild project files

    This is a pretty substantial change that reworks the core logic of the MSBuild project
    system to enable an important scenario: updating a project when several files change in quick
    succession.
    
    In order to fix an issue with OmniSharp not reloading and updating a project in response to
    a 'dotnet restore', we must watch four files that might be touched during a restore:
    
    * project.asset.json
    * <project-file>.nuget.cache
    * <project-file>.nuget.g.props
    * <project-file>.nuget.g.targets
    
    To ensure that we don't reload and update a project multiple times in response to multiple file
    changes, this PR introduces a simple queue and processing loop using a TPL DataFlow BufferBlock.
    DustinCampbell committed Nov 2, 2017
    Configuration menu
    Copy the full SHA
    114148e View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2017

  1. Thread 'auto restore' through MSBuild project manager

    Previously, we tracked whether a project update *could* invoke an automatic
    'dotnet restore' and this PR adds that back. Essentially, we allow auto restore
    in all cases that a project is updated *except* when the update comes via a restore.
    DustinCampbell committed Nov 3, 2017
    Configuration menu
    Copy the full SHA
    18a8854 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e79151c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b4f8071 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2017

  1. Configuration menu
    Copy the full SHA
    7315995 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8befe87 View commit details
    Browse the repository at this point in the history