Bug 34452 - Quick fixes not working
Summary: Quick fixes not working
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 5.10 (C6SR3)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: master
Assignee: Mike Krüger
Depends on:
Reported: 2015-09-30 12:55 UTC by Michael Teper
Modified: 2015-11-25 02:43 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Michael Teper 2015-09-30 12:55:31 UTC
XS 5.10 build 800.

I type in a reference to a class that is not yet referenced (missing a "using" statement), XS colors it red and shows the blue bar quick fix indicator, however nothing happens if I click on it, nor does ALT+ENTER result in any UI action. CTRL+. pops a small empty oval bubble.
Comment 1 Mike Krüger 2015-10-02 00:51:31 UTC
Which os are you using ?
Comment 2 Michael Teper 2015-10-02 00:59:00 UTC
OS X. Was Yosemite, now El Capitan.
Comment 3 Mike Krüger 2015-10-02 01:07:26 UTC
Ok then we're on the same OS  - do you've something in the logs ?

(Help->open protocol directory)

Maybe there is an exception which prevents quick fixes from working.
Comment 4 Michael Teper 2015-10-02 10:54:51 UTC
Tried to trigger a quick fix action and got this in the log:

WARNING [2015-10-02 07:53:25Z]: Warning slow edit action update.
INFO [2015-10-02 07:53:25Z]: ACTION 'Convert 'foreach' loop to 'for'' took 60ms
INFO [2015-10-02 07:53:25Z]: ACTION 'Convert method group to anoymous method' took 60ms
INFO [2015-10-02 07:53:25Z]: ACTION 'Convert to explicit initializers' took 109ms
INFO [2015-10-02 07:53:25Z]: ACTION 'Create changed event for property' took 65ms
INFO [2015-10-02 07:53:25Z]: ACTION 'Create class' took 53ms
ERROR [2015-10-02 07:53:28Z]: An unhandled exception has occured. Terminating Xamarin Studio? False
System.InvalidCastException: Specified cast is not valid.
   at MonoDevelop.Core.Serialization.PrimitiveDataType.OnDeserialize (MonoDevelop.Core.Serialization.SerializationContext serCtx, System.Object mapData, MonoDevelop.Core.Serialization.DataNode data) in /Users/builder/data/lanes/2103/92083188/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/PrimitiveDataType.cs:line 55
   at MonoDevelop.Core.Serialization.DataSerializer.OnDeserialize (MonoDevelop.Core.Serialization.DataType dataType, MonoDevelop.Core.Serialization.SerializationContext serCtx, System.Object mapData, MonoDevelop.Core.Serialization.DataNode data) in /Users/builder/data/lanes/2103/92083188/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/DataSerializer.cs:line 101
   at MonoDevelop.Core.Serialization.DataType.Deserialize (MonoDevelop.Core.Serialization.SerializationContext serCtx, System.Object mapData, MonoDevelop.Core.Serialization.DataNode data) in /Users/builder/data/lanes/2103/92083188/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/DataType.cs:line 106
   at MonoDevelop.Core.Serialization.DataContext.LoadConfigurationData (MonoDevelop.Core.Serialization.SerializationContext serCtx, System.Type type, MonoDevelop.Core.Serialization.DataNode data) in /Users/builder/data/lanes/2103/92083188/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/DataContext.cs:line 114
   at MonoDevelop.Core.Serialization.DataSerializer.Deserialize (System.Type type, MonoDevelop.Core.Serialization.DataNode data) in /Users/builder/data/lanes/2103/92083188/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/DataSerializer.cs:line 76
   at MonoDevelop.Core.PropertyBag.Deserialize (System.String name, MonoDevelop.Core.Serialization.DataNode node, System.Type type, MonoDevelop.Core.Serialization.DataContext ctx) in /Users/builder/data/lanes/2103/92083188/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/PropertyBag.cs:line 178
   at MonoDevelop.Core.PropertyBag.GetValue[T] (System.String name, MonoDevelop.Core.Serialization.DataContext ctx) in /Users/builder/data/lanes/2103/92083188/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/PropertyBag.cs:line 70
   at MonoDevelop.Core.PropertyBag.GetValue[T] (System.String name) in /Users/builder/data/lanes/2103/92083188/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/PropertyBag.cs:line 61
   at MonoDevelop.Refactoring.RefactoringService.get_ShowFixes () in /Users/builder/data/lanes/2103/92083188/source/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringService.cs:line 328
   at MonoDevelop.CodeActions.CodeActionEditorExtension.PopulateFixes (MonoDevelop.CodeActions.FixMenuDescriptor menu, System.Int32& items) in /Users/builder/data/lanes/2103/92083188/source/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs:line 432
   at MonoDevelop.CodeActions.CodeActionEditorExtension.PopupQuickFixMenu (Gdk.EventButton evt, System.Action`1 menuAction) in /Users/builder/data/lanes/2103/92083188/source/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs:line 283
   at MonoDevelop.CodeActions.CodeActionEditorExtension+SmartTagMarker.<Popup>m__0 () in /Users/builder/data/lanes/2103/92083188/source/monodevelop/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs:line 628
   at GLib.Timeout+TimeoutProxy.Handler () in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/gtk-sharp-2.12.21/glib/Timeout.cs:line 70
INFO [2015-10-02 07:53:28Z]: Xamarin.iOS not installed. Can't find mtouch.
INFO [2015-10-02 07:53:28Z]: Found Xamarin.Mac, version
Comment 5 William 2015-10-12 09:50:02 UTC
In mine (Windows, 5.10), quick fix does not pop up at all. I try both using the keyboard shortcut (ctrl + . for me) and also hovering over it with the mouse. Neither produces any results.

Log has an error:

ERROR [2015-10-12 08:48:31Z]: Error while context menu popup.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Mono.TextEditor.GtkWorkarounds.ShowContextMenu(Menu menu, Widget parent, EventButton evt, Rectangle caret)
   at MonoDevelop.CodeActions.CodeActionEditorExtension.ShowFixesMenu(Widget parent, Rectangle evt, FixMenuDescriptor entrySet)
Comment 6 William 2015-10-12 09:55:36 UTC
I created another bug (Windows, 5.10) as mine is slightly different and on a different OS.

Comment 7 David Karlaš 2015-10-29 02:45:53 UTC
@William your problem is a bit different and was already fixed there
@Michael workaround is to delete {solutionName}.userprefs file that is in same folder as your {solutionName}.sln file. I'm not sure why but it seems file is corrupted/wrongly serialized.
Comment 8 David Karlaš 2015-10-29 02:47:19 UTC
I had same problem locally for some reason RefactoringSettings.EnableRefactorings setting was xml element in this format: <RefactoringSettings.EnableRefactorings /> instead of boolean attribute, hence it fails to deserialize.
Comment 9 Michael Teper 2015-10-29 12:53:18 UTC
Thanks, David!

Indeed, removing the line fixed the problem. For the record, once loaded (and once I, once again, answered in the affirmative to enable refactorings in XS), the  RefactoringSettings.EnableRefactorings="True" was added as attribute to the root "Properties" element.
Comment 10 Mike Krüger 2015-11-25 02:43:54 UTC
Fortunately the RefactoringSettings.EnableRefactorings setting is gone in 6.0