Skip to content

Commit

Permalink
Created new version for VS2019 with new GUID.
Browse files Browse the repository at this point in the history
Also fixed issue with loading Map Mode scroll bar.
  • Loading branch information
justcla committed Nov 23, 2021
1 parent 56cdfad commit ef092c4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
1 change: 1 addition & 0 deletions SublimeVS/ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
SublimeVS
23-Nov-2021 v1.3.0 New version created just for VS2017-VS2019 support. New branch 'VS2019'
06-May-2020 v1.2.1 Switched package loading to be Async (VS2019 requirement)
05-May-2020 v1.2.0 Upgraded to VS2019
21-May-2018 v1.1.0 Replaced MixEdit with SelectNextOccurrence
Expand Down
27 changes: 15 additions & 12 deletions SublimeVS/SublimeSettingsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System.IO;
using System.Reflection;
using System.ComponentModel.Design;
using Task = System.Threading.Tasks.Task;

namespace SublimeVS
{
Expand Down Expand Up @@ -39,7 +40,7 @@ public static SublimeSettingsManager Instance
private set;
}

public static async System.Threading.Tasks.Task InitializeAsync(AsyncPackage package)
public static async Task InitializeAsync(AsyncPackage package)
{
Instance = new SublimeSettingsManager(package);
await Instance.InitializeAsync();
Expand All @@ -51,7 +52,7 @@ private SublimeSettingsManager(AsyncPackage package)
this.package = package ?? throw new ArgumentNullException("package");
}

public async System.Threading.Tasks.Task InitializeAsync()
public async Task InitializeAsync()
{

if (await AsyncServiceProvider.GetServiceAsync(typeof(IMenuCommandService)) is OleMenuCommandService commandService)
Expand All @@ -72,23 +73,23 @@ public void ApplySublimeVSSettings(object sender, EventArgs e)
ApplySublimeVSSettingsAsync();
}

public async System.Threading.Tasks.Task ApplySublimeVSSettingsAsync()
public async Task ApplySublimeVSSettingsAsync()
{
// Offer to apply MiniMap (Map Mode Scrollbar)
ApplyMiniMap();
await ApplyMiniMapAsync();

// Offer to apply Sublime shortcut scheme
await ApplyShortcutsAsync("Sublime Text Shortcuts", SublimeSettingsFileName);
}

//-------- MiniMap Settings --------

public void ApplyMiniMap()
public async Task ApplyMiniMapAsync()
{
// Confirm with user before applying MiniMap
if (ConfirmApplyMinimap())
{
ApplyMapModeScrollbar();
await ApplyMapModeScrollbarAsync();
}

}
Expand All @@ -104,13 +105,15 @@ private static bool ConfirmApplyMinimap()
return MessageBox.Show(message, title, MessageBoxButtons.OKCancel) == DialogResult.OK;
}

private void ApplyMapModeScrollbar()
private async Task ApplyMapModeScrollbarAsync()
{
try
{
var dte2 = (DTE2)AsyncServiceProvider.GetServiceAsync(typeof(DTE));
UpdateSetting(dte2, "TextEditor", "AllLanguages", "UseMapMode", true);
UpdateSetting(dte2, "TextEditor", "AllLanguages", "OverviewWidth", (short)83);
if (await AsyncServiceProvider.GetServiceAsync(typeof(DTE)) is DTE2 dte2)
{
UpdateSetting(dte2, "TextEditor", "AllLanguages", "UseMapMode", true);
UpdateSetting(dte2, "TextEditor", "AllLanguages", "OverviewWidth", (short)83);
}
}
catch (Exception e)
{
Expand All @@ -126,7 +129,7 @@ private static void UpdateSetting(DTE2 dte2, string category, string page, strin

//------------ Shortcut Settings --------------

public async System.Threading.Tasks.Task ApplyShortcutsAsync(string shortcutSchemeName, string vssettingsFilename)
public async Task ApplyShortcutsAsync(string shortcutSchemeName, string vssettingsFilename)
{

//Ask user if they want to apply shortcuts
Expand All @@ -147,7 +150,7 @@ private bool ConfirmApplyShortcuts(string shortcutSchemeName)
return MessageBox.Show(message, title, MessageBoxButtons.OKCancel) == DialogResult.OK;
}

private async System.Threading.Tasks.Task ImportUserSettingsAsync(string settingsFileName)
private async Task ImportUserSettingsAsync(string settingsFileName)
{
if (await AsyncServiceProvider.GetServiceAsync(typeof(SVsUIShell)) is IVsUIShell shell)
{
Expand Down
12 changes: 6 additions & 6 deletions SublimeVS/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="SublimeVS.7b1efb7d-cb70-46f9-a1aa-90b14f4a7b34" Version="1.2.1" Language="en-US" Publisher="Justin Clareburt" />
<DisplayName>SublimeVS</DisplayName>
<Description xml:space="preserve">Provides some Sublime Text features in Visual Studio</Description>
<MoreInfo>https://marketplace.visualstudio.com/items?itemName=JustinClareburtMSFT.SublimeVS</MoreInfo>
<Identity Id="SublimeVS.aa986349-a9ff-4f6d-96b5-34b620cbebaa" Version="1.3.0" Language="en-US" Publisher="Justin Clareburt" />
<DisplayName>SublimeVS 2017-2019</DisplayName>
<Description xml:space="preserve">Provides some Sublime Text features in Visual Studio. Compatible with VS2017 and VS2019 only.</Description>
<MoreInfo>https://marketplace.visualstudio.com/items?itemName=JustinClareburtMSFT.SublimeVS2019</MoreInfo>
<License>License.rtf</License>
<GettingStartedGuide>https://github.com/justcla/SublimeVS</GettingStartedGuide>
<ReleaseNotes>https://github.com/justcla/SublimeVS/blob/master/SublimeVS/ReleaseNotes.txt</ReleaseNotes>
<ReleaseNotes>https://github.com/justcla/SublimeVS/blob/VS2019/SublimeVS/ReleaseNotes.txt</ReleaseNotes>
<Icon>Resources\Market_SublimeVs_90x.png</Icon>
<Tags>Sublime</Tags>
</Metadata>
<Installation>
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[15.0,)" />
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[15.0,17.0)" />
</Installation>
<Dependencies>
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
Expand Down

0 comments on commit ef092c4

Please sign in to comment.