Bug 433 - NullReference exception thrown when generating method doc template
Summary: NullReference exception thrown when generating method doc template
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: 2.6 RC 1
Hardware: PC Mac OS
: --- blocker
Target Milestone: 2.8
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2011-08-25 13:34 UTC by Jonathan Shore
Modified: 2011-09-19 07:42 UTC (History)
2 users (show)

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


Attachments
Source file that exhibits the problem (6.74 KB, application/octet-stream)
2011-08-30 08:28 UTC, Jonathan Shore
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:
RESOLVED FIXED

Description Jonathan Shore 2011-08-25 13:34:02 UTC
When typing /// to start a comment decorator above a method, get "Error in text editor extension chain window".

The code looked like:

		
	//  <- attempting to insert  here
	private static int SkipGroupExpr (string expr, int start)


The exception was:

System.NullReferenceException: Object reference not set to an instance of an object
  at MonoDevelop.DocFood.DocGenerator.GenerateDoc (IMember member) [0x00296] in /sources/monodevelop/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/DocGenerator.cs:370 
  at MonoDevelop.DocFood.DocumentBufferHandler.GenerateDocumentation (Mono.TextEditor.TextEditorData data, IMember member, System.String indent, System.String prefix) [0x0000d] in /sources/monodevelop/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/Commands.cs:132 
  at MonoDevelop.DocFood.DocumentBufferHandler.GenerateDocumentation (Mono.TextEditor.TextEditorData data, IMember member, System.String indent) [0x00000] in /sources/monodevelop/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/Commands.cs:124 
  at MonoDevelop.DocFood.DocFoodTextEditorExtension.GenerateDocumentation (IMember member, System.String indent) [0x00000] in /sources/monodevelop/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/DocFoodTextEditorExtension.cs:48 
  at MonoDevelop.DocFood.DocFoodTextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00081] in /sources/monodevelop/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/DocFoodTextEditorExtension.cs:75 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /sources/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:115 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /sources/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:115 
  at MonoDevelop.CSharp.Formatting.CSharpTextEditorIndentation.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00361] in /sources/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:261 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /sources/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:115 
  at MonoDevelop.Ide.Gui.Content.CompletionTextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x0005e] in /sources/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:95 
  at MonoDevelop.CSharp.Completion.CSharpTextEditorCompletion.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00000] in /sources/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:166 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /sources/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:115 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /sources/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:115 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /sources/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:115 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /sources/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:115 
  at MonoDevelop.SourceEditor.ExtensibleTextEditor.ExtensionKeyPress (Key key, UInt32 ch, ModifierType state) [0x00000] in /sources/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:256
Comment 1 Miguel de Icaza [MSFT] 2011-08-29 19:14:38 UTC
I am unable to reproduce this with the Release Candidate 2, can you try again?
Comment 2 Jonathan Shore 2011-08-30 08:28:03 UTC
Created attachment 210 [details]
Source file that exhibits the problem

If you position to line 274 and attempt to insert ///, you should get the error.  I suspect this error is occurring because of improperly escaped prior commments.  Some comments contain < and > in the text not escaped.  This code was imported from a java project, and thus comments, for example, have not yet been sanitized.

In any case, the doc parser / generator should be resilient to those sort of problems ...
Comment 3 Alan McGovern 2011-09-01 19:38:30 UTC
This is going to be very tough for me to fix as I have zero knowledge of the code used to generate the dom, zero knowledge of using the dom and zero knowledge of how the doc generator works. If someone who knows the code can give pointers on where to look it could save me hours/days of searching trying to figure out what part of this infrastructure has actually failed.
Comment 4 Miguel de Icaza [MSFT] 2011-09-01 20:24:01 UTC
With the new test case and the description, it  makes sense for Mike to look at this.
Comment 5 Mike Krüger 2011-09-19 07:42:46 UTC
it's fixed in the 2.8 branch.