diff --git a/.hgtags b/.hgtags index 1aeb045..640d63d 100644 --- a/.hgtags +++ b/.hgtags @@ -5,3 +5,4 @@ a2f08454b36b86312e8f50b558f2d4bb49a6bd6d 1.2.1 f78cdbd81a75d21f3151c2d88d61cd715ba6ed1e 1.2.2 9ea8bdae25a0cb952ce199d73e4b2cb123e44e53 v1.3.0 8e823677b641a5321f5f43a2bc643c4b709c8cf6 v1.3.1 +79b45a7ad1f9b99a1df9d7b550ce7748d7791b81 v1.4 diff --git a/Lombiq.Vsix.Orchard/Commands/InjectDependencyCommand.cs b/Lombiq.Vsix.Orchard/Commands/InjectDependencyCommand.cs index da30ba7..fe4c541 100644 --- a/Lombiq.Vsix.Orchard/Commands/InjectDependencyCommand.cs +++ b/Lombiq.Vsix.Orchard/Commands/InjectDependencyCommand.cs @@ -20,7 +20,6 @@ internal sealed class InjectDependencyCommand public static readonly Guid CommandSet = PackageGuids.LombiqOrchardVisualStudioExtensionCommandSetGuid; - private readonly Package _package; private readonly IServiceProvider _serviceProvider; private readonly IMenuCommandService _menuCommandService; private readonly IDependencyInjector _dependencyInjector; @@ -31,7 +30,6 @@ internal sealed class InjectDependencyCommand private InjectDependencyCommand(Package package) { - _package = package; _serviceProvider = package; _dte = Package.GetGlobalService(typeof(SDTE)) as DTE; diff --git a/Lombiq.Vsix.Orchard/Commands/OpenErrorLogCommand.cs b/Lombiq.Vsix.Orchard/Commands/OpenErrorLogCommand.cs index 8b5c004..af456e2 100644 --- a/Lombiq.Vsix.Orchard/Commands/OpenErrorLogCommand.cs +++ b/Lombiq.Vsix.Orchard/Commands/OpenErrorLogCommand.cs @@ -19,7 +19,6 @@ internal sealed class OpenErrorLogCommand : IDisposable public static readonly Guid CommandSet = PackageGuids.LombiqOrchardVisualStudioExtensionCommandSetGuid; - private readonly Package _package; private readonly IServiceProvider _serviceProvider; private readonly IMenuCommandService _menuCommandService; private readonly DTE _dte; @@ -33,7 +32,6 @@ internal sealed class OpenErrorLogCommand : IDisposable private OpenErrorLogCommand(Package package) { - _package = package; _serviceProvider = package; _dte = Package.GetGlobalService(typeof(SDTE)) as DTE; diff --git a/Lombiq.Vsix.Orchard/LombiqOrchardVisualStudioExtensionPackage.cs b/Lombiq.Vsix.Orchard/LombiqOrchardVisualStudioExtensionPackage.cs index 87e5bd5..34ecb4b 100644 --- a/Lombiq.Vsix.Orchard/LombiqOrchardVisualStudioExtensionPackage.cs +++ b/Lombiq.Vsix.Orchard/LombiqOrchardVisualStudioExtensionPackage.cs @@ -9,29 +9,32 @@ using System; using System.ComponentModel.Design; using System.Runtime.InteropServices; +using System.Threading; namespace Lombiq.Vsix.Orchard { - [ProvideService(typeof(IDependencyInjector))] - [ProvideService(typeof(IFieldNameFromDependencyGenerator))] - [ProvideService(typeof(ILogWatcherSettingsAccessor))] - [ProvideService(typeof(ILogFileWatcher))] - [ProvideAutoLoad(VSConstants.UICONTEXT.SolutionExists_string)] - [PackageRegistration(UseManagedResourcesOnly = true)] + [ProvideService(typeof(IDependencyInjector), IsAsyncQueryable = true)] + [ProvideService(typeof(IFieldNameFromDependencyGenerator), IsAsyncQueryable = true)] + [ProvideService(typeof(ILogWatcherSettingsAccessor), IsAsyncQueryable = true)] + [ProvideService(typeof(ILogFileWatcher), IsAsyncQueryable = true)] + [ProvideAutoLoad(VSConstants.UICONTEXT.SolutionExists_string, PackageAutoLoadFlags.BackgroundLoad)] + [PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)] [InstalledProductRegistration("#LombiqOrchardVisualStudioExtensionName", "#LombiqOrchardVisualStudioExtensionDescription", "1.0", IconResourceID = 400)] [ProvideMenuResource("Menus.ctmenu", 1)] [ProvideOptionPage(typeof(LogWatcherOptionsPage), "Lombiq Orchard Visual Studio Extension", "Orchard Log Watcher", 120, 121, true)] [Guid(PackageGuids.LombiqOrchardVisualStudioExtensionPackageGuidString)] - public sealed class LombiqOrchardVisualStudioExtensionPackage : Package, ILogWatcherSettingsAccessor + public sealed class LombiqOrchardVisualStudioExtensionPackage : AsyncPackage, ILogWatcherSettingsAccessor { - protected override void Initialize() + protected override async System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress progress) { - base.Initialize(); + await base.InitializeAsync(cancellationToken, progress); RegisterServices(); InjectDependencyCommand.Initialize(this); OpenErrorLogCommand.Initialize(this); + + await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); } protected override void Dispose(bool disposing) diff --git a/Lombiq.Vsix.Orchard/Properties/AssemblyInfo.cs b/Lombiq.Vsix.Orchard/Properties/AssemblyInfo.cs index 0e2e52a..aa17a15 100644 --- a/Lombiq.Vsix.Orchard/Properties/AssemblyInfo.cs +++ b/Lombiq.Vsix.Orchard/Properties/AssemblyInfo.cs @@ -28,8 +28,8 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.4")] -[assembly: AssemblyFileVersion("1.4")] +[assembly: AssemblyVersion("1.4.1")] +[assembly: AssemblyFileVersion("1.4.1")] diff --git a/Lombiq.Vsix.Orchard/Readme.md b/Lombiq.Vsix.Orchard/Readme.md index d840cd2..f65bd72 100644 --- a/Lombiq.Vsix.Orchard/Readme.md +++ b/Lombiq.Vsix.Orchard/Readme.md @@ -27,6 +27,8 @@ This project is developed by [Lombiq Technologies Ltd](http://lombiq.com/). Comm ## Release notes +- 1.4.1, 20.10.2019 + - Fixing incompatibility issues with Visual Studio 2019. - 1.4, 17.06.2019 - Visual Studio 2019 compatibility added. - 1.3.1, 23.01.2019 diff --git a/Lombiq.Vsix.Orchard/Services/DependencyInjector/DependencyInjector.cs b/Lombiq.Vsix.Orchard/Services/DependencyInjector/DependencyInjector.cs index aea7cdc..2f9cb90 100644 --- a/Lombiq.Vsix.Orchard/Services/DependencyInjector/DependencyInjector.cs +++ b/Lombiq.Vsix.Orchard/Services/DependencyInjector/DependencyInjector.cs @@ -138,7 +138,6 @@ private static void GetConstructorLineIndex(DependencyInjectionContext context) for (int i = 0; i < context.CodeLines.Count; i++) { - var trimmedLine = context.CodeLines[i].Trim(); if (context.CodeLines[i].Trim().StartsWith(expectedConstructorStart, StringComparison.OrdinalIgnoreCase)) { context.ConstructorLineIndex = i; @@ -247,10 +246,8 @@ private static void InsertInjectionToConstructor(DependencyInjectionContext cont if (indexOfClosing < 0) continue; - var beforeClosing = ""; - var afterClosing = ""; - beforeClosing = context.CodeLines[i].Substring(0, indexOfClosing); - afterClosing = context.CodeLines[i].Substring(indexOfClosing); + var beforeClosing = context.CodeLines[i].Substring(0, indexOfClosing); + var afterClosing = context.CodeLines[i].Substring(indexOfClosing); context.CodeLines.RemoveAt(i); context.CodeLines.Insert(i, IndentText(indentSize, 1.5, injection + afterClosing)); diff --git a/Lombiq.Vsix.Orchard/Services/LogWatcher/LogFileWatcherBase.cs b/Lombiq.Vsix.Orchard/Services/LogWatcher/LogFileWatcherBase.cs index 0d7bf1c..1bab366 100644 --- a/Lombiq.Vsix.Orchard/Services/LogWatcher/LogFileWatcherBase.cs +++ b/Lombiq.Vsix.Orchard/Services/LogWatcher/LogFileWatcherBase.cs @@ -25,7 +25,7 @@ public abstract class LogFileWatcherBase : ILogFileWatcher public event EventHandler LogUpdated; - public LogFileWatcherBase(IServiceProvider serviceProvider) + protected LogFileWatcherBase(IServiceProvider serviceProvider) { _logWatcherSettingsAccessor = serviceProvider.GetService(); _dte = Package.GetGlobalService(typeof(SDTE)) as DTE; diff --git a/Lombiq.Vsix.Orchard/source.extension.vsixmanifest b/Lombiq.Vsix.Orchard/source.extension.vsixmanifest index 67420c6..c437773 100644 --- a/Lombiq.Vsix.Orchard/source.extension.vsixmanifest +++ b/Lombiq.Vsix.Orchard/source.extension.vsixmanifest @@ -1,7 +1,7 @@  - + Lombiq Orchard Visual Studio Extension Visual Studio extension with many features and templates frequently used by Lombiq developers. Contains Orchard-related as well as generic goodies. https://github.com/Lombiq/Lombiq-Visual-Studio-Extension