Skip to content

Commit

Permalink
Merge with dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Piedone committed Oct 20, 2019
2 parents 13b10c8 + 9f1662a commit 7439861
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 22 deletions.
1 change: 1 addition & 0 deletions .hgtags
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ a2f08454b36b86312e8f50b558f2d4bb49a6bd6d 1.2.1
f78cdbd81a75d21f3151c2d88d61cd715ba6ed1e 1.2.2
9ea8bdae25a0cb952ce199d73e4b2cb123e44e53 v1.3.0
8e823677b641a5321f5f43a2bc643c4b709c8cf6 v1.3.1
79b45a7ad1f9b99a1df9d7b550ce7748d7791b81 v1.4
2 changes: 0 additions & 2 deletions Lombiq.Vsix.Orchard/Commands/InjectDependencyCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -31,7 +30,6 @@ internal sealed class InjectDependencyCommand

private InjectDependencyCommand(Package package)
{
_package = package;
_serviceProvider = package;

_dte = Package.GetGlobalService(typeof(SDTE)) as DTE;
Expand Down
2 changes: 0 additions & 2 deletions Lombiq.Vsix.Orchard/Commands/OpenErrorLogCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -33,7 +32,6 @@ internal sealed class OpenErrorLogCommand : IDisposable

private OpenErrorLogCommand(Package package)
{
_package = package;
_serviceProvider = package;

_dte = Package.GetGlobalService(typeof(SDTE)) as DTE;
Expand Down
21 changes: 12 additions & 9 deletions Lombiq.Vsix.Orchard/LombiqOrchardVisualStudioExtensionPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ServiceProgressData> 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)
Expand Down
4 changes: 2 additions & 2 deletions Lombiq.Vsix.Orchard/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]



2 changes: 2 additions & 0 deletions Lombiq.Vsix.Orchard/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public abstract class LogFileWatcherBase : ILogFileWatcher
public event EventHandler<LogChangedEventArgs> LogUpdated;


public LogFileWatcherBase(IServiceProvider serviceProvider)
protected LogFileWatcherBase(IServiceProvider serviceProvider)
{
_logWatcherSettingsAccessor = serviceProvider.GetService<ILogWatcherSettingsAccessor>();
_dte = Package.GetGlobalService(typeof(SDTE)) as DTE;
Expand Down
2 changes: 1 addition & 1 deletion Lombiq.Vsix.Orchard/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="1a2f7a53-92bd-4396-b49c-98a9bfcc1d41" Version="1.4" Language="en-US" Publisher="Lombiq Technologies" />
<Identity Id="1a2f7a53-92bd-4396-b49c-98a9bfcc1d41" Version="1.4.1" Language="en-US" Publisher="Lombiq Technologies" />
<DisplayName>Lombiq Orchard Visual Studio Extension</DisplayName>
<Description xml:space="preserve">Visual Studio extension with many features and templates frequently used by Lombiq developers. Contains Orchard-related as well as generic goodies.</Description>
<MoreInfo>https://github.com/Lombiq/Lombiq-Visual-Studio-Extension</MoreInfo>
Expand Down

0 comments on commit 7439861

Please sign in to comment.