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

Commit a4e60a1

Browse files
committed
Zero impact extension for VS 2019
This extension won't auto-load any components.
1 parent d0c5fff commit a4e60a1

File tree

8 files changed

+775
-0
lines changed

8 files changed

+775
-0
lines changed

src/GitHub.VisualStudio.16.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.28721.148
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.VisualStudio.16", "GitHub.VisualStudio.16\GitHub.VisualStudio.16.csproj", "{4D63EA3B-6896-42B5-B182-AA54D9F5CFD6}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{4D63EA3B-6896-42B5-B182-AA54D9F5CFD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{4D63EA3B-6896-42B5-B182-AA54D9F5CFD6}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{4D63EA3B-6896-42B5-B182-AA54D9F5CFD6}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{4D63EA3B-6896-42B5-B182-AA54D9F5CFD6}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {8EF8212E-9A03-46A9-8989-BBA88CDB77C0}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<MinimumVisualStudioVersion>16.0</MinimumVisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
<TargetFrameworkProfile />
7+
</PropertyGroup>
8+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
9+
<PropertyGroup>
10+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
11+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
12+
<SchemaVersion>2.0</SchemaVersion>
13+
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
14+
<ProjectGuid>{4D63EA3B-6896-42B5-B182-AA54D9F5CFD6}</ProjectGuid>
15+
<OutputType>Library</OutputType>
16+
<AppDesignerFolder>Properties</AppDesignerFolder>
17+
<RootNamespace>GitHubCore</RootNamespace>
18+
<AssemblyName>GitHub.VisualStudio.16</AssemblyName>
19+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
20+
<GeneratePkgDefFile>true</GeneratePkgDefFile>
21+
<UseCodebase>true</UseCodebase>
22+
<IncludeAssemblyInVSIXContainer>true</IncludeAssemblyInVSIXContainer>
23+
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
24+
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
25+
<CopyBuildOutputToOutputDirectory>true</CopyBuildOutputToOutputDirectory>
26+
<CopyOutputSymbolsToOutputDirectory>true</CopyOutputSymbolsToOutputDirectory>
27+
<StartAction>Program</StartAction>
28+
<StartProgram Condition="'$(DevEnvDir)' != ''">$(DevEnvDir)devenv.exe</StartProgram>
29+
<StartArguments>/rootsuffix Exp</StartArguments>
30+
</PropertyGroup>
31+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
32+
<DebugSymbols>true</DebugSymbols>
33+
<DebugType>full</DebugType>
34+
<Optimize>false</Optimize>
35+
<OutputPath>bin\Debug\</OutputPath>
36+
<DefineConstants>DEBUG;TRACE</DefineConstants>
37+
<ErrorReport>prompt</ErrorReport>
38+
<WarningLevel>4</WarningLevel>
39+
</PropertyGroup>
40+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
41+
<DebugType>pdbonly</DebugType>
42+
<Optimize>true</Optimize>
43+
<OutputPath>bin\Release\</OutputPath>
44+
<DefineConstants>TRACE</DefineConstants>
45+
<ErrorReport>prompt</ErrorReport>
46+
<WarningLevel>4</WarningLevel>
47+
</PropertyGroup>
48+
<ItemGroup>
49+
<Compile Include="OpenFromGitHubCommand.cs" />
50+
<Compile Include="Properties\AssemblyInfo.cs" />
51+
<Compile Include="GitHubCorePackage.cs" />
52+
</ItemGroup>
53+
<ItemGroup>
54+
<None Include="source.extension.vsixmanifest">
55+
<SubType>Designer</SubType>
56+
</None>
57+
</ItemGroup>
58+
<ItemGroup>
59+
<Reference Include="Akavache, Version=6.0.0.0, Culture=neutral, PublicKeyToken=decff03a04a41f69, processorArchitecture=MSIL">
60+
<SpecificVersion>False</SpecificVersion>
61+
<HintPath>..\..\build\Content\Akavache.dll</HintPath>
62+
</Reference>
63+
<Reference Include="CredentialManagement, Version=2.9.0.0, Culture=neutral, PublicKeyToken=bc1bd09f2901c82e, processorArchitecture=MSIL">
64+
<SpecificVersion>False</SpecificVersion>
65+
<HintPath>..\..\build\Content\CredentialManagement.dll</HintPath>
66+
</Reference>
67+
<Reference Include="GitHub.Api">
68+
<HintPath>..\..\build\Content\GitHub.Api.dll</HintPath>
69+
</Reference>
70+
<Reference Include="GitHub.App">
71+
<HintPath>..\..\build\Content\GitHub.App.dll</HintPath>
72+
</Reference>
73+
<Reference Include="GitHub.Exports">
74+
<HintPath>..\..\build\Content\GitHub.Exports.dll</HintPath>
75+
</Reference>
76+
<Reference Include="GitHub.Exports.Reactive">
77+
<HintPath>..\..\build\Content\GitHub.Exports.Reactive.dll</HintPath>
78+
</Reference>
79+
<Reference Include="GitHub.Extensions, Version=2.9.0.0, Culture=neutral, PublicKeyToken=bc1bd09f2901c82e, processorArchitecture=MSIL">
80+
<SpecificVersion>False</SpecificVersion>
81+
<HintPath>..\..\build\Content\GitHub.Extensions.dll</HintPath>
82+
</Reference>
83+
<Reference Include="GitHub.Extensions.Reactive, Version=2.9.0.0, Culture=neutral, PublicKeyToken=bc1bd09f2901c82e, processorArchitecture=MSIL">
84+
<SpecificVersion>False</SpecificVersion>
85+
<HintPath>..\..\build\Content\GitHub.Extensions.Reactive.dll</HintPath>
86+
</Reference>
87+
<Reference Include="GitHub.Logging, Version=2.9.0.0, Culture=neutral, PublicKeyToken=bc1bd09f2901c82e, processorArchitecture=MSIL">
88+
<SpecificVersion>False</SpecificVersion>
89+
<HintPath>..\..\build\Content\GitHub.Logging.dll</HintPath>
90+
</Reference>
91+
<Reference Include="GitHub.Resources, Version=2.9.0.0, Culture=neutral, PublicKeyToken=bc1bd09f2901c82e, processorArchitecture=MSIL">
92+
<SpecificVersion>False</SpecificVersion>
93+
<HintPath>..\..\build\Content\GitHub.Resources.dll</HintPath>
94+
</Reference>
95+
<Reference Include="GitHub.Services.Vssdk, Version=2.9.0.0, Culture=neutral, PublicKeyToken=bc1bd09f2901c82e, processorArchitecture=MSIL">
96+
<SpecificVersion>False</SpecificVersion>
97+
<HintPath>..\..\build\Content\GitHub.Services.Vssdk.dll</HintPath>
98+
</Reference>
99+
<Reference Include="GitHub.TeamFoundation.16">
100+
<HintPath>..\..\build\Content\GitHub.TeamFoundation.16.dll</HintPath>
101+
</Reference>
102+
<Reference Include="GitHub.UI, Version=2.9.0.0, Culture=neutral, PublicKeyToken=bc1bd09f2901c82e, processorArchitecture=MSIL">
103+
<SpecificVersion>False</SpecificVersion>
104+
<HintPath>..\..\build\Content\GitHub.UI.dll</HintPath>
105+
</Reference>
106+
<Reference Include="GitHub.UI.Reactive, Version=2.9.0.0, Culture=neutral, PublicKeyToken=bc1bd09f2901c82e, processorArchitecture=MSIL">
107+
<SpecificVersion>False</SpecificVersion>
108+
<HintPath>..\..\build\Content\GitHub.UI.Reactive.dll</HintPath>
109+
</Reference>
110+
<Reference Include="GitHub.VisualStudio">
111+
<HintPath>..\..\build\Content\GitHub.VisualStudio.dll</HintPath>
112+
</Reference>
113+
<Reference Include="GitHub.VisualStudio.UI, Version=2.9.0.0, Culture=neutral, PublicKeyToken=bc1bd09f2901c82e, processorArchitecture=MSIL">
114+
<SpecificVersion>False</SpecificVersion>
115+
<HintPath>..\..\build\Content\GitHub.VisualStudio.UI.dll</HintPath>
116+
</Reference>
117+
<Reference Include="LibGit2Sharp, Version=0.26.0.0, Culture=neutral, PublicKeyToken=7cbde695407f0333, processorArchitecture=MSIL">
118+
<SpecificVersion>False</SpecificVersion>
119+
<HintPath>..\..\build\Content\LibGit2Sharp.dll</HintPath>
120+
</Reference>
121+
<Reference Include="Markdig, Version=0.13.0.0, Culture=neutral, PublicKeyToken=870da25a133885f8, processorArchitecture=MSIL">
122+
<SpecificVersion>False</SpecificVersion>
123+
<HintPath>..\..\build\Content\Markdig.dll</HintPath>
124+
</Reference>
125+
<Reference Include="Markdig.Wpf, Version=0.2.1.0, Culture=neutral, PublicKeyToken=a0d0cdbebd8d164b, processorArchitecture=MSIL">
126+
<SpecificVersion>False</SpecificVersion>
127+
<HintPath>..\..\build\Content\Markdig.Wpf.dll</HintPath>
128+
</Reference>
129+
<Reference Include="Microsoft.CSharp" />
130+
<Reference Include="Octokit, Version=0.0.0.0, Culture=neutral, PublicKeyToken=5525be5bc50478ea, processorArchitecture=MSIL">
131+
<SpecificVersion>False</SpecificVersion>
132+
<HintPath>..\..\build\Content\Octokit.dll</HintPath>
133+
</Reference>
134+
<Reference Include="Octokit.GraphQL, Version=0.1.3.0, Culture=neutral, PublicKeyToken=0be8860aee462442, processorArchitecture=MSIL">
135+
<SpecificVersion>False</SpecificVersion>
136+
<HintPath>..\..\build\Content\Octokit.GraphQL.dll</HintPath>
137+
</Reference>
138+
<Reference Include="Octokit.GraphQL.Core, Version=0.1.3.0, Culture=neutral, PublicKeyToken=0be8860aee462442, processorArchitecture=MSIL">
139+
<SpecificVersion>False</SpecificVersion>
140+
<HintPath>..\..\build\Content\Octokit.GraphQL.Core.dll</HintPath>
141+
</Reference>
142+
<Reference Include="ReactiveUI, Version=8.7.0.0, Culture=neutral, PublicKeyToken=31f8874b2ce7ed44, processorArchitecture=MSIL">
143+
<SpecificVersion>False</SpecificVersion>
144+
<HintPath>..\..\build\Content\ReactiveUI.dll</HintPath>
145+
</Reference>
146+
<Reference Include="ReactiveUI.Events.WPF, Version=8.7.0.0, Culture=neutral, PublicKeyToken=31f8874b2ce7ed44, processorArchitecture=MSIL">
147+
<SpecificVersion>False</SpecificVersion>
148+
<HintPath>..\..\build\Content\ReactiveUI.Events.WPF.dll</HintPath>
149+
</Reference>
150+
<Reference Include="ReactiveUI.Wpf">
151+
<HintPath>..\..\build\Content\ReactiveUI.Wpf.dll</HintPath>
152+
</Reference>
153+
<Reference Include="rothko">
154+
<HintPath>..\..\build\Content\rothko.dll</HintPath>
155+
</Reference>
156+
<Reference Include="Serilog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
157+
<SpecificVersion>False</SpecificVersion>
158+
<HintPath>..\..\build\Content\Serilog.dll</HintPath>
159+
</Reference>
160+
<Reference Include="Serilog.Enrichers.Process, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
161+
<SpecificVersion>False</SpecificVersion>
162+
<HintPath>..\..\build\Content\Serilog.Enrichers.Process.dll</HintPath>
163+
</Reference>
164+
<Reference Include="Serilog.Enrichers.Thread, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
165+
<SpecificVersion>False</SpecificVersion>
166+
<HintPath>..\..\build\Content\Serilog.Enrichers.Thread.dll</HintPath>
167+
</Reference>
168+
<Reference Include="Serilog.Sinks.File, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
169+
<SpecificVersion>False</SpecificVersion>
170+
<HintPath>..\..\build\Content\Serilog.Sinks.File.dll</HintPath>
171+
</Reference>
172+
<Reference Include="Splat, Version=5.0.0.0, Culture=neutral, PublicKeyToken=79cb2fa33d9108a3, processorArchitecture=MSIL">
173+
<SpecificVersion>False</SpecificVersion>
174+
<HintPath>..\..\build\Content\Splat.dll</HintPath>
175+
</Reference>
176+
<Reference Include="System" />
177+
<Reference Include="System.ComponentModel.Composition" />
178+
<Reference Include="System.Data" />
179+
<Reference Include="System.Design" />
180+
<Reference Include="System.Drawing" />
181+
<Reference Include="System.Reactive, Version=4.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
182+
<SpecificVersion>False</SpecificVersion>
183+
<HintPath>..\..\build\Content\System.Reactive.dll</HintPath>
184+
</Reference>
185+
<Reference Include="System.Windows.Forms" />
186+
<Reference Include="System.Xml" />
187+
</ItemGroup>
188+
<ItemGroup>
189+
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="15.9.3" ExcludeAssets="runtime" />
190+
<PackageReference Include="Microsoft.VisualStudio.Shell.Framework">
191+
<Version>15.9.28307</Version>
192+
</PackageReference>
193+
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="16.0.2264" />
194+
</ItemGroup>
195+
<ItemGroup>
196+
<VSCTCompile Include="GitHubCorePackage.vsct">
197+
<ResourceName>Menus.ctmenu</ResourceName>
198+
</VSCTCompile>
199+
</ItemGroup>
200+
<ItemGroup>
201+
<Content Include="..\..\build\Content\lib\win32\x86\git2-572e4d8.dll">
202+
<Link>lib\win32\x86\git2-572e4d8.dll</Link>
203+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
204+
<IncludeInVSIX>true</IncludeInVSIX>
205+
<VSIXSubPath>lib\win32\x86</VSIXSubPath>
206+
</Content>
207+
</ItemGroup>
208+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
209+
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
210+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
211+
Other similar extension points exist, see Microsoft.Common.targets.
212+
<Target Name="BeforeBuild">
213+
</Target>
214+
<Target Name="AfterBuild">
215+
</Target>
216+
-->
217+
</Project>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
using System;
2+
using System.Runtime.InteropServices;
3+
using System.Threading;
4+
using Microsoft.VisualStudio.Shell;
5+
using Task = System.Threading.Tasks.Task;
6+
7+
namespace GitHubCore
8+
{
9+
/// <summary>
10+
/// This is the class that implements the package exposed by this assembly.
11+
/// </summary>
12+
/// <remarks>
13+
/// <para>
14+
/// The minimum requirement for a class to be considered a valid package for Visual Studio
15+
/// is to implement the IVsPackage interface and register itself with the shell.
16+
/// This package uses the helper classes defined inside the Managed Package Framework (MPF)
17+
/// to do it: it derives from the Package class that provides the implementation of the
18+
/// IVsPackage interface and uses the registration attributes defined in the framework to
19+
/// register itself and its components with the shell. These attributes tell the pkgdef creation
20+
/// utility what data to put into .pkgdef file.
21+
/// </para>
22+
/// <para>
23+
/// To get loaded into VS, the package must be referred by &lt;Asset Type="Microsoft.VisualStudio.VsPackage" ...&gt; in .vsixmanifest file.
24+
/// </para>
25+
/// </remarks>
26+
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
27+
[Guid(GitHubCorePackage.PackageGuidString)]
28+
[ProvideMenuResource("Menus.ctmenu", 1)]
29+
public sealed class GitHubCorePackage : AsyncPackage
30+
{
31+
/// <summary>
32+
/// GitHubCorePackage GUID string.
33+
/// </summary>
34+
public const string PackageGuidString = "0ea08009-a78b-4ead-883b-3266a4d71c40";
35+
36+
#region Package Members
37+
38+
/// <summary>
39+
/// Initialization of the package; this method is called right after the package is sited, so this is the place
40+
/// where you can put all the initialization code that rely on services provided by VisualStudio.
41+
/// </summary>
42+
/// <param name="cancellationToken">A cancellation token to monitor for initialization cancellation, which can occur when VS is shutting down.</param>
43+
/// <param name="progress">A provider for progress updates.</param>
44+
/// <returns>A task representing the async work of package initialization, or an already completed task if there is none. Do not return null from this method.</returns>
45+
protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
46+
{
47+
// When initialized asynchronously, the current thread may be a background thread at this point.
48+
// Do any initialization that requires the UI thread after switching to the UI thread.
49+
await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);
50+
await OpenFromGitHubCommand.InitializeAsync(this);
51+
}
52+
53+
#endregion
54+
}
55+
}

0 commit comments

Comments
 (0)