Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 0974e48

Browse files
committed
Enable usage tracker for NumberOfPRDetailsNavigateToEditor
1 parent 81c53cc commit 0974e48

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/GitHub.Exports/Models/UsageModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public class UsageModel
3737
public int NumberOfPRDetailsViewFile { get; set; }
3838
public int NumberOfPRDetailsCompareWithSolution { get; set; }
3939
public int NumberOfPRDetailsOpenFileInSolution { get; set; }
40+
public int NumberOfPRDetailsNavigateToEditor { get; set; }
4041
public int NumberOfPRReviewDiffViewInlineCommentOpen { get; set; }
4142
public int NumberOfPRReviewDiffViewInlineCommentPost { get; set; }
4243

src/GitHub.VisualStudio/Views/GitHubPane/PullRequestDetailView.xaml.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ async Task DoOpenFile(IPullRequestFileNode file, bool workingDirectory)
128128
}
129129
}
130130

131-
async Task DoOpenLiveFile(IPullRequestFileNode file)
131+
async Task DoNavigateToEditor(IPullRequestFileNode file)
132132
{
133133
try
134134
{
@@ -149,12 +149,11 @@ async Task DoOpenLiveFile(IPullRequestFileNode file)
149149

150150
NavigationService.NavigateToEquivalentPosition(activeView, fullPath);
151151

152-
// TODO: Add metrics for NumberOfPRDetailsOpenLiveFile
153-
await UsageTracker.IncrementCounter(x => x.NumberOfPRDetailsOpenFileInSolution);
152+
await UsageTracker.IncrementCounter(x => x.NumberOfPRDetailsNavigateToEditor);
154153
}
155154
catch (Exception e)
156155
{
157-
ShowErrorInStatusBar("Error opening live file", e);
156+
ShowErrorInStatusBar("Error navigating to editor", e);
158157
}
159158
}
160159

@@ -255,11 +254,11 @@ void EnableNavigateToEditor(IVsTextView textView, IPullRequestFileNode file)
255254
{
256255
var commandGroup = VSConstants.CMDSETID.StandardCommandSet2K_guid;
257256
var commandId = (int)VSConstants.VSStd2KCmdID.RETURN;
258-
new TextViewCommandDispatcher(textView, commandGroup, commandId).Exec += async (s, e) => await DoOpenLiveFile(file);
257+
new TextViewCommandDispatcher(textView, commandGroup, commandId).Exec += async (s, e) => await DoNavigateToEditor(file);
259258

260259
var contextMenuCommandGroup = new Guid(Guids.guidContextMenuSetString);
261260
var goToCommandId = PkgCmdIDList.openFileInSolutionCommand;
262-
new TextViewCommandDispatcher(textView, contextMenuCommandGroup, goToCommandId).Exec += async (s, e) => await DoOpenLiveFile(file);
261+
new TextViewCommandDispatcher(textView, contextMenuCommandGroup, goToCommandId).Exec += async (s, e) => await DoNavigateToEditor(file);
263262
}
264263

265264
void ShowErrorInStatusBar(string message, Exception e = null)

0 commit comments

Comments
 (0)