diff options
author | Lluis Sanchez <lluis@xamarin.com> | 2014-01-20 19:32:53 +0400 |
---|---|---|
committer | Lluis Sanchez Gual <lluis@xamarin.com> | 2014-10-21 18:39:14 +0400 |
commit | f73b2a9990495587d514aa1856919c21170a3940 (patch) | |
tree | 9842411ee8644ead5915a715ee7e53984a601df4 /main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisCommands.cs | |
parent | a2046b6331a271e8203df7d3d0f14500d33d60fa (diff) |
Initial drop of the new project model
Diffstat (limited to 'main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisCommands.cs')
-rw-r--r-- | main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisCommands.cs | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisCommands.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisCommands.cs index 4fe2c5f86f..392aacd522 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisCommands.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisCommands.cs @@ -59,10 +59,18 @@ namespace MonoDevelop.AnalysisCore { protected override void Update (CommandInfo info) { - MonoDevelop.Ide.Gui.Document document; - IList<FixableResult> results; - info.Enabled = FixOperationsHandler.GetFixes (out document, out results) - && results.Any (r => FixOperationsHandler.GetActions (document, r).Any ()); + var doc = MonoDevelop.Ide.IdeApp.Workbench.ActiveDocument; + if (doc == null || doc.Editor == null) { + info.Enabled = false; + return; + } + var codeActionExtension = doc.GetContent <CodeActionEditorExtension> (); + if (codeActionExtension == null) { + info.Enabled = false; + return; + } + var fixes = codeActionExtension.GetCurrentFixes (); + info.Enabled = fixes.Any (); } protected override void Run () |