Skip to content

OOP: Remove DiagnosticData.Workspace#35902

Merged
tmat merged 14 commits intodotnet:masterfrom
tmat:DiagData
Jun 3, 2019
Merged

OOP: Remove DiagnosticData.Workspace#35902
tmat merged 14 commits intodotnet:masterfrom
tmat:DiagData

Conversation

@tmat
Copy link
Copy Markdown
Member

@tmat tmat commented May 23, 2019

Remove dependency on mutable state. The workspace the diagnostic data originated from is available thru DiagnosticsUpdatedArgs and the DiagnosticData do not need the reference.

@tmat tmat marked this pull request as ready for review May 23, 2019 22:43
@tmat tmat requested a review from a team as a code owner May 23, 2019 22:43
@tmat tmat changed the title Remove DiagnosticData.Workspace OOP: Remove DiagnosticData.Workspace May 23, 2019
@tmat
Copy link
Copy Markdown
Member Author

tmat commented May 23, 2019

@heejaechang PTAL

@tmat
Copy link
Copy Markdown
Member Author

tmat commented May 23, 2019

@dotnet/roslyn-ide

@CyrusNajmabadi
Copy link
Copy Markdown
Contributor

This is great. Nothing struck me as bad here. Though i didn't look closely at some parts of hte logic that seem a little on hte complex side.

One concern i have (which may be better than how things worked before) is how resilient we are to the diagnostic data being stale wrt the current state of the workspace. Is the code the interacts between teh two suitably safe toward drift between them?

Copy link
Copy Markdown
Contributor

@heejaechang heejaechang left a comment

Choose a reason for hiding this comment

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

nice!

Copy link
Copy Markdown
Contributor

@heejaechang heejaechang left a comment

Choose a reason for hiding this comment

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

nicer! :)

public static DiagnosticData CreateAnalyzerLoadFailureDiagnostic(string fullPath, AnalyzerLoadFailureEventArgs e)
{
return CreateAnalyzerLoadFailureDiagnostic(null, null, null, fullPath, e);
return CreateAnalyzerLoadFailureDiagnostic(projectId: null, language: null, fullPath, e);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks

public ImmutableArray<TItem> Deduplicate(IEnumerable<IList<TItem>> groupedItems)
=> groupedItems.MergeDuplicatesOrderedBy(Order);

public abstract IEnumerable<TItem> Order(IEnumerable<TItem> groupedItems);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe doc this a bit... it's not clear to me what'd going on.

LinePosition trackingLinePosition;

if (workspace.IsDocumentOpen(documentId) &&
(trackingLinePosition = GetTrackingLineColumn(document, index)) != LinePosition.Zero)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i'm not sure i understand what's going on here. can you doc?

return builder.ToImmutableAndFree();
}

private static TableItem<T> Deduplicate<T>(this IList<TableItem<T>> duplicatedItems)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

pausing here.

@tmat tmat merged commit 075fcfc into dotnet:master Jun 3, 2019
@tmat tmat deleted the DiagData branch June 3, 2019 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants