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 dataflow block name and some API docs #8617

Merged
merged 2 commits into from
Oct 19, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ protected override async Task InitializeCoreAsync(CancellationToken cancellation
target: DataflowBlockFactory.CreateActionBlock<IProjectVersionedValue<(ConfiguredProject ActiveConfiguredProject, ConfigurationSubscriptionSources Sources)>>(
async update => await ExecuteUnderLockAsync(cancellationToken => OnSlicesChanged(update, cancellationToken)),
_unconfiguredProject,
ProjectFaultSeverity.LimitedFunctionality),
ProjectFaultSeverity.LimitedFunctionality,
"LanguageServiceHostSlices {0}"),
Copy link
Contributor

Choose a reason for hiding this comment

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

What fills in the place holder here, and what value will it have?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've only ever seen it used in WinDBG, to help identify the purpose behind each dataflow block in the graph. I'm not sure what value goes in the placeholder actually, or why it's needed, but all nameFormat values have that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Digging into this, the nameFormat is used on the dataflow block's ToString method, and is passed two placeholder values:

  • {0} — the block's type name
  • {1} — the hash code of the block

linkOptions: DataflowOption.PropagateCompletion,
cancellationToken: cancellationToken),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,34 @@ protected override Task DisposeCoreUnderLockAsync(bool initialized)
return Task.CompletedTask;
}

/// <summary>
/// Adds an object that will be disposed along with this <see cref="Workspace"/> instance.
/// </summary>
/// <param name="disposable">The object to dispose when this object is disposed.</param>
public void ChainDisposal(IDisposable disposable)
{
Verify.NotDisposed(this);

_disposableBag.Add(disposable);
}

/// <summary>
/// Integrates project updates into the workspace.
/// </summary>
/// <remarks>
/// <para>
/// This method must always receive an evaluation update first. After that point,
/// both evaluation and build updates may arrive in any order, so long as values
/// of each type are ordered correctly.
/// </para>
/// <para>
/// Calls must not overlap. This method is not thread-safe. This method is designed
/// to be called from a dataflow ActionBlock, which will serialize calls, so we
/// needn't perform any locking or protection here.
/// </para>
/// </remarks>
/// <param name="update">The project update to integrate.</param>
/// <returns>A task that completes when the update has been integrated.</returns>
internal async Task OnWorkspaceUpdateAsync(IProjectVersionedValue<WorkspaceUpdate> update)
{
Verify.NotDisposed(this);
Expand Down