Skip to content
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 @@ -287,6 +287,9 @@ public override bool TryGetValue(int index, string columnName, out object conten
case StandardTableKeyNames.ErrorCodeToolTip:
content = GetHelpLinkToolTipText(data);
return content != null;
case StandardTableKeyNames.HelpKeyword:
content = data.Id;
return content != null;
case StandardTableKeyNames.HelpLink:
content = GetHelpLink(data);
return content != null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ public override bool TryGetValue(int index, string columnName, out object conten
case StandardTableKeyNames.ErrorCodeToolTip:
content = GetHelpLinkToolTipText(data);
return content != null;
case StandardTableKeyNames.HelpKeyword:
Copy link
Contributor

Choose a reason for hiding this comment

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

@heejaechang Looking at the PR I realized I only added handler for SuppressionStateColumnDefinition.ColumnName in live source but not for build source, I will make that fix tomorrow.

Copy link
Contributor

Choose a reason for hiding this comment

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

There is a lot of redundancy in this method. Why not have a "GetValue" method that just returns things like data.id. Then have htis method be:

bool TryGetValue(...)
{
    var value = GetValue(...);
    return value != null;
}

It should cut down the size of this method (and the repeated code) by nearly half.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@CyrusNajmabadi some of them could, but I dont think it is that bad to require cleaning up.

content = data.Id;
return content != null;
case StandardTableKeyNames.HelpLink:
content = GetHelpLink(data);
return content != null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,35 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.Diagnostics
End Using
End Sub

<WpfFact>
Public Sub TestHelpKeyword()
Using workspace = CSharpWorkspaceFactory.CreateWorkspaceFromLines(String.Empty)
Dim documentId = workspace.CurrentSolution.Projects.First().DocumentIds.First()
Dim projectId = documentId.ProjectId

Dim item1 = CreateItem(workspace, projectId, documentId, DiagnosticSeverity.Error, "http://link/")
Dim provider = New TestDiagnosticService(item1)

Dim tableManagerProvider = New TestTableManagerProvider()

Dim table = New VisualStudioDiagnosticListTable(workspace, provider, tableManagerProvider)
provider.RaiseDiagnosticsUpdated(workspace)

Dim manager = DirectCast(table.TableManager, TestTableManagerProvider.TestTableManager)
Dim source = DirectCast(manager.Sources.First(), AbstractRoslynTableDataSource(Of DiagnosticData))
Dim sinkAndSubscription = manager.Sinks_TestOnly.First()

Dim sink = DirectCast(sinkAndSubscription.Key, TestTableManagerProvider.TestTableManager.TestSink)
Dim snapshot = sink.Entries.First().GetCurrentSnapshot()
Assert.Equal(1, snapshot.Count)

Dim keyword As Object = Nothing
Assert.True(snapshot.TryGetValue(0, StandardTableKeyNames.HelpKeyword, keyword))

Assert.Equal(item1.Id, keyword.ToString())
End Using
End Sub

<WpfFact>
Public Sub TestBingHelpLink()
Using workspace = CSharpWorkspaceFactory.CreateWorkspaceFromLines(String.Empty)
Expand Down