Skip to content

Commit 0b34054

Browse files
committed
Add option disable generic search, support VS 2019, bug fixes, use PackageReference
1 parent 333ea02 commit 0b34054

10 files changed

Lines changed: 100 additions & 208 deletions

StackOverflowQuickLaunch/Browser.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
using EnvDTE;
1+
using System.Diagnostics;
2+
using Microsoft.VisualStudio.Shell;
3+
using Microsoft.VisualStudio.Shell.Interop;
24

35
namespace Aberus.StackOverflowQuickLaunch
46
{
@@ -8,14 +10,14 @@ public static void Open(string url, bool openInInternalBrowser, bool newWindow =
810
{
911
if(openInInternalBrowser)
1012
{
11-
var navigateOptions = newWindow ? vsNavigateOptions.vsNavigateOptionsNewWindow : vsNavigateOptions.vsNavigateOptionsDefault;
13+
uint navigateOptions = newWindow ? (uint)__VSWBNAVIGATEFLAGS.VSNWB_ForceNew : 0u;
1214

13-
var dte = StackOverflowQuickLaunchPackage.GetGlobalService(typeof(DTE)) as DTE;
14-
dte.ItemOperations.Navigate(url, navigateOptions);
15+
var webBrowsingService = Package.GetGlobalService(typeof(IVsWebBrowsingService)) as IVsWebBrowsingService;
16+
webBrowsingService.Navigate(url, navigateOptions, out IVsWindowFrame ppFrame);
1517
}
1618
else
1719
{
18-
System.Diagnostics.Process.Start(url);
20+
Process.Start(url);
1921
}
2022
}
2123
}

StackOverflowQuickLaunch/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
//
2828
// You can specify all the values or you can default the Revision and Build Numbers
2929
// by using the '*' as shown below:
30-
[assembly: AssemblyVersion("0.9.0.0")]
31-
[assembly: AssemblyFileVersion("0.9.0.0")]
30+
[assembly: AssemblyVersion("1.0.0.0")]
31+
[assembly: AssemblyFileVersion("1.0.0.0")]
3232

3333

3434

Lines changed: 22 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
3-
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props')" />
43
<PropertyGroup>
54
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
6-
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
5+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
76
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
8-
<FileUpgradeFlags>
9-
</FileUpgradeFlags>
10-
<UpgradeBackupLocation>
11-
</UpgradeBackupLocation>
12-
<OldToolsVersion>4.0</OldToolsVersion>
13-
<IsWebBootstrapper>false</IsWebBootstrapper>
14-
<PublishUrl>publish\</PublishUrl>
15-
<Install>true</Install>
16-
<InstallFrom>Disk</InstallFrom>
17-
<UpdateEnabled>false</UpdateEnabled>
18-
<UpdateMode>Foreground</UpdateMode>
19-
<UpdateInterval>7</UpdateInterval>
20-
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
21-
<UpdatePeriodically>false</UpdatePeriodically>
22-
<UpdateRequired>false</UpdateRequired>
23-
<MapFileExtensions>true</MapFileExtensions>
24-
<ApplicationRevision>0</ApplicationRevision>
25-
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
26-
<UseApplicationTrust>false</UseApplicationTrust>
27-
<BootstrapperEnabled>true</BootstrapperEnabled>
28-
<NuGetPackageImportStamp>
29-
</NuGetPackageImportStamp>
7+
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
308
</PropertyGroup>
319
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
3210
<PropertyGroup>
@@ -40,9 +18,10 @@
4018
<RootNamespace>Aberus.StackOverflowQuickLaunch</RootNamespace>
4119
<AssemblyName>StackOverflowQuickLaunch</AssemblyName>
4220
<SignAssembly>false</SignAssembly>
43-
<AssemblyOriginatorKeyFile>
44-
</AssemblyOriginatorKeyFile>
4521
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
22+
<StartAction>Program</StartAction>
23+
<StartProgram Condition="'$(DevEnvDir)' != ''">$(DevEnvDir)devenv.exe</StartProgram>
24+
<StartArguments>/rootsuffix Exp</StartArguments>
4625
</PropertyGroup>
4726
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
4827
<DebugSymbols>true</DebugSymbols>
@@ -65,105 +44,20 @@
6544
<PlatformTarget>x86</PlatformTarget>
6645
<DeployExtension>False</DeployExtension>
6746
</PropertyGroup>
68-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
69-
<StartAction>Program</StartAction>
70-
<StartProgram>C:\Program Files %28x86%29\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.exe</StartProgram>
71-
<StartArguments>/rootsuffix Exp</StartArguments>
72-
</PropertyGroup>
73-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
74-
<StartAction>Program</StartAction>
75-
<StartProgram>C:\Program Files %28x86%29\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.exe</StartProgram>
76-
<StartArguments>/rootsuffix Exp</StartArguments>
77-
</PropertyGroup>
7847
<ItemGroup>
79-
<Reference Include="envdte, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
48+
<Reference Include="EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
8049
<EmbedInteropTypes>True</EmbedInteropTypes>
8150
</Reference>
82-
<Reference Include="envdte100, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
51+
<Reference Include="EnvDTE100, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
8352
<EmbedInteropTypes>True</EmbedInteropTypes>
8453
</Reference>
85-
<Reference Include="envdte80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
54+
<Reference Include="EnvDTE80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
8655
<EmbedInteropTypes>True</EmbedInteropTypes>
8756
</Reference>
88-
<Reference Include="envdte90, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
57+
<Reference Include="EnvDTE90, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
8958
<EmbedInteropTypes>True</EmbedInteropTypes>
9059
</Reference>
9160
<Reference Include="Microsoft.CSharp" />
92-
<Reference Include="Microsoft.VisualStudio.Imaging, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
93-
<HintPath>..\packages\Microsoft.VisualStudio.Imaging.14.3.25407\lib\net45\Microsoft.VisualStudio.Imaging.dll</HintPath>
94-
<Private>True</Private>
95-
</Reference>
96-
<Reference Include="Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
97-
<HintPath>..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6070\lib\Microsoft.VisualStudio.OLE.Interop.dll</HintPath>
98-
<Private>True</Private>
99-
</Reference>
100-
<Reference Include="Microsoft.VisualStudio.Shell.14.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
101-
<HintPath>..\packages\Microsoft.VisualStudio.Shell.14.0.14.3.25407\lib\Microsoft.VisualStudio.Shell.14.0.dll</HintPath>
102-
<Private>True</Private>
103-
</Reference>
104-
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
105-
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Immutable.10.0.10.0.30319\lib\net40\Microsoft.VisualStudio.Shell.Immutable.10.0.dll</HintPath>
106-
<Private>True</Private>
107-
</Reference>
108-
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
109-
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Immutable.11.0.11.0.50727\lib\net45\Microsoft.VisualStudio.Shell.Immutable.11.0.dll</HintPath>
110-
<Private>True</Private>
111-
</Reference>
112-
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
113-
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Immutable.12.0.12.0.21003\lib\net45\Microsoft.VisualStudio.Shell.Immutable.12.0.dll</HintPath>
114-
<Private>True</Private>
115-
</Reference>
116-
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.14.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
117-
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Immutable.14.0.14.3.25407\lib\net45\Microsoft.VisualStudio.Shell.Immutable.14.0.dll</HintPath>
118-
<Private>True</Private>
119-
</Reference>
120-
<Reference Include="Microsoft.VisualStudio.Shell.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121-
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6071\lib\Microsoft.VisualStudio.Shell.Interop.dll</HintPath>
122-
<Private>True</Private>
123-
</Reference>
124-
<Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
125-
<EmbedInteropTypes>True</EmbedInteropTypes>
126-
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.10.0.10.0.30319\lib\Microsoft.VisualStudio.Shell.Interop.10.0.dll</HintPath>
127-
<Private>True</Private>
128-
</Reference>
129-
<Reference Include="Microsoft.VisualStudio.Shell.Interop.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
130-
<EmbedInteropTypes>True</EmbedInteropTypes>
131-
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.11.0.11.0.61030\lib\Microsoft.VisualStudio.Shell.Interop.11.0.dll</HintPath>
132-
<Private>True</Private>
133-
</Reference>
134-
<Reference Include="Microsoft.VisualStudio.Shell.Interop.12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
135-
<EmbedInteropTypes>True</EmbedInteropTypes>
136-
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.12.0.12.0.30110\lib\Microsoft.VisualStudio.Shell.Interop.12.0.dll</HintPath>
137-
<Private>True</Private>
138-
</Reference>
139-
<Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
140-
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.Shell.Interop.8.0.dll</HintPath>
141-
<Private>True</Private>
142-
</Reference>
143-
<Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
144-
<HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.9.0.9.0.30729\lib\Microsoft.VisualStudio.Shell.Interop.9.0.dll</HintPath>
145-
<Private>True</Private>
146-
</Reference>
147-
<Reference Include="Microsoft.VisualStudio.TextManager.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
148-
<HintPath>..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6070\lib\Microsoft.VisualStudio.TextManager.Interop.dll</HintPath>
149-
<Private>True</Private>
150-
</Reference>
151-
<Reference Include="Microsoft.VisualStudio.TextManager.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
152-
<HintPath>..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.TextManager.Interop.8.0.dll</HintPath>
153-
<Private>True</Private>
154-
</Reference>
155-
<Reference Include="Microsoft.VisualStudio.Threading, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
156-
<HintPath>..\packages\Microsoft.VisualStudio.Threading.14.1.131\lib\net45\Microsoft.VisualStudio.Threading.dll</HintPath>
157-
<Private>True</Private>
158-
</Reference>
159-
<Reference Include="Microsoft.VisualStudio.Utilities, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
160-
<HintPath>..\packages\Microsoft.VisualStudio.Utilities.14.3.25407\lib\net45\Microsoft.VisualStudio.Utilities.dll</HintPath>
161-
<Private>True</Private>
162-
</Reference>
163-
<Reference Include="Microsoft.VisualStudio.Validation, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
164-
<SpecificVersion>False</SpecificVersion>
165-
<HintPath>..\packages\Microsoft.VisualStudio.Validation.14.1.111\lib\net45\Microsoft.VisualStudio.Validation.dll</HintPath>
166-
</Reference>
16761
<Reference Include="PresentationCore" />
16862
<Reference Include="System" />
16963
<Reference Include="System.Core" />
@@ -226,8 +120,7 @@
226120
<None Include="app.config">
227121
<SubType>Designer</SubType>
228122
</None>
229-
<None Include="packages.config" />
230-
<None Include="source.extension.vsixmanifest">
123+
<None Include="Source.extension.vsixmanifest">
231124
<SubType>Designer</SubType>
232125
</None>
233126
</ItemGroup>
@@ -251,36 +144,25 @@
251144
</Content>
252145
<VSCTCompile Include="StackOverflowQuickLaunchPackage.vsct">
253146
<ResourceName>Menus.ctmenu</ResourceName>
147+
<SubType>Designer</SubType>
254148
</VSCTCompile>
255149
</ItemGroup>
256150
<ItemGroup>
257-
<BootstrapperPackage Include=".NETFramework,Version=v4.5">
258-
<Visible>False</Visible>
259-
<ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>
260-
<Install>true</Install>
261-
</BootstrapperPackage>
262-
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
263-
<Visible>False</Visible>
264-
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
265-
<Install>false</Install>
266-
</BootstrapperPackage>
267-
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
268-
<Visible>False</Visible>
269-
<ProductName>.NET Framework 3.5 SP1</ProductName>
270-
<Install>false</Install>
271-
</BootstrapperPackage>
151+
<PackageReference Include="Microsoft.VisualStudio.Shell.14.0">
152+
<Version>14.3.25407</Version>
153+
</PackageReference>
154+
<PackageReference Include="Microsoft.VisualStudio.Shell.Interop.12.0">
155+
<Version>12.0.30111</Version>
156+
</PackageReference>
157+
<PackageReference Include="Microsoft.VSSDK.BuildTools">
158+
<Version>15.9.3039</Version>
159+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
160+
<PrivateAssets>all</PrivateAssets>
161+
</PackageReference>
272162
</ItemGroup>
273163
<PropertyGroup>
274164
<UseCodebase>true</UseCodebase>
275165
</PropertyGroup>
276166
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
277167
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
278-
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
279-
<PropertyGroup>
280-
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
281-
</PropertyGroup>
282-
<Error Condition="!Exists('..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props'))" />
283-
<Error Condition="!Exists('..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.targets'))" />
284-
</Target>
285-
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.targets" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.15.0.26201\build\Microsoft.VSSDK.BuildTools.targets')" />
286168
</Project>

StackOverflowQuickLaunch/StackOverflowQuickLaunchPackage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace Aberus.StackOverflowQuickLaunch
2020
[PackageRegistration(UseManagedResourcesOnly = true)]
2121
// This attribute is used to register the information needed to show this package
2222
// in the Help/About dialog of Visual Studio.
23-
[InstalledProductRegistration("#110", "#112", "0.9.0", IconResourceID = 400)]
23+
[InstalledProductRegistration("#110", "#112", "1.0.0", IconResourceID = 400)]
2424
// Declare the package guid
2525
[Guid(GuidList.guidStackOverflowQuickLaunchQuickLaunchPkgString)]
2626
// Declare a global search provider supported by this package

StackOverflowQuickLaunch/StackOverflowSearchErrorListCommand.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ private void MenuItemCallback(object sender, EventArgs e)
9797
if (selected != null && selected.TryGetValue("text", out object text))
9898
{
9999
string description = (string)text;
100-
description = Regex.Replace(description, "'.*'", "''", RegexOptions.IgnoreCase);
100+
if(((StackOverflowQuickLaunchPackage)package).OptionPage.UseGenericSearch)
101+
description = Regex.Replace(description, "'.*'", "''", RegexOptions.IgnoreCase);
101102

102103
string searchQuery = selected.TryGetValue("errorcode", out object code) ? $"{code}: {description}" : description;
103104
string url = "https://stackoverflow.com/search?q=" + WebUtility.UrlEncode(searchQuery);

StackOverflowQuickLaunch/StackOverflowSearchOptionPage.cs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ public bool AlwayShowLink
4747

4848
int showResults = 40;
4949

50-
//[Category("My Category")]
51-
//[DisplayName("My Integer Option")]
52-
//[Description("My integer option")]
5350
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
5451
public int ShowResults
5552
{
@@ -98,6 +95,22 @@ public bool OpenInNewTab
9895
}
9996

10097

98+
bool useGenericSearch = false;
99+
100+
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
101+
public bool UseGenericSearch
102+
{
103+
get
104+
{
105+
return useGenericSearch;
106+
}
107+
set
108+
{
109+
if (value != useGenericSearch)
110+
useGenericSearch = value;
111+
}
112+
}
113+
101114
[Browsable(false)]
102115
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
103116
protected override System.Windows.Forms.IWin32Window Window
@@ -127,8 +140,6 @@ protected override void Dispose(bool disposing)
127140
}
128141
}
129142

130-
131-
132143
public enum Sort {
133144
//[Description("(default)")]
134145
//None = 0,

0 commit comments

Comments
 (0)