From f5b09bd6488e58851a9be2c48bfbaf6b468301d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joni-Matti=20M=C3=A4=C3=A4tt=C3=A4?= Date: Thu, 24 Sep 2020 13:13:06 +0300 Subject: [PATCH 1/2] Service for doxygen config Changed Doxygen config from a singleton to a service. --- AutoDoxyDoc/AutoDoxyDoc.csproj | 1 + AutoDoxyDoc/AutoDoxyDocPackage.cs | 22 ++++++- AutoDoxyDoc/CompletionHandlerProvider.cs | 9 ++- AutoDoxyDoc/CompletionSourceProvider.cs | 13 +++- .../DoxygenCompletionCommandHandler.cs | 26 +++++--- AutoDoxyDoc/DoxygenCompletionSource.cs | 23 +++++-- AutoDoxyDoc/DoxygenConfig.cs | 5 -- AutoDoxyDoc/DoxygenConfigService.cs | 34 +++++++++++ AutoDoxyDoc/DoxygenGenerator.cs | 61 +++++++++++-------- AutoDoxyDoc/GenerateComment.cs | 9 ++- AutoDoxyDoc/OptionsPage.cs | 7 ++- 11 files changed, 159 insertions(+), 51 deletions(-) create mode 100644 AutoDoxyDoc/DoxygenConfigService.cs diff --git a/AutoDoxyDoc/AutoDoxyDoc.csproj b/AutoDoxyDoc/AutoDoxyDoc.csproj index 33ade22..313a068 100644 --- a/AutoDoxyDoc/AutoDoxyDoc.csproj +++ b/AutoDoxyDoc/AutoDoxyDoc.csproj @@ -65,6 +65,7 @@ AbbreviationsEditorDialog.cs + diff --git a/AutoDoxyDoc/AutoDoxyDocPackage.cs b/AutoDoxyDoc/AutoDoxyDocPackage.cs index f944e96..15f2faa 100644 --- a/AutoDoxyDoc/AutoDoxyDocPackage.cs +++ b/AutoDoxyDoc/AutoDoxyDocPackage.cs @@ -36,7 +36,10 @@ namespace AutoDoxyDoc [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)] // Info on this package for Help/About [ProvideMenuResource("Menus.ctmenu", 1)] [Guid(AutoDoxyDocPackage.PackageGuidString)] - [ProvideAutoLoad(UIContextGuids.SolutionExists/*, PackageAutoLoadFlags.BackgroundLoad*/)] // TODO: Enable background load. It is currently disabled because for some reason the package doesn't always load. + [ProvideService(typeof(DoxygenConfigService), IsAsyncQueryable = true)] + //[ProvideAutoLoad(VSConstants.UICONTEXT.SolutionExists_string, PackageAutoLoadFlags.BackgroundLoad)] // TODO: Enable background load. It is currently disabled because for some reason the package doesn't always load. + //[ProvideAutoLoad(VSConstants.UICONTEXT.NoSolution_string, PackageAutoLoadFlags.BackgroundLoad)] + //[ProvideAutoLoad(UIContextGuids80.NoSolution, PackageAutoLoadFlags.BackgroundLoad)] //[ProvideAutoLoad(UIContextGuids.SolutionExists)] // TODO: Should be changed to async load but for some reason it is not loaded properly in that case. [ProvideOptionPage(typeof(OptionsPage), "AutoDoxyDoc", "General", 0, 0, true)] [ProvideProfileAttribute(typeof(OptionsPage), "AutoDoxyDoc", "AutoDoxyDoc Settings", 106, 107, isToolsOptionPage: true, DescriptionResourceID = 108)] @@ -70,17 +73,32 @@ public AutoDoxyDocPackage() /// A task representing the async work of package initialization, or an already completed task if there is none. Do not return null from this method. protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress progress) { + AddService(typeof(DoxygenConfigService), CreateDoxygenConfigServiceAsync, true); + // When initialized asynchronously, the current thread may be a background thread at this point. // Do any initialization that requires the UI thread after switching to the UI thread. await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); // Load Doxygen configuration. OptionsPage page = (OptionsPage)GetDialogPage(typeof(OptionsPage)); - DoxygenConfig.Instance.LoadSettings(page); + + var configService = await GetServiceAsync(typeof(DoxygenConfigService)) as DoxygenConfigService; + + if (configService != null) + { + configService.Config.LoadSettings(page); + } await GenerateComment.InitializeAsync(this); } + private async Task CreateDoxygenConfigServiceAsync(IAsyncServiceContainer container, CancellationToken cancellationToken, Type serviceType) + { + var svc = new DoxygenConfigService(); + await svc.InitializeAsync(this, cancellationToken); + return svc; + } + #endregion } } diff --git a/AutoDoxyDoc/CompletionHandlerProvider.cs b/AutoDoxyDoc/CompletionHandlerProvider.cs index 404e645..2120ebb 100644 --- a/AutoDoxyDoc/CompletionHandlerProvider.cs +++ b/AutoDoxyDoc/CompletionHandlerProvider.cs @@ -33,6 +33,13 @@ public void VsTextViewCreated(IVsTextView textViewAdapter) { try { + var configService = ServiceProvider.GetService(typeof(DoxygenConfigService)) as DoxygenConfigService; + + if (configService == null) + { + return; + } + IWpfTextView textView = this.AdapterService.GetWpfTextView(textViewAdapter); if (textView == null) { @@ -43,7 +50,7 @@ public void VsTextViewCreated(IVsTextView textViewAdapter) { ThreadHelper.ThrowIfNotOnUIThread(); var dte = ServiceProvider.GetService(typeof(DTE)) as DTE; - return new DoxygenCompletionCommandHandler(textViewAdapter, textView, this, dte); + return new DoxygenCompletionCommandHandler(textViewAdapter, textView, this, dte, configService); }; textView.Properties.GetOrCreateSingletonProperty(createCommandHandler); diff --git a/AutoDoxyDoc/CompletionSourceProvider.cs b/AutoDoxyDoc/CompletionSourceProvider.cs index 3319968..b1f47f3 100644 --- a/AutoDoxyDoc/CompletionSourceProvider.cs +++ b/AutoDoxyDoc/CompletionSourceProvider.cs @@ -1,4 +1,5 @@ using Microsoft.VisualStudio.Language.Intellisense; +using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Text.Operations; using Microsoft.VisualStudio.Utilities; @@ -17,6 +18,9 @@ public class CompletionSourceProvider : ICompletionSourceProvider [Import] internal IGlyphService GlyphService { get; set; } + [Import] + internal SVsServiceProvider ServiceProvider { get; set; } + /// /// Tries to create a Doxygen completion source. /// @@ -24,7 +28,14 @@ public class CompletionSourceProvider : ICompletionSourceProvider /// public ICompletionSource TryCreateCompletionSource(ITextBuffer textBuffer) { - return new DoxygenCompletionSource(this, textBuffer); + var configService = ServiceProvider.GetService(typeof(DoxygenConfigService)) as DoxygenConfigService; + + if (configService == null) + { + return null; + } + + return new DoxygenCompletionSource(this, textBuffer, configService); } } } \ No newline at end of file diff --git a/AutoDoxyDoc/DoxygenCompletionCommandHandler.cs b/AutoDoxyDoc/DoxygenCompletionCommandHandler.cs index 646c595..f67d087 100644 --- a/AutoDoxyDoc/DoxygenCompletionCommandHandler.cs +++ b/AutoDoxyDoc/DoxygenCompletionCommandHandler.cs @@ -26,11 +26,12 @@ public class DoxygenCompletionCommandHandler : IOleCommandTarget /// /// /// - public DoxygenCompletionCommandHandler(IVsTextView textViewAdapter, IWpfTextView textView, CompletionHandlerProvider provider, DTE dte) + public DoxygenCompletionCommandHandler(IVsTextView textViewAdapter, IWpfTextView textView, CompletionHandlerProvider provider, DTE dte, DoxygenConfigService configService) { - this.m_textView = textView; - this.m_provider = provider; - this.m_dte = dte; + m_textView = textView; + m_provider = provider; + m_dte = dte; + m_configService = configService; // Add the command to the command chain. if (textViewAdapter != null && @@ -41,12 +42,17 @@ public DoxygenCompletionCommandHandler(IVsTextView textViewAdapter, IWpfTextView textViewAdapter.AddCommandFilter(this, out m_nextCommandHandler); } - m_generator = new DoxygenGenerator(m_config); + m_generator = new DoxygenGenerator(m_configService); - m_config.ConfigChanged += onDoxygenConfigChanged; + m_configService.Config.ConfigChanged += onDoxygenConfigChanged; onDoxygenConfigChanged(this, EventArgs.Empty); } + ~DoxygenCompletionCommandHandler() + { + m_configService.Config.ConfigChanged -= onDoxygenConfigChanged; + } + public int QueryStatus(ref Guid pguidCmdGroup, uint cCmds, OLECMD[] prgCmds, IntPtr pCmdText) { ThreadHelper.ThrowIfNotOnUIThread(); @@ -128,7 +134,7 @@ public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pv int retVal = m_nextCommandHandler.Exec(ref pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut); // Start auto-completion session for doxygen tags and parameter names. - if (!IsAutoCompletionActive() && (typedChar == m_config.TagChar || typedChar == '[')) + if (!IsAutoCompletionActive() && (typedChar == m_configService.Config.TagChar || typedChar == '[')) { string currentLine = m_textView.TextSnapshot.GetLineFromPosition( m_textView.Caret.Position.BufferPosition.Position).GetText(); @@ -239,7 +245,7 @@ private void NewCommentLine(string currentLine) { if (m_regexTagSection.IsMatch(currentLine)) { - extraIndent = m_config.TagIndentation; + extraIndent = m_configService.Config.TagIndentation; break; } @@ -455,7 +461,7 @@ private static bool IsInsideComment(string line) /// private void onDoxygenConfigChanged(object sender, EventArgs e) { - m_regexTagSection = new Regex(@"\*\s+\" + m_config.TagChar + @"([a-z]+)\s+(.+)$", RegexOptions.Compiled); + m_regexTagSection = new Regex(@"\*\s+\" + m_configService.Config.TagChar + @"([a-z]+)\s+(.+)$", RegexOptions.Compiled); } //! Next command handler. @@ -474,7 +480,7 @@ private void onDoxygenConfigChanged(object sender, EventArgs e) private DTE m_dte; //! Doxygen config. - DoxygenConfig m_config = DoxygenConfig.Instance; + DoxygenConfigService m_configService; //! Doxygen generator. DoxygenGenerator m_generator; diff --git a/AutoDoxyDoc/DoxygenCompletionSource.cs b/AutoDoxyDoc/DoxygenCompletionSource.cs index a66c828..6a46662 100644 --- a/AutoDoxyDoc/DoxygenCompletionSource.cs +++ b/AutoDoxyDoc/DoxygenCompletionSource.cs @@ -17,12 +17,13 @@ public class DoxygenCompletionSource : ICompletionSource /// /// /// - public DoxygenCompletionSource(CompletionSourceProvider sourceProvider, ITextBuffer textBuffer) + public DoxygenCompletionSource(CompletionSourceProvider sourceProvider, ITextBuffer textBuffer, DoxygenConfigService configService) { m_sourceProvider = sourceProvider; m_textBuffer = textBuffer; + m_configService = configService; CreateCompletionLists(); - + m_configService.Config.ConfigChanged += onConfigChanged; } /// @@ -68,7 +69,7 @@ void ICompletionSource.AugmentCompletionSession(ICompletionSession session, ILis compList = m_compListDir; } // Generic doxygen tags. - else if (prevChar == '@') + else if (prevChar == m_configService.Config.TagChar) { compList = m_compListTag; } @@ -96,6 +97,7 @@ public void Dispose() { if (!m_disposed) { + m_configService.Config.ConfigChanged -= onConfigChanged; GC.SuppressFinalize(this); m_disposed = true; } @@ -166,16 +168,29 @@ private void CreateCompletionLists() /// Image for the completion listbox. private void AddCompletionTag(string name, ImageSource image) { - string tag = DoxygenConfig.Instance.TagChar + name; + string tag = m_configService.Config.TagChar + name; m_compListTag.Add(new Completion(tag, tag, string.Empty, image, string.Empty)); } + /// + /// Called when the Doxygen configuration has changed. + /// + /// + /// + private void onConfigChanged(object sender, EventArgs e) + { + CreateCompletionLists(); + } + //! Completion source provider. private CompletionSourceProvider m_sourceProvider; //! Text buffer. private ITextBuffer m_textBuffer; + //! Doxygen configuration service. + private DoxygenConfigService m_configService; + // List of tag completions. private List m_compListTag = new List(); diff --git a/AutoDoxyDoc/DoxygenConfig.cs b/AutoDoxyDoc/DoxygenConfig.cs index aeaa533..07452a0 100644 --- a/AutoDoxyDoc/DoxygenConfig.cs +++ b/AutoDoxyDoc/DoxygenConfig.cs @@ -70,11 +70,6 @@ public char TagChar public string ReturnBooleanDescFormat { get; set; } = "True if {0}. False if not."; public string ParamBooleanFormat { get; set; } = "If true, {0}. Otherwise not {0}."; - /// - /// Singleton instance. - /// - public static DoxygenConfig Instance { get; } = new DoxygenConfig(); - /// /// Constructor. /// diff --git a/AutoDoxyDoc/DoxygenConfigService.cs b/AutoDoxyDoc/DoxygenConfigService.cs new file mode 100644 index 0000000..44efd9e --- /dev/null +++ b/AutoDoxyDoc/DoxygenConfigService.cs @@ -0,0 +1,34 @@ +using Microsoft.VisualStudio.Shell; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Task = System.Threading.Tasks.Task; + +namespace AutoDoxyDoc +{ + /// + /// Doxygen configuration service for accessing Doxygen configuration. + /// + public class DoxygenConfigService + { + /// + /// Global doxygen configuration. + /// + public DoxygenConfig Config { get; private set; } + + /// + /// Initializes the config service asynchronously. + /// + /// + /// + /// + public async Task InitializeAsync(IAsyncServiceProvider provider, CancellationToken cancellationToken) + { + await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); + Config = new DoxygenConfig(); + } + } +} diff --git a/AutoDoxyDoc/DoxygenGenerator.cs b/AutoDoxyDoc/DoxygenGenerator.cs index 92400b3..4edb91a 100644 --- a/AutoDoxyDoc/DoxygenGenerator.cs +++ b/AutoDoxyDoc/DoxygenGenerator.cs @@ -8,16 +8,27 @@ namespace AutoDoxyDoc { - + /// + /// Doxygen comment generator. + /// class DoxygenGenerator { - public DoxygenGenerator(DoxygenConfig config) + /// + /// Constructor. + /// + /// Doxygen configuration service. + public DoxygenGenerator(DoxygenConfigService configService) { - m_config = config; - m_config.ConfigChanged += onConfigChanged; + m_configService = configService; + m_configService.Config.ConfigChanged += onConfigChanged; InitStyle(); } + ~DoxygenGenerator() + { + m_configService.Config.ConfigChanged -= onConfigChanged; + } + /// /// Generates smart indentation for the current line. /// @@ -88,7 +99,7 @@ public string GenerateComment(string spaces, CodeElement codeElement, string exi sb.Append("\r\n" + spaces + " * "); // Try to determine initial main comment if comment auto-generation is enabled. - if (m_config.SmartComments) + if (Config.SmartComments) { sb.Append(TryGenerateBriefDesc(codeElement)); } @@ -143,7 +154,7 @@ public string GenerateComment(string spaces, CodeElement codeElement, string exi string typeDirName = DirectionToString(GetParamDirection(param, parsedParam)); string paramAlignSpaces = new string(' ', maxParamNameLength - param.Name.Length + 2); string typeAlignSpaces = new string(' ', maxTypeDirectionLength - typeDirName.Length + 1); - string tagLine = m_indentString + m_config.TagChar + "param " + typeDirName + typeAlignSpaces + param.Name + paramAlignSpaces; + string tagLine = m_indentString + Config.TagChar + "param " + typeDirName + typeAlignSpaces + param.Name + paramAlignSpaces; sb.Append("\r\n" + spaces + " * " + tagLine); // Add existing comments. @@ -151,7 +162,7 @@ public string GenerateComment(string spaces, CodeElement codeElement, string exi { AppendComments(sb, parsedParam.Comments, spaces, tagLine.Length); } - else if (m_config.SmartComments && codeElement.Children.Count == 1) + else if (Config.SmartComments && codeElement.Children.Count == 1) { sb.Append(TryGenerateParamDesc(codeElement, param)); } @@ -162,14 +173,14 @@ public string GenerateComment(string spaces, CodeElement codeElement, string exi if (function.Type.AsString != "void") { sb.Append("\r\n" + spaces + " *"); - string tagLine = m_indentString + m_config.TagChar + "return "; + string tagLine = m_indentString + Config.TagChar + "return "; sb.Append("\r\n" + spaces + " * " + tagLine); if (parsedComment.Returns != null) { AppendComments(sb, parsedComment.Returns.Comments, spaces, tagLine.Length); } - else if (m_config.SmartComments) + else if (Config.SmartComments) { sb.Append(TryGenerateReturnDesc(function)); } @@ -179,7 +190,7 @@ public string GenerateComment(string spaces, CodeElement codeElement, string exi // Write other sections that were in the existing comments. foreach (ParsedSection section in parsedComment.TagSections) { - string tagLine = m_indentString + m_config.TagChar + section.TagName + " "; + string tagLine = m_indentString + Config.TagChar + section.TagName + " "; sb.Append("\r\n" + spaces + " *"); sb.Append("\r\n" + spaces + " * " + tagLine); AppendComments(sb, section.Comments, spaces, tagLine.Length); @@ -488,19 +499,19 @@ private string TryGenerateBriefDesc(CodeElement codeElement) { if (getter) { - desc = String.Format(m_config.BriefGetterDescFormat, UnabbreviateAndJoin(funcNameWords, 1), owner); + desc = String.Format(Config.BriefGetterDescFormat, UnabbreviateAndJoin(funcNameWords, 1), owner); } else if (setter) { - desc = String.Format(m_config.BriefSetterDescFormat, UnabbreviateAndJoin(funcNameWords, 1), owner); + desc = String.Format(Config.BriefSetterDescFormat, UnabbreviateAndJoin(funcNameWords, 1), owner); } else if (boolGetter) { - desc = String.Format(m_config.BriefBoolGetterDescFormat, UnabbreviateAndJoin(funcNameWords, 1), className + " ", funcNameWords[0]); + desc = String.Format(Config.BriefBoolGetterDescFormat, UnabbreviateAndJoin(funcNameWords, 1), className + " ", funcNameWords[0]); } } } - else if (m_config.SmartCommentsForAllFunctions) + else if (Config.SmartCommentsForAllFunctions) { // Allow smart comments for single word functions only in case they are class members. // All other functions are supported. @@ -550,12 +561,12 @@ private string TryGenerateParamDesc(CodeElement parent, CodeParameter param) if (isBoolean) { string[] words = StringHelper.SplitCamelCase(param.Name); - desc = StringHelper.Capitalize(String.Format(m_config.ParamBooleanFormat, UnabbreviateAndJoin(words))); + desc = StringHelper.Capitalize(String.Format(Config.ParamBooleanFormat, UnabbreviateAndJoin(words))); } else if (setter || getter) { string[] words = StringHelper.SplitCamelCase(param.Name); - desc = StringHelper.Capitalize(String.Format(m_config.ParamSetterDescFormat, UnabbreviateAndJoin(words))); + desc = StringHelper.Capitalize(String.Format(Config.ParamSetterDescFormat, UnabbreviateAndJoin(words))); } return desc; @@ -576,15 +587,15 @@ private string TryGenerateReturnDesc(CodeFunction function) { if (words[0] == "get") { - desc = StringHelper.Capitalize(String.Format(m_config.ReturnDescFormat, UnabbreviateAndJoin(words, 1))); + desc = StringHelper.Capitalize(String.Format(Config.ReturnDescFormat, UnabbreviateAndJoin(words, 1))); } else if (words[0] == "is") { - desc = StringHelper.Capitalize(String.Format(m_config.ReturnBooleanDescFormat, UnabbreviateAndJoin(words, 1))); + desc = StringHelper.Capitalize(String.Format(Config.ReturnBooleanDescFormat, UnabbreviateAndJoin(words, 1))); } else if (words[0] == "has") { - desc = StringHelper.Capitalize(String.Format(m_config.ReturnBooleanDescFormat, "has " + UnabbreviateAndJoin(words, 1))); + desc = StringHelper.Capitalize(String.Format(Config.ReturnBooleanDescFormat, "has " + UnabbreviateAndJoin(words, 1))); } } @@ -598,7 +609,7 @@ private string TryGenerateReturnDesc(CodeFunction function) /// Unabbreviated word, or the original if no conversion was found for it. private string Unabbreviate(string word) { - return m_config.Abbreviations.Unabbreviate(word); + return Config.Abbreviations.Unabbreviate(word); } /// @@ -617,9 +628,9 @@ private string UnabbreviateAndJoin(string[] words, int startIndex = 0) /// private void InitStyle() { - m_indentString = new string(' ', m_config.TagIndentation); - m_regexParam = new Regex(@"\s*\*\s+\" + m_config.TagChar + @"param\s+(\[[a-z,]+\])\s+(\w+)(?:\s+(.*))?$", RegexOptions.Compiled); - m_regexTagSection = new Regex(@"\s*\*\s+\" + m_config.TagChar + @"([a-z]+)(?:\s+(.*))?$", RegexOptions.Compiled); + m_indentString = new string(' ', Config.TagIndentation); + m_regexParam = new Regex(@"\s*\*\s+\" + Config.TagChar + @"param\s+(\[[a-z,]+\])\s+(\w+)(?:\s+(.*))?$", RegexOptions.Compiled); + m_regexTagSection = new Regex(@"\s*\*\s+\" + Config.TagChar + @"([a-z]+)(?:\s+(.*))?$", RegexOptions.Compiled); } /// @@ -714,8 +725,10 @@ private class ParsedComment public List TagSections { get; } = new List(); } + private DoxygenConfig Config { get { return m_configService.Config; } } + //! Doxygen style configuration. - private DoxygenConfig m_config; + private DoxygenConfigService m_configService; //! Indentation for doxygen tags. private string m_indentString; diff --git a/AutoDoxyDoc/GenerateComment.cs b/AutoDoxyDoc/GenerateComment.cs index 482558d..ca7948a 100644 --- a/AutoDoxyDoc/GenerateComment.cs +++ b/AutoDoxyDoc/GenerateComment.cs @@ -37,8 +37,10 @@ internal sealed class GenerateComment /// /// Owner package, not null. /// Command service to add command to, not null. - private GenerateComment(AsyncPackage package, OleMenuCommandService commandService) + private GenerateComment(AsyncPackage package, OleMenuCommandService commandService, DoxygenConfigService configService) { + m_generator = new DoxygenGenerator(configService); + this.package = package ?? throw new ArgumentNullException(nameof(package)); commandService = commandService ?? throw new ArgumentNullException(nameof(commandService)); @@ -78,7 +80,8 @@ public static async Task InitializeAsync(AsyncPackage package) await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(package.DisposalToken); OleMenuCommandService commandService = await package.GetServiceAsync((typeof(IMenuCommandService))) as OleMenuCommandService; - Instance = new GenerateComment(package, commandService); + DoxygenConfigService configService = await package.GetServiceAsync((typeof(DoxygenConfigService))) as DoxygenConfigService; + Instance = new GenerateComment(package, commandService, configService); } /// @@ -291,6 +294,6 @@ private bool ScrollToCodeStart(TextSelection ts) } //! Doxygen generator. - private DoxygenGenerator m_generator = new DoxygenGenerator(DoxygenConfig.Instance); + private DoxygenGenerator m_generator; } } diff --git a/AutoDoxyDoc/OptionsPage.cs b/AutoDoxyDoc/OptionsPage.cs index d5e4a32..5ce1129 100644 --- a/AutoDoxyDoc/OptionsPage.cs +++ b/AutoDoxyDoc/OptionsPage.cs @@ -83,7 +83,12 @@ protected override void OnApply(PageApplyEventArgs e) { if (e.ApplyBehavior == ApplyKind.Apply) { - DoxygenConfig.Instance.LoadSettings(this); + var configService = GetService(typeof(DoxygenConfigService)) as DoxygenConfigService; + + if (configService != null) + { + configService.Config.LoadSettings(this); + } } base.OnApply(e); From 637d519513dc297d096a4e38119f2b087c74fef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joni-Matti=20M=C3=A4=C3=A4tt=C3=A4?= Date: Thu, 24 Sep 2020 13:35:55 +0300 Subject: [PATCH 2/2] Add support for VS2019 Added support for VS2019. --- AutoDoxyDoc/source.extension.vsixmanifest | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/AutoDoxyDoc/source.extension.vsixmanifest b/AutoDoxyDoc/source.extension.vsixmanifest index 7fa6aa8..0d63db7 100644 --- a/AutoDoxyDoc/source.extension.vsixmanifest +++ b/AutoDoxyDoc/source.extension.vsixmanifest @@ -1,21 +1,21 @@  - + AutoDoxyDoc Doxygen comment generator for C/C++. Resources\AutoDoxyDocPackage.ico - - + + - + - +