Skip to content

Commit 9308cc5

Browse files
authored
fix(extension): resolve extension loading and improve menu placement (#315)
1 parent 2c6dfac commit 9308cc5

File tree

5 files changed

+32
-13
lines changed

5 files changed

+32
-13
lines changed

src/CodingWithCalvin.CouchbaseExplorer.slnx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<File Path="../README.md" />
1111
<File Path="../resources/extension.manifest.json" />
1212
</Folder>
13-
<Project Path="CodingWithCalvin.CouchbaseExplorer/CodingWithCalvin.CouchbaseExplorer.csproj">
13+
<Project Path="CodingWithCalvin.CouchbaseExplorer/CodingWithCalvin.CouchbaseExplorer.csproj" Id="8af8beef-6fcc-4479-8d85-540a414d0ea2">
1414
<Platform Solution="*|arm64" Project="arm64" />
1515
<Platform Solution="*|x64" Project="x64" />
1616
<Platform Solution="*|x86" Project="x86" />

src/CodingWithCalvin.CouchbaseExplorer/CodingWithCalvin.CouchbaseExplorer.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<PlatformTarget>x64</PlatformTarget>
2525
<LangVersion>latest</LangVersion>
2626
<ErrorReport>prompt</ErrorReport>
27+
<DeployExtension>true</DeployExtension>
2728
</PropertyGroup>
2829
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
2930
<OutputPath>bin\x64\Release\</OutputPath>

src/CodingWithCalvin.CouchbaseExplorer/CouchbaseExplorerPackage.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@
22
using System.Runtime.InteropServices;
33
using System.Threading;
44
using Microsoft.VisualStudio.Shell;
5+
using Microsoft.VisualStudio.Shell.Interop;
56

67
namespace CodingWithCalvin.CouchbaseExplorer
78
{
89
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
910
[InstalledProductRegistration(Vsix.Name, Vsix.Description, Vsix.Version)]
1011
[Guid(PackageGuidString)]
1112
[ProvideMenuResource("Menus.ctmenu", 1)]
12-
[ProvideToolWindow(typeof(CouchbaseExplorerWindow))]
13+
[ProvideToolWindow(typeof(CouchbaseExplorerWindow),
14+
Style = VsDockStyle.Linked,
15+
Orientation = ToolWindowOrientation.Left,
16+
Window = ToolWindowGuids.ServerExplorer)]
17+
[ProvideAutoLoad(UIContextGuids80.NoSolution, PackageAutoLoadFlags.BackgroundLoad)]
18+
[ProvideAutoLoad(UIContextGuids80.SolutionExists, PackageAutoLoadFlags.BackgroundLoad)]
1319
public sealed class CouchbaseExplorerPackage : AsyncPackage
1420
{
1521
public const string PackageGuidString = "ef261503-b2ae-4b90-8c86-0becd83348cc";
Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<CommandTable xmlns="http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable" xmlns:xs="http://www.w3.org/2001/XMLSchema">
33

44
<Extern href="stdidcmd.h"/>
55
<Extern href="vsshlids.h"/>
6-
6+
77
<Commands package="guidVsPackage">
8+
<Groups>
9+
<!-- Custom group for Couchbase Explorer in the View menu -->
10+
<Group guid="guidVsPackageCmdSet" id="CouchbaseExplorerMenuGroup" priority="0x0100">
11+
<Parent guid="guidSHLMainMenu" id="IDM_VS_MENU_VIEW"/>
12+
</Group>
13+
</Groups>
14+
815
<Buttons>
9-
<Button guid="guidVsPackageCmdSet" id="CouchbaseExplorerWindowCommandId" priority="5000" type="Button">
10-
<Parent guid="guidSHLMainMenu" id="IDG_VS_VIEW_ORG_WINDOWS"/>
16+
<Button guid="guidVsPackageCmdSet" id="CouchbaseExplorerWindowCommandId" priority="0x0100" type="Button">
17+
<!-- Parent is now our custom group -->
18+
<Parent guid="guidVsPackageCmdSet" id="CouchbaseExplorerMenuGroup"/>
1119
<Icon guid="guidCouchbaseIcon" id="couchbaseIcon" />
1220
<Strings>
1321
<ButtonText>Couchbase Explorer</ButtonText>
@@ -16,19 +24,20 @@
1624
</Buttons>
1725

1826
<Bitmaps>
19-
<Bitmap guid="guidCouchbaseIcon" href="..\..\resources\icon.png" usedList="couchbaseIcon"/>
27+
<Bitmap guid="guidCouchbaseIcon" href="..\..\resources\icon.png" usedList="couchbaseIcon"/>
2028
</Bitmaps>
2129
</Commands>
2230

2331
<Symbols>
2432
<GuidSymbol name="guidVsPackage" value="{ef261503-b2ae-4b90-8c86-0becd83348cc}" />
2533

26-
<GuidSymbol name="guidVsPackageCmdSet" value="{715bc434-afd2-4104-a6a0-287120f718f5}">
34+
<GuidSymbol name="guidVsPackageCmdSet" value="{715bc434-afd2-4104-a6a0-287120f718f5}">
35+
<IDSymbol name="CouchbaseExplorerMenuGroup" value="0x1000" />
2736
<IDSymbol name="CouchbaseExplorerWindowCommandId" value="0x0100" />
2837
</GuidSymbol>
2938

30-
<GuidSymbol name="guidCouchbaseIcon" value="{5adaa369-1a0a-437f-bf63-f609baad46fb}">
31-
<IDSymbol name="couchbaseIcon" value="1"/>
32-
</GuidSymbol>
39+
<GuidSymbol name="guidCouchbaseIcon" value="{5adaa369-1a0a-437f-bf63-f609baad46fb}">
40+
<IDSymbol name="couchbaseIcon" value="1"/>
41+
</GuidSymbol>
3342
</Symbols>
3443
</CommandTable>

src/CodingWithCalvin.CouchbaseExplorer/source.extension.vsixmanifest

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,18 @@
1212
<Preview>true</Preview>
1313
</Metadata>
1414
<Installation>
15-
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0,18.0)">
15+
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0,19.0)">
1616
<ProductArchitecture>amd64</ProductArchitecture>
1717
</InstallationTarget>
18+
<InstallationTarget Version="[17.0,19.0)" Id="Microsoft.VisualStudio.Community">
19+
<ProductArchitecture>arm64</ProductArchitecture>
20+
</InstallationTarget>
1821
</Installation>
1922
<Dependencies>
2023
<Dependency Id="Microsoft.VisualStudio.MPF.15.0" DisplayName="Visual Studio MPF 15.0" d:Source="Installed" Version="[15.0]" />
2124
</Dependencies>
2225
<Prerequisites>
23-
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,16.0)" DisplayName="Visual Studio core editor" />
26+
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[17.0,)" DisplayName="Visual Studio core editor" />
2427
</Prerequisites>
2528
<Assets>
2629
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />

0 commit comments

Comments
 (0)