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

add output paths as one of causes to reanalyze solution cralwer. #31181

Merged
merged 1 commit into from
Nov 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions src/EditorFeatures/Test/SolutionCrawler/WorkCoordinatorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,42 @@ public async Task Project_AnalyzerOptions_Change()
}
}

[Fact]
public async Task Project_OutputFilePath_Change()
{
using (var workspace = new WorkCoordinatorWorkspace(SolutionCrawler))
{
var solutionInfo = GetInitialSolutionInfo_2Projects_10Documents(workspace);
workspace.OnSolutionAdded(solutionInfo);
await WaitWaiterAsync(workspace.ExportProvider);

var projectId = workspace.CurrentSolution.Projects.First(p => p.Name == "P1").Id;
var newSolution = workspace.CurrentSolution.WithProjectOutputFilePath(projectId, "/newPath");
var worker = await ExecuteOperation(workspace, w => w.ChangeProject(projectId, newSolution));

Assert.Equal(5, worker.SyntaxDocumentIds.Count);
Assert.Equal(5, worker.DocumentIds.Count);
}
}

[Fact]
public async Task Project_OutputRefFilePath_Change()
{
using (var workspace = new WorkCoordinatorWorkspace(SolutionCrawler))
{
var solutionInfo = GetInitialSolutionInfo_2Projects_10Documents(workspace);
workspace.OnSolutionAdded(solutionInfo);
await WaitWaiterAsync(workspace.ExportProvider);

var projectId = workspace.CurrentSolution.Projects.First(p => p.Name == "P1").Id;
var newSolution = workspace.CurrentSolution.WithProjectOutputRefFilePath(projectId, "/newPath");
var worker = await ExecuteOperation(workspace, w => w.ChangeProject(projectId, newSolution));

Assert.Equal(5, worker.SyntaxDocumentIds.Count);
Assert.Equal(5, worker.DocumentIds.Count);
}
}

[Fact]
public async Task Test_NeedsReanalysisOnOptionChanged()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,9 @@ private async Task EnqueueProjectConfigurationChangeWorkItemAsync(ProjectChanges
!object.Equals(oldProject.AssemblyName, newProject.AssemblyName) ||
!object.Equals(oldProject.Name, newProject.Name) ||
!object.Equals(oldProject.AnalyzerOptions, newProject.AnalyzerOptions) ||
!object.Equals(oldProject.DefaultNamespace, newProject.DefaultNamespace))
!object.Equals(oldProject.DefaultNamespace, newProject.DefaultNamespace) ||
!object.Equals(oldProject.OutputFilePath, newProject.OutputFilePath) ||
!object.Equals(oldProject.OutputRefFilePath, newProject.OutputRefFilePath))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may need to change this again if it turns out that we need to change OutputFilePath back to the obj path and add an additional property for the 'bin' path... cc @jasonmalinowski

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we write this differently somehow so we don't have to keep updating this list? :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure.

{
projectConfigurationChange = projectConfigurationChange.With(InvocationReasons.ProjectConfigurationChanged);
}
Expand Down