diff options
author | Mike Krüger <mikkrg@microsoft.com> | 2019-08-05 16:51:11 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-05 16:51:11 +0300 |
commit | db86d92b7007300c7dd8388edc0609a919fb5ff9 (patch) | |
tree | f577bfb78f9415a0606fd987a9fed73ca35b4a99 /main/src/addins/MonoDevelop.Refactoring | |
parent | ccc59782a2759b221e1b713d282d88d287786369 (diff) | |
parent | daca28131aee3aba933eded9848fd5244abf24aa (diff) |
Merge pull request #7913 from mono/master-issue6333
Fixes issue #6333 Analyzers not retriggered on editorconfig change
Diffstat (limited to 'main/src/addins/MonoDevelop.Refactoring')
-rw-r--r-- | main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultsEditorExtension.cs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultsEditorExtension.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultsEditorExtension.cs index 36398008a6..336df933d5 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultsEditorExtension.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultsEditorExtension.cs @@ -76,11 +76,19 @@ namespace MonoDevelop.AnalysisCore.Gui protected override void Initialize () { base.Initialize (); - + if (Editor.Options is DefaultSourceEditorOptions options) + options.Changed += Options_Changed; AnalysisOptions.AnalysisEnabled.Changed += AnalysisOptionsChanged; AnalysisOptionsChanged (null, null); } + void Options_Changed (object sender, EventArgs e) + { + if (DocumentContext == null || !enabled) + return; + UpdateInitialDiagnostics (); + } + void AnalysisOptionsChanged (object sender, EventArgs e) { Enabled = AnalysisOptions.AnalysisEnabled; @@ -91,6 +99,8 @@ namespace MonoDevelop.AnalysisCore.Gui if (disposed) return; enabled = false; + if (Editor.Options is DefaultSourceEditorOptions options) + options.Changed -= Options_Changed; diagService.DiagnosticsUpdated -= OnDiagnosticsUpdated; diagService = null; CancelUpdateTimout (); @@ -154,7 +164,7 @@ namespace MonoDevelop.AnalysisCore.Gui if (!AnalysisOptions.EnableFancyFeatures) return; - var doc = DocumentContext.AnalysisDocument; + var doc = DocumentContext?.AnalysisDocument; if (doc == null || DocumentContext.IsAdHocProject) return; |