Skip to content

Commit

Permalink
Remove unused version parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
drewnoakes committed Nov 28, 2024
1 parent 42b741a commit c6e60ad
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal class DynamicItemHandler(UnconfiguredProject project) : IWorkspaceUpdat

private readonly HashSet<string> _paths = new(StringComparers.Paths);

public void Handle(IWorkspaceProjectContext context, IComparable version, IImmutableDictionary<string, IProjectChangeDescription> projectChanges, ContextState state, IManagedProjectDiagnosticOutputService logger)
public void Handle(IWorkspaceProjectContext context, IImmutableDictionary<string, IProjectChangeDescription> projectChanges, ContextState state, IManagedProjectDiagnosticOutputService logger)
{
foreach ((_, IProjectChangeDescription projectChange) in projectChanges)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ internal interface ISourceItemsHandler : IWorkspaceUpdateHandler
/// <param name="context">
/// The <see cref="IWorkspaceProjectContext"/> to update.
/// </param>
/// <param name="version">
/// An <see cref="IComparable"/> representing the <see cref="ConfiguredProject.ProjectVersion"/> at
/// the time the <see cref="IProjectChangeDescription"/> was produced.
/// </param>
/// <param name="projectChanges">
/// A dictionary of <see cref="IProjectChangeDescription"/> representing the set of
/// changes made to the project, keyed by their item type.
Expand All @@ -31,6 +27,6 @@ internal interface ISourceItemsHandler : IWorkspaceUpdateHandler
/// <param name="logger">
/// The <see cref="IManagedProjectDiagnosticOutputService"/> for logging to the log.
/// </param>
void Handle(IWorkspaceProjectContext context, IComparable version, IImmutableDictionary<string, IProjectChangeDescription> projectChanges, ContextState state, IManagedProjectDiagnosticOutputService logger);
void Handle(IWorkspaceProjectContext context, IImmutableDictionary<string, IProjectChangeDescription> projectChanges, ContextState state, IManagedProjectDiagnosticOutputService logger);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,6 @@ void ApplyProjectEvaluation(
ContextState contextState,
CancellationToken cancellationToken)
{
IComparable version = GetConfiguredProjectVersion(update);

ProcessProjectEvaluationHandlers();

ProcessSourceItemsHandlers();
Expand All @@ -339,6 +337,8 @@ void ProcessProjectEvaluationHandlers()
// for example from Debug to Release.
ConfiguredProject configuredProject = update.Value.ConfiguredProject;

IComparable version = GetConfiguredProjectVersion(update);

foreach (IProjectEvaluationHandler evaluationHandler in _updateHandlers.EvaluationHandlers)
{
cancellationToken.ThrowIfCancellationRequested();
Expand All @@ -362,7 +362,7 @@ void ProcessSourceItemsHandlers()
{
cancellationToken.ThrowIfCancellationRequested();

sourceItemsHandler.Handle(Context, version, changes, contextState, _logger);
sourceItemsHandler.Handle(Context, changes, contextState, _logger);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void Handle_RazorAndCshtmlFiles_AddsToContext()
}
"""));

handler.Handle(context, 1, projectChanges, new ContextState(), IManagedProjectDiagnosticOutputServiceFactory.Create());
handler.Handle(context, projectChanges, new ContextState(), IManagedProjectDiagnosticOutputServiceFactory.Create());

Assert.Equal(2, dynamicFiles.Count);
Assert.Contains(@"C:\File1.razor", dynamicFiles);
Expand Down Expand Up @@ -71,7 +71,7 @@ public void Handle_RazorAndCshtmlFiles_InDifferentItemTypes_AddsToContext()
}
"""));

handler.Handle(context, 1, projectChanges, new ContextState(), IManagedProjectDiagnosticOutputServiceFactory.Create());
handler.Handle(context, projectChanges, new ContextState(), IManagedProjectDiagnosticOutputServiceFactory.Create());

Assert.Equal(2, dynamicFiles.Count);
Assert.Contains(@"C:\File1.razor", dynamicFiles);
Expand Down Expand Up @@ -113,7 +113,7 @@ public void Handle_RazorAndCshtmlFiles_InDifferentItemTypes_IgnoresDuplicates()
}
"""));

handler.Handle(context, 1, projectChanges, new ContextState(), IManagedProjectDiagnosticOutputServiceFactory.Create());
handler.Handle(context, projectChanges, new ContextState(), IManagedProjectDiagnosticOutputServiceFactory.Create());

Assert.Equal(2, dynamicFiles.Count);
Assert.Contains(@"C:\File1.razor", dynamicFiles);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public abstract class SourceItemsHandlerTestBase
{
internal static void Handle(IWorkspaceProjectContext context, ISourceItemsHandler handler, IImmutableDictionary<string, IProjectChangeDescription> projectChanges)
{
handler.Handle(context, 1, projectChanges, new ContextState(), IManagedProjectDiagnosticOutputServiceFactory.Create());
handler.Handle(context, projectChanges, new ContextState(), IManagedProjectDiagnosticOutputServiceFactory.Create());
}

internal abstract ISourceItemsHandler CreateInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,6 @@ public async Task EvaluationUpdate_InvokesSourceItemHandlersWhenChangesExist(boo
.Setup(
o => o.Handle(
workspaceProjectContext.Object,
1,
It.IsAny<ImmutableDictionary<string, IProjectChangeDescription>>(),
new ContextState(false, true),
It.IsAny<IManagedProjectDiagnosticOutputService>()));
Expand Down

0 comments on commit c6e60ad

Please sign in to comment.