Bug 10886 - Autocomplete partial method error
Summary: Autocomplete partial method error
Status: VERIFIED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 4.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2013-03-04 14:19 UTC by Andrew Way
Modified: 2014-05-05 10:54 UTC (History)
6 users (show)

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


Attachments
Error window (32.85 KB, image/jpeg)
2013-03-04 14:19 UTC, Andrew Way
Details


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:
Status:
VERIFIED FIXED

Description Andrew Way 2013-03-04 14:19:49 UTC
Created attachment 3532 [details]
Error window

On behalf of Isaac @ FANUC

First, I added an Action for a toolbar button in Interface Builder.  After closing xCode I went to the C# source to add the partial method to handle the action.  I type “partial” and then began to type the name of the action.  When the AutoComplete came up with the correct method name in the list, I pressed enter to let the AutoComplete generate the method.  The AutoComplete failed with this error message and I can reproduce it every time and on other actions.

Here is a demo of the error: http://screencast.com/t/sTyZBYUdrfr
And here are some more details:
If I have the designer file open, adding the partial method will succeed (kind of).  The auto complete will generate the full method body but the method signature will contain a second “partial” keyword in it.  If I close the designer file and try to add a partial method, the error below returns.
  
Thanks,
Isaac
 
System.NullReferenceException: Object reference not set to an instance of an object
  at MonoDevelop.CSharp.Refactoring.CSharpCodeGenerator+CodeGenerationOptions.GetShortType (System.String ns, System.String name, Int32 typeArguments) [0x00000] in /Users/builder/data/lanes/monodevelop_private-lion-bigsplash/a8219130/source/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs:93
  at MonoDevelop.CSharp.Refactoring.CSharpCodeGenerator.AppendNotImplementedException (System.Text.StringBuilder result, MonoDevelop.CSharp.Refactoring.CodeGenerationOptions options, System.Int32& bodyStartOffset, System.Int32& bodyEndOffset) [0x0001b] in /Users/builder/data/lanes/monodevelop_private-lion-bigsplash/a8219130/source/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs:378
  at MonoDevelop.CSharp.Refactoring.CSharpCodeGenerator.GenerateCode (IMethod method, MonoDevelop.CSharp.Refactoring.CodeGenerationOptions options) [0x005a5] in /Users/builder/data/lanes/monodevelop_private-lion-bigsplash/a8219130/source/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs:527
  at MonoDevelop.CSharp.Refactoring.CSharpCodeGenerator.CreateMemberImplementation (ITypeDefinition implementingType, IUnresolvedTypeDefinition part, IMember member, Boolean explicitDeclaration) [0x0004e] in /Users/builder/data/lanes/monodevelop_private-lion-bigsplash/a8219130/source/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs:193
  at MonoDevelop.CSharp.Completion.NewOverrideCompletionData.InsertCompletionText (MonoDevelop.Ide.CodeCompletion.CompletionListWindow window, MonoDevelop.Ide.CodeCompletion.KeyActions& ka, Key closeChar, Char keyChar, ModifierType modifier) [0x00112] in /Users/builder/data/lanes/monodevelop_private-lion-bigsplash/a8219130/source/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/NewOverrideCompletionData.cs:85
  at MonoDevelop.Ide.CodeCompletion.CompletionListWindow.CompleteWord (MonoDevelop.Ide.CodeCompletion.KeyActions& ka, Key closeChar, Char keyChar, ModifierType modifier) [0x00039] in /Users/builder/data/lanes/monodevelop_private-lion-bigsplash/a8219130/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs:441
  at MonoDevelop.Ide.CodeCompletion.CompletionListWindow.PreProcessKeyEvent (Key key, Char keyChar, ModifierType modifier) [0x00080] in /Users/builder/data/lanes/monodevelop_private-lion-bigsplash/a8219130/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs:222
  at MonoDevelop.Ide.CodeCompletion.CompletionWindowManager.PreProcessKeyEvent (Key key, Char keyChar, ModifierType modifier) [0x0000c] in /Users/builder/data/lanes/monodevelop_private-lion-bigsplash/a8219130/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionWindowManager.cs:141
  at MonoDevelop.Ide.Gui.Content.CompletionTextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x0000b] in /Users/builder/data/lanes/monodevelop_private-lion-bigsplash/a8219130/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:79
  at MonoDevelop.CSharp.Completion.CSharpCompletionTextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00000] in /Users/builder/data/lanes/monodevelop_private-lion-bigsplash/a8219130/source/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs:204
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /Users/builder/data/lanes/monodevelop_private-lion-bigsplash/a8219130/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:109
  at MonoDevelop.CSharp.Formatting.CSharpTextEditorIndentation.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00523] in /Users/builder/data/lanes/monodevelop_private-lion-bigsplash/a8219130/source/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:357
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /Users/builder/data/lanes/monodevelop_private-lion-bigsplash/a8219130/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:109
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /Users/builder/data/lanes/monodevelop_private-lion-bigsplash/a8219130/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:109
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /Users/builder/data/lanes/monodevelop_private-lion-bigsplash/a8219130/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:109
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /Users/builder/data/lanes/monodevelop_private-lion-bigsplash/a8219130/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:109
  at MonoDevelop.Debugger.ExceptionCaughtTextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x0005f] in /Users/builder/data/lanes/monodevelop_private-lion-bigsplash/a8219130/source/monodevelop/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs:439
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /Users/builder/data/lanes/monodevelop_private-lion-bigsplash/a8219130/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:109
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /Users/builder/data/lanes/monodevelop_private-lion-bigsplash/a8219130/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:109
  at MonoDevelop.SourceEditor.ExtensibleTextEditor.ExtensionKeyPress (Key key, UInt32 ch, ModifierType state) [0x00000] in /Users/builder/data/lanes/monodevelop_private-lion-bigsplash/a8219130/source/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:249
Comment 1 Mike Krüger 2013-03-04 15:31:12 UTC
fixed
Comment 4 Jatin 2013-03-20 10:06:51 UTC
We have verified this issue with the latest builds:

XS 4.0.2.22
MFA 4.6.01073
MT 6.2.1.201
Mono 2.10.12

And now this issue is not appearing, as the auto completion for the partial method is working fine, without throwing any error message.

Hence, closing this issue.
Comment 5 Mayur Tendulkar 2013-03-21 00:17:36 UTC
I received this bug yesterday on following configuration. 

Xamarin Studio: 4.0.2 (build 18)
Runtime: Mono 2.10.12 (mono-2-10/c9b270d)
Xcode: 4.6.1 (2067) Build 4H512
Xamarin.Android: 4.6.1 (Starter edition)
Xamarin.iOS: 6.2.1.201 (Business edition)

How can I update these bits? Unable to fetch these versions.
Comment 6 Mikayla Hutchinson [MSFT] 2013-03-21 15:06:35 UTC
It should be in 4.0.3, but I'm afraid I don't have an ETA for that.
Comment 7 Ronald 2013-04-11 05:07:32 UTC
I receive this exact error in version 4.0.3 build 13, trying to auto-complete actions set in the IB.
Its the same NullReferenceException with exactly the same stacktrace (same classes and line-numbers).
Comment 8 Mike Krüger 2013-04-11 05:31:47 UTC
The line is:

https://github.com/mono/monodevelop/blob/master/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs#L93


I don't know if it's in 4.0.3 - but the stack trace can't happen there (it's running on 1 thread).