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

Commit 98557f0

Browse files
committed
Refactored the VsCommand stuff.
- Moved `VsCommand` etc out of `GitHub.InlineReviews` and into a new assembly `GitHub.Services.Vssdk` which will be a home for services which have a hard VSSDK dependency. - Moved the command interfaces into `GitHub.Exports` - Made the `VsCommand` classes inherit from `OleMenuCommand` - Removed the automatic package registration stuff
1 parent 01bbc84 commit 98557f0

32 files changed

+510
-286
lines changed

GitHubVS.sln

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.InlineReviews.UnitTe
104104
EndProject
105105
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.Logging", "src\GitHub.Logging\GitHub.Logging.csproj", "{8D73575A-A89F-47CC-B153-B47DD06837F0}"
106106
EndProject
107+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.Services", "src\GitHub.Services\GitHub.Services.csproj", "{DDB343BA-2EC8-40D4-B991-951ABFF2F5DB}"
108+
EndProject
109+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.Services.Vssdk", "src\GitHub.Services.Vssdk\GitHub.Services.Vssdk.csproj", "{2D3D2834-33BE-45CA-B3CC-12F853557D7B}"
110+
EndProject
107111
Global
108112
GlobalSection(SolutionConfigurationPlatforms) = preSolution
109113
Debug|Any CPU = Debug|Any CPU
@@ -403,6 +407,26 @@ Global
403407
{8D73575A-A89F-47CC-B153-B47DD06837F0}.Release|Any CPU.Build.0 = Release|Any CPU
404408
{8D73575A-A89F-47CC-B153-B47DD06837F0}.ReleaseWithoutVsix|Any CPU.ActiveCfg = Release|Any CPU
405409
{8D73575A-A89F-47CC-B153-B47DD06837F0}.ReleaseWithoutVsix|Any CPU.Build.0 = Release|Any CPU
410+
{DDB343BA-2EC8-40D4-B991-951ABFF2F5DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
411+
{DDB343BA-2EC8-40D4-B991-951ABFF2F5DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
412+
{DDB343BA-2EC8-40D4-B991-951ABFF2F5DB}.DebugCodeAnalysis|Any CPU.ActiveCfg = DebugCodeAnalysis|Any CPU
413+
{DDB343BA-2EC8-40D4-B991-951ABFF2F5DB}.DebugCodeAnalysis|Any CPU.Build.0 = DebugCodeAnalysis|Any CPU
414+
{DDB343BA-2EC8-40D4-B991-951ABFF2F5DB}.DebugWithoutVsix|Any CPU.ActiveCfg = DebugCodeAnalysis|Any CPU
415+
{DDB343BA-2EC8-40D4-B991-951ABFF2F5DB}.DebugWithoutVsix|Any CPU.Build.0 = DebugCodeAnalysis|Any CPU
416+
{DDB343BA-2EC8-40D4-B991-951ABFF2F5DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
417+
{DDB343BA-2EC8-40D4-B991-951ABFF2F5DB}.Release|Any CPU.Build.0 = Release|Any CPU
418+
{DDB343BA-2EC8-40D4-B991-951ABFF2F5DB}.ReleaseWithoutVsix|Any CPU.ActiveCfg = Release|Any CPU
419+
{DDB343BA-2EC8-40D4-B991-951ABFF2F5DB}.ReleaseWithoutVsix|Any CPU.Build.0 = Release|Any CPU
420+
{2D3D2834-33BE-45CA-B3CC-12F853557D7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
421+
{2D3D2834-33BE-45CA-B3CC-12F853557D7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
422+
{2D3D2834-33BE-45CA-B3CC-12F853557D7B}.DebugCodeAnalysis|Any CPU.ActiveCfg = DebugCodeAnalysis|Any CPU
423+
{2D3D2834-33BE-45CA-B3CC-12F853557D7B}.DebugCodeAnalysis|Any CPU.Build.0 = DebugCodeAnalysis|Any CPU
424+
{2D3D2834-33BE-45CA-B3CC-12F853557D7B}.DebugWithoutVsix|Any CPU.ActiveCfg = DebugCodeAnalysis|Any CPU
425+
{2D3D2834-33BE-45CA-B3CC-12F853557D7B}.DebugWithoutVsix|Any CPU.Build.0 = DebugCodeAnalysis|Any CPU
426+
{2D3D2834-33BE-45CA-B3CC-12F853557D7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
427+
{2D3D2834-33BE-45CA-B3CC-12F853557D7B}.Release|Any CPU.Build.0 = Release|Any CPU
428+
{2D3D2834-33BE-45CA-B3CC-12F853557D7B}.ReleaseWithoutVsix|Any CPU.ActiveCfg = Release|Any CPU
429+
{2D3D2834-33BE-45CA-B3CC-12F853557D7B}.ReleaseWithoutVsix|Any CPU.Build.0 = Release|Any CPU
406430
EndGlobalSection
407431
GlobalSection(SolutionProperties) = preSolution
408432
HideSolutionNode = FALSE

src/GitHub.InlineReviews/Commands/INextInlineCommentCommand.cs renamed to src/GitHub.Exports/Commands/INextInlineCommentCommand.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
2+
using GitHub.Commands;
23

3-
namespace GitHub.InlineReviews.Commands
4+
namespace GitHub.Commands
45
{
56
/// <summary>
67
/// Navigates to and opens the the next inline comment thread in the currently active text view.

src/GitHub.InlineReviews/Commands/IPreviousInlineCommentCommand.cs renamed to src/GitHub.Exports/Commands/IPreviousInlineCommentCommand.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
2+
using GitHub.Commands;
23

3-
namespace GitHub.InlineReviews.Commands
4+
namespace GitHub.Commands
45
{
56
/// <summary>
67
/// Navigates to and opens the the previous inline comment thread in the currently active text view.

src/GitHub.InlineReviews/Commands/IVsCommand.cs renamed to src/GitHub.Exports/Commands/IVsCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using System.Threading.Tasks;
33

4-
namespace GitHub.InlineReviews.Commands
4+
namespace GitHub.Commands
55
{
66
/// <summary>
77
/// Represents a Visual Studio command that does not accept a parameter.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
using System;
22
using System.Windows.Input;
33

4-
namespace GitHub.InlineReviews.Commands
4+
namespace GitHub.Commands
55
{
66
/// <summary>
7-
/// Represents a Visual Studio command.
7+
/// Represents a Visual Studio command exposed as an <see cref="ICommand"/>.
88
/// </summary>
9-
public interface IVsCommandBase : IPackageResource, ICommand
9+
public interface IVsCommandBase : ICommand
1010
{
1111
/// <summary>
1212
/// Gets a value indicating whether the command is enabled.
1313
/// </summary>
14-
bool IsEnabled { get; }
14+
bool Enabled { get; }
1515

1616
/// <summary>
1717
/// Gets a value indicating whether the command is visible.
1818
/// </summary>
19-
bool IsVisible { get; }
19+
bool Visible { get; }
2020
}
2121
}

src/GitHub.InlineReviews/Commands/InlineCommentNavigationParams.cs renamed to src/GitHub.Exports/Commands/InlineCommentNavigationParams.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22

3-
namespace GitHub.InlineReviews.Commands
3+
namespace GitHub.Commands
44
{
55
/// <summary>
66
/// Supplies parameters to <see cref="INextInlineCommentCommand"/> and

src/GitHub.Exports/GitHub.Exports.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@
143143
<Reference Include="WindowsBase" />
144144
</ItemGroup>
145145
<ItemGroup>
146+
<Compile Include="Commands\INextInlineCommentCommand.cs" />
147+
<Compile Include="Commands\InlineCommentNavigationParams.cs" />
148+
<Compile Include="Commands\IPreviousInlineCommentCommand.cs" />
149+
<Compile Include="Commands\IVsCommand.cs" />
150+
<Compile Include="Commands\IVsCommandBase.cs" />
146151
<Compile Include="Exports\ExportForProcess.cs" />
147152
<Compile Include="Extensions\ConnectionManagerExtensions.cs" />
148153
<Compile Include="GitHubLogicException.cs" />

src/GitHub.Exports/Settings/PkgCmdID.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public static class PkgCmdIDList
2323
public const int blameCommand = 0x500;
2424

2525
// IDs defined in InlineReviewsPackage.vsct
26-
public const int ShowPullRequestCommentsId = 0x1000;
2726
public const int NextInlineCommentId = 0x1001;
2827
public const int PreviousInlineCommentId = 0x1002;
2928
};

src/GitHub.InlineReviews/Commands/ExportCommandAttribute.cs

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/GitHub.InlineReviews/Commands/IExportCommandMetadata.cs

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)