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

Commit 22ec886

Browse files
committed
Use <inheritdoc/> on members not classes!
1 parent e88a3e4 commit 22ec886

File tree

4 files changed

+11
-60
lines changed

4 files changed

+11
-60
lines changed

src/GitHub.App/Services/GitHubContextService.cs

Lines changed: 9 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
namespace GitHub.Services
2222
{
23-
/// <inheritdoc/>
2423
[Export(typeof(IGitHubContextService))]
2524
public class GitHubContextService : IGitHubContextService
2625
{
@@ -67,21 +66,14 @@ public GitHubContextService(IGitHubServiceProvider serviceProvider, IGitService
6766
textManager = new Lazy<IVsTextManager2>(() => serviceProvider.GetService<SVsTextManager, IVsTextManager2>());
6867
}
6968

70-
/// <summary>
71-
/// Find the context from a URL in the clipboard if any.
72-
/// </summary>
73-
/// <returns>The context or null if clipboard doesn't contain a GitHub URL</returns>
69+
/// <inheritdoc/>
7470
public GitHubContext FindContextFromClipboard()
7571
{
7672
var text = Clipboard.GetText(TextDataFormat.Text);
7773
return FindContextFromUrl(text);
7874
}
7975

80-
/// <summary>
81-
/// Convert a GitHub URL to a context object.
82-
/// </summary>
83-
/// <param name="url">A GitHub URL</param>
84-
/// <returns>The context from the URL or null</returns>
76+
/// <inheritdoc/>
8577
public GitHubContext FindContextFromUrl(string url)
8678
{
8779
var uri = new UriString(url);
@@ -127,10 +119,7 @@ public GitHubContext FindContextFromUrl(string url)
127119
return context;
128120
}
129121

130-
/// <summary>
131-
/// Find the context from the title of the topmost browser.
132-
/// </summary>
133-
/// <returns>A context or null if a context can't be found.</returns>
122+
/// <inheritdoc/>
134123
public GitHubContext FindContextFromBrowser()
135124
{
136125
return
@@ -140,23 +129,15 @@ public GitHubContext FindContextFromBrowser()
140129
.FirstOrDefault();
141130
}
142131

143-
/// <summary>
144-
/// Convert a context to a repository URL.
145-
/// </summary>
146-
/// <param name="context">The context to convert.</param>
147-
/// <returns>A repository URL</returns>
132+
/// <inheritdoc/>
148133
public Uri ToRepositoryUrl(GitHubContext context)
149134
{
150135
var builder = new UriBuilder("https", context.Host ?? "github.com");
151136
builder.Path = $"{context.Owner}/{context.RepositoryName}";
152137
return builder.Uri;
153138
}
154139

155-
/// <summary>
156-
/// Find a context from a browser window title.
157-
/// </summary>
158-
/// <param name="windowTitle">A browser window title.</param>
159-
/// <returns>The context or null if none can be found</returns>
140+
/// <inheritdoc/>
160141
public GitHubContext FindContextFromWindowTitle(string windowTitle)
161142
{
162143
var match = windowTitleBlobRegex.Match(windowTitle);
@@ -243,12 +224,7 @@ public GitHubContext FindContextFromWindowTitle(string windowTitle)
243224
return null;
244225
}
245226

246-
/// <summary>
247-
/// Open a file in the working directory that corresponds to a context and navigate to a line/range.
248-
/// </summary>
249-
/// <param name="repositoryDir">The working directory.</param>
250-
/// <param name="context">A context to navigate to.</param>
251-
/// <returns>True if navigation was successful</returns>
227+
/// <inheritdoc/>
252228
public bool TryOpenFile(string repositoryDir, GitHubContext context)
253229
{
254230
var (commitish, path, isSha) = ResolveBlob(repositoryDir, context);
@@ -263,13 +239,7 @@ public bool TryOpenFile(string repositoryDir, GitHubContext context)
263239
return true;
264240
}
265241

266-
/// <summary>
267-
/// Map from a context to a repository blob object.
268-
/// </summary>
269-
/// <param name="repositoryDir">The target repository.</param>
270-
/// <param name="context">The context to map from.</param>
271-
/// <param name="remoteName">The name of the remote to search for branches.</param>
272-
/// <returns>The resolved commit-ish, blob path and commit SHA for the blob. Path will be null if the commit-ish can be resolved but not the blob.</returns>
242+
/// <inheritdoc/>
273243
public (string commitish, string path, string commitSha) ResolveBlob(string repositoryDir, GitHubContext context, string remoteName = "origin")
274244
{
275245
Guard.ArgumentNotNull(repositoryDir, nameof(repositoryDir));
@@ -335,16 +305,7 @@ public bool TryOpenFile(string repositoryDir, GitHubContext context)
335305
}
336306
}
337307

338-
/// <summary>
339-
/// Check if a file in the working directory has changed since a specified commit-ish.
340-
/// </summary>
341-
/// <remarks>
342-
/// The commit-ish might be a commit SHA, a tag or a remote branch.
343-
/// </remarks>
344-
/// <param name="repositoryDir">The target repository.</param>
345-
/// <param name="commitish">A commit SHA, remote branch or tag.</param>
346-
/// <param name="path">The path for a blob.</param>
347-
/// <returns>True if the working file is different.</returns>
308+
/// <inheritdoc/>
348309
public bool HasChangesInWorkingDirectory(string repositoryDir, string commitish, string path)
349310
{
350311
using (var repo = gitService.GetRepository(repositoryDir))
@@ -356,17 +317,7 @@ public bool HasChangesInWorkingDirectory(string repositoryDir, string commitish,
356317
}
357318
}
358319

359-
/// <summary>
360-
/// Attempt to open the Blame/Annotate view for a context.
361-
/// </summary>
362-
/// <remarks>
363-
/// The access to the Blame/Annotate view was added in a version of Visual Studio 2017. This method will return
364-
/// false is this functionality isn't available.
365-
/// </remarks>
366-
/// <param name="repositoryDir">The target repository</param>
367-
/// <param name="currentBranch">A branch in the local repository. It isn't displayed on the UI but must exist. It can be a remote or local branch.</param>
368-
/// <param name="context">The context to open.</param>
369-
/// <returns>True if AnnotateFile functionality is available.</returns>
320+
/// <inheritdoc/>
370321
public async Task<bool> TryAnnotateFile(string repositoryDir, string currentBranch, GitHubContext context)
371322
{
372323
var (commitish, path, commitSha) = ResolveBlob(repositoryDir, context);

src/GitHub.Exports/Services/VSServices.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public VSServices(IGitHubServiceProvider serviceProvider, ILogger log)
3636
}
3737

3838
string vsVersion;
39+
/// <inheritdoc/>
3940
public string VSVersion
4041
{
4142
get
@@ -46,6 +47,7 @@ public string VSVersion
4647
}
4748
}
4849

50+
/// <inheritdoc/>
4951
public VSConstants.MessageBoxResult ShowMessageBoxInfo(string message)
5052
{
5153
return (VSConstants.MessageBoxResult)VsShellUtilities.ShowMessageBox(serviceProvider, message, null,

src/GitHub.VisualStudio/Commands/OpenFromClipboardCommand.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
namespace GitHub.VisualStudio.Commands
1111
{
12-
/// <inheritdoc/>
1312
[Export(typeof(IOpenFromClipboardCommand))]
1413
public class OpenFromClipboardCommand : VsCommand<string>, IOpenFromClipboardCommand
1514
{

src/GitHub.VisualStudio/Commands/OpenFromUrlCommand.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
namespace GitHub.VisualStudio.Commands
1717
{
18-
/// <inheritdoc/>
1918
[Export(typeof(IOpenFromUrlCommand))]
2019
public class OpenFromUrlCommand : VsCommand<string>, IOpenFromUrlCommand
2120
{

0 commit comments

Comments
 (0)