diff --git a/FortranCodeNav/FortranCodeNav.cs b/FortranCodeNav/FortranCodeNav.cs index 0a7b80a..991f8e9 100644 --- a/FortranCodeNav/FortranCodeNav.cs +++ b/FortranCodeNav/FortranCodeNav.cs @@ -11,6 +11,7 @@ using Microsoft.VisualStudio.Shell.Interop; using EnvDTE80; using EnvDTE; +using System.Threading; namespace FortranCodeNav { @@ -31,15 +32,15 @@ namespace FortranCodeNav /// To get loaded into VS, the package must be referred by <Asset Type="Microsoft.VisualStudio.VsPackage" ...> in .vsixmanifest file. /// /// - [PackageRegistration(UseManagedResourcesOnly = true)] + [PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)] [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)] // Info on this package for Help/About [Guid(FortranCodeNav.PackageGuidString)] [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "pkgdef, VS and vsixmanifest are valid VS terms")] [ProvideMenuResource("Menus.ctmenu", 1)] - [ProvideAutoLoad(UIContextGuids.NoSolution)] - [ProvideAutoLoad(UIContextGuids.SolutionExists)] - public sealed class FortranCodeNav : Package + [ProvideAutoLoad(UIContextGuids.NoSolution, PackageAutoLoadFlags.BackgroundLoad)] + [ProvideAutoLoad(UIContextGuids.SolutionExists, PackageAutoLoadFlags.BackgroundLoad)] + public sealed class FortranCodeNav : AsyncPackage { /// /// FortranCodeNav GUID string. @@ -62,14 +63,19 @@ public FortranCodeNav() private readonly VSIntegration.VisualStudioIDE vsIntegration = new VSIntegration.VisualStudioIDE(); private FortranCodeNavCore.FortranCodeNavCore fortranCodeNav; + protected override async System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress progress) + { + await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); + InitializeCore(); + await base.InitializeAsync(cancellationToken, progress); + } + /// /// Initialization of the package; this method is called right after the package is sited, so this is the place /// where you can put all the initialization code that rely on services provided by VisualStudio. /// - protected override void Initialize() + private void InitializeCore() { - base.Initialize(); - var applicationObject = (DTE2)GetService(typeof(DTE)); vsIntegration.OnConnect(applicationObject); fortranCodeNav = new FortranCodeNavCore.FortranCodeNavCore(vsIntegration); diff --git a/FortranCodeNav/FortranCodeNav.csproj b/FortranCodeNav/FortranCodeNav.csproj index da7be7a..1674601 100644 --- a/FortranCodeNav/FortranCodeNav.csproj +++ b/FortranCodeNav/FortranCodeNav.csproj @@ -114,27 +114,22 @@ False - + + ..\packages\Microsoft.Bcl.AsyncInterfaces.5.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + - ..\packages\Microsoft.VisualStudio.CoreUtility.14.1.24720\lib\net45\Microsoft.VisualStudio.CoreUtility.dll - True + ..\packages\Microsoft.VisualStudio.CoreUtility.14.3.25407\lib\net45\Microsoft.VisualStudio.CoreUtility.dll ..\packages\VSSDK.OLE.Interop.7.0.4\lib\net20\Microsoft.VisualStudio.OLE.Interop.dll True False - - ..\packages\VSSDK.Shell.11.11.0.4\lib\net45\Microsoft.VisualStudio.Shell.11.0.dll - False - - - - ..\packages\VSSDK.Shell.Interop.7.0.4\lib\net20\Microsoft.VisualStudio.Shell.Interop.dll - True - False - + + + + True @@ -143,15 +138,19 @@ ..\packages\VSSDK.Shell.Interop.11.11.0.4\lib\net20\Microsoft.VisualStudio.Shell.Interop.11.0.dll True + + True + + + True + - ..\packages\Microsoft.VisualStudio.Text.Data.14.1.24720\lib\net45\Microsoft.VisualStudio.Text.Data.dll - True + ..\packages\Microsoft.VisualStudio.Text.Data.14.3.25407\lib\net45\Microsoft.VisualStudio.Text.Data.dll - ..\packages\Microsoft.VisualStudio.Text.Logic.14.1.24720\lib\net45\Microsoft.VisualStudio.Text.Logic.dll - True + ..\packages\Microsoft.VisualStudio.Text.Logic.14.3.25407\lib\net45\Microsoft.VisualStudio.Text.Logic.dll ..\packages\Microsoft.VisualStudio.Text.UI.14.1.24720\lib\net45\Microsoft.VisualStudio.Text.UI.dll @@ -166,18 +165,7 @@ True False - - ..\packages\Microsoft.VisualStudio.Threading.14.1.111\lib\net45\Microsoft.VisualStudio.Threading.dll - True - - - ..\packages\Microsoft.VisualStudio.Utilities.14.1.24720\lib\net45\Microsoft.VisualStudio.Utilities.dll - True - - - ..\packages\Microsoft.VisualStudio.Validation.14.1.111\lib\net45\Microsoft.VisualStudio.Validation.dll - True - + @@ -186,6 +174,12 @@ + + ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + + + ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll + @@ -210,7 +204,11 @@ VSIntegration - + + + + + @@ -221,9 +219,11 @@ + + - - - - - - - - - - - - - + + + Fortran CodeNav + Fortran CodeNav helps you to easily jump and search through Fortran 90 code and also provides code completion (IntelliSense). + https://www.youtube.com/watch?v=ApumbtDAqMM + fortran_codenav_32_nobg.png + fortran_codenav_200_nobg.png + Fortran; code completion; Intellisense; f90; f77; f70 + + + + + + + + + + + + + + + + + + + +