Skip to content

Commit

Permalink
Merge pull request #1774 from SirIntruder/UpdateProjectCompilationOpt…
Browse files Browse the repository at this point in the history
…ions

Fully update CompilationOptions when project files change.
  • Loading branch information
JoeRobich authored Apr 30, 2020
2 parents 83d3919 + b90e454 commit a9ea76f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/OmniSharp.MSBuild/ProjectManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ private void UpdateProject(string projectFilePath)
UpdateProjectProperties(project, projectFileInfo);

_workspace.TryPromoteMiscellaneousDocumentsToProject(project);
_workspace.UpdateDiagnosticOptionsForProject(project.Id, projectFileInfo.GetDiagnosticOptions());
_workspace.UpdateCompilationOptionsForProject(project.Id, projectFileInfo.CreateCompilationOptions());
}

private void UpdateAnalyzerReferences(Project project, ProjectFileInfo projectFileInfo)
Expand Down
5 changes: 5 additions & 0 deletions src/OmniSharp.Roslyn/OmniSharpWorkspace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ public void UpdateDiagnosticOptionsForProject(ProjectId projectId, ImmutableDict
OnCompilationOptionsChanged(projectId, project.CompilationOptions.WithSpecificDiagnosticOptions(rules));
}

public void UpdateCompilationOptionsForProject(ProjectId projectId, CompilationOptions options)
{
OnCompilationOptionsChanged(projectId, options);
}

private ProjectInfo CreateMiscFilesProject(string language)
{
string assemblyName = Guid.NewGuid().ToString("N");
Expand Down

0 comments on commit a9ea76f

Please sign in to comment.