Skip to content

Commit

Permalink
Version 5.13:
Browse files Browse the repository at this point in the history
Supported VS 2012
Fixed memory leak in Codist components
  • Loading branch information
wmjordan committed Nov 4, 2021
1 parent 57eff43 commit e9adef0
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Codist/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace Codist
{
sealed class Config
{
internal const string CurrentVersion = "5.12.2";
internal const string CurrentVersion = "5.13.0";
const string ThemePrefix = "res:";
const int DefaultIconSize = 20;
internal const string LightTheme = ThemePrefix + "Light", PaleLightTheme = ThemePrefix + "PaleLight", DarkTheme = ThemePrefix + "Dark", SimpleTheme = ThemePrefix + "Simple";
Expand Down
20 changes: 18 additions & 2 deletions Codist/Helpers/SyncHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,44 @@
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using ThreadHelper = Microsoft.VisualStudio.Shell.ThreadHelper;

namespace Codist
{
static class SyncHelper
{
public static void RunSync(Func<Task> func) {
try {
Microsoft.VisualStudio.Shell.ThreadHelper.JoinableTaskFactory.Run(func);
ThreadHelper.JoinableTaskFactory.Run(func);
}
catch (OperationCanceledException) {
// ignore
}
}
public static TResult RunSync<TResult>(Func<Task<TResult>> func) {
try {
return Microsoft.VisualStudio.Shell.ThreadHelper.JoinableTaskFactory.Run(func);
return ThreadHelper.JoinableTaskFactory.Run(func);
}
catch (OperationCanceledException) {
return default;
}
}

/// <summary>Starts a task and forget it.</summary>
public static void FireAndForget(this Task task) {
ThreadHelper.JoinableTaskFactory.RunAsync(async () => {
try {
#pragma warning disable VSTHRD003 // As a fire-and-forget continuation, deadlocks can't happen.
await task.ConfigureAwait(false);
#pragma warning restore VSTHRD003
}
catch (Exception ex) {
// ignore error
Debug.WriteLine(ex.Message);
}
});
}

[DebuggerStepThrough]
public static CancellationToken CancelAndRetainToken(ref CancellationTokenSource tokenSource) {
return CancelAndDispose(ref tokenSource, true).GetToken();
Expand Down
2 changes: 1 addition & 1 deletion Codist/Helpers/ThemeHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static WpfBrush GetWpfBrush(this ThemeResourceKey resourceKey) {

public static void GetFontSettings(string categoryGuid, out string fontName, out int fontSize) {
ThreadHelper.ThrowIfNotOnUIThread();
var storage = (IVsFontAndColorStorage)ServiceProvider.GlobalProvider.GetService(typeof(SVsFontAndColorStorage));
var storage = ServicesHelper.Get<IVsFontAndColorStorage, SVsFontAndColorStorage>();
if (storage == null) {
goto EXIT;
}
Expand Down
2 changes: 1 addition & 1 deletion Codist/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
[assembly: AssemblyTrademark(nameof(Codist))]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("5.0.0.0")]
[assembly: AssemblyFileVersion("5.12.0.6600")]
[assembly: AssemblyFileVersion("5.13.0.6900")]
[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
6 changes: 3 additions & 3 deletions Codist/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?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="Codist.WMJ.c7b93d20-621f-4b21-9d28-d51157ef0b94" Version="5.12.0.6716" Language="en-US" Publisher="WMJ" />
<Identity Id="Codist.WMJ.c7b93d20-621f-4b21-9d28-d51157ef0b94" Version="5.13.0.6901" Language="en-US" Publisher="WMJ" />
<DisplayName>Codist</DisplayName>
<Description xml:space="preserve">A productivity booster for C# programmers which enhances syntax highlighting, quick info (tooltip), navigation bar, scrollbar, display quality and brings smart tool bar to code editor.</Description>
<MoreInfo>https://github.com/wmjordan/Codist</MoreInfo>
Expand All @@ -21,15 +21,15 @@
<InstallationTarget Version="[15.0,17.0)" Id="Microsoft.VisualStudio.Enterprise">
<ProductArchitecture>x86</ProductArchitecture>
</InstallationTarget>
<!--<InstallationTarget Version="[17.0,18.0)" Id="Microsoft.VisualStudio.Pro">
<InstallationTarget Version="[17.0,18.0)" Id="Microsoft.VisualStudio.Pro">
<ProductArchitecture>amd64</ProductArchitecture>
</InstallationTarget>
<InstallationTarget Version="[17.0,18.0)" Id="Microsoft.VisualStudio.Community">
<ProductArchitecture>amd64</ProductArchitecture>
</InstallationTarget>
<InstallationTarget Version="[17.0,18.0)" Id="Microsoft.VisualStudio.Enterprise">
<ProductArchitecture>amd64</ProductArchitecture>
</InstallationTarget>-->
</InstallationTarget>
</Installation>
<Prerequisites>
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,18.0)" DisplayName="Visual Studio core editor" />
Expand Down

0 comments on commit e9adef0

Please sign in to comment.