Bug 11490 - Code generation for partial method fails
Summary: Code generation for partial method fails
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: 4.0.3
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2013-03-31 08:15 UTC by Alexander
Modified: 2013-04-02 05:00 UTC (History)
1 user (show)

Tags:
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:
Status:
RESOLVED FIXED

Description Alexander 2013-03-31 08:15:45 UTC
Xamarin Studio fails on generating partial method defined in other file, if file with method declaration is closed.

Steps to reproduce:

1. Define partial class in two files
2. Declare partial method in the first file:

partial void TestMethod ();

3. Close first file, open second file.
3. Inside the class, type "partial ", code generation popup appears.
4. Choose "TestMethod", "Error in text editor extension chain" appears.

If first file wasn't closed, everything works fine.

Error stacktrace:

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-lion-bs1/fae7c2bd/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-lion-bs1/fae7c2bd/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-lion-bs1/fae7c2bd/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-lion-bs1/fae7c2bd/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-lion-bs1/fae7c2bd/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-lion-bs1/fae7c2bd/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs:442 
  at MonoDevelop.Ide.CodeCompletion.CompletionListWindow.PreProcessKeyEvent (Key key, Char keyChar, ModifierType modifier) [0x00080] in /Users/builder/data/lanes/monodevelop-lion-bs1/fae7c2bd/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-lion-bs1/fae7c2bd/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-lion-bs1/fae7c2bd/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-lion-bs1/fae7c2bd/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-lion-bs1/fae7c2bd/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) [0x00516] in /Users/builder/data/lanes/monodevelop-lion-bs1/fae7c2bd/source/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:389 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /Users/builder/data/lanes/monodevelop-lion-bs1/fae7c2bd/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-lion-bs1/fae7c2bd/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-lion-bs1/fae7c2bd/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-lion-bs1/fae7c2bd/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-lion-bs1/fae7c2bd/source/monodevelop/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs:437 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /Users/builder/data/lanes/monodevelop-lion-bs1/fae7c2bd/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-lion-bs1/fae7c2bd/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-lion-bs1/fae7c2bd/source/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:249
Comment 1 Mike Krüger 2013-04-02 05:00:49 UTC
should work in the next version.