Bug 12900 - Event handler statement completion throws an exception
Summary: Event handler statement completion throws an exception
Status: VERIFIED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 4.0.8
Hardware: PC Mac OS
: --- normal
Target Milestone: master
Assignee: Mike Krüger
URL:
: 13159 ()
Depends on:
Blocks:
 
Reported: 2013-06-26 10:29 UTC by Prashant Cholachagudda
Modified: 2014-03-28 07:18 UTC (History)
3 users (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:
VERIFIED FIXED

Description Prashant Cholachagudda 2013-06-26 10:29:38 UTC
Exception is thrown when tried to create event handler for "UIButton.TouchUpInside +="

Use 4.0.8 build 2

System.IndexOutOfRangeException: Array index is out of range.

at Mono.TextEditor.GapBuffer.GetCharAt (Int32 offset) [0x00000] in
/Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.8-branch/0a09117d/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/GapBuffer.cs:83

at Mono.TextEditor.TextDocument.GetCharAt (Int32 offset) [0x00000] in
/Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.8-branch/0a09117d/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs:330

at
MonoDevelop.CSharp.Completion.EventCreationCompletionData.InsertCompletionText
(MonoDevelop.Ide.CodeCompletion.CompletionListWindow window,
MonoDevelop.Ide.CodeCompletion.KeyActions& ka, Key closeChar, Char keyChar,
ModifierType modifier) [0x000a4] in
/Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.8-branch/0a09117d/source/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/EventCreationCompletionData.cs:86

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-monodevelop-4.0.8-branch/0a09117d/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-monodevelop-4.0.8-branch/0a09117d/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-monodevelop-4.0.8-branch/0a09117d/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-monodevelop-4.0.8-branch/0a09117d/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-monodevelop-4.0.8-branch/0a09117d/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-monodevelop-4.0.8-branch/0a09117d/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) [0x00594] in
/Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.8-branch/0a09117d/source/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:604

at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key,
Char keyChar, ModifierType modifier) [0x00013] in
/Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.8-branch/0a09117d/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-monodevelop-4.0.8-branch/0a09117d/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-monodevelop-4.0.8-branch/0a09117d/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-monodevelop-4.0.8-branch/0a09117d/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-monodevelop-4.0.8-branch/0a09117d/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-monodevelop-4.0.8-branch/0a09117d/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-monodevelop-4.0.8-branch/0a09117d/source/monodevelop/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs:440

at MonoDevelop.SourceEditor.ExtensibleTextEditor.ExtensionKeyPress (Key
key, UInt32 ch, ModifierType state) [0x00007] in
/Users/builder/data/lanes/monodevelop-lion-monodevelop-4.0.8-branch/0a09117d/source/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:240
Comment 2 Mike Krüger 2013-06-27 01:37:06 UTC
fixed 

btw. hard to test because I couldn't reproduce it.
But the stack trace with the line numbers was helpful.
Comment 3 Mike Krüger 2013-07-11 02:26:13 UTC
*** Bug 13159 has been marked as a duplicate of this bug. ***
Comment 4 Sadik Ali 2014-03-28 07:18:52 UTC
I have verified this issue and noticed that event handler not through any exception. Followed below steps:

1. Created iOS project.
2. typed UIButton.TouchUpInside += and noticed that auto completion is working.

Screen cast: http://screencast.com/t/vRdlJoTeULfv

Build Info: 

=== Xamarin Studio ===
Version 4.2.4 (build 266)
Installation UUID: 0b7eaebc-a0ed-4b58-81df-91e378cad28c
Runtime:
 Mono 3.4.0 ((no/d4511ef)
 GTK+ 2.24.23 (Raleigh theme)

=== Apple Developer Tools ===
Xcode 5.1 (5035)
Build 5B45j

=== Xamarin.iOS ===
Version: 7.2.2.14 (Trial Edition)
Hash: 16bef0b
Branch: 
Build date: 2014-03-20 12:01:19-0400

=== Build Information ===
Release ID: 402040266
Git revision: 57fa6b7639703775ae1d5c46536e42ab424cb177
Xamarin addins: eee141c29724a19529e77b8e743086d95b29f5ba

=== Operating System ===
Mac OS X 10.8.5