nover / rubybinding

Ruby bindings for monodevelop
4 stars 1 forks source link

Code completion init fails / ruby 1.9 issue #2

Open pingvinen opened 13 years ago

pingvinen commented 13 years ago

When I load a ruby project, the following is output to the console.

WARNING [2011-06-22 11:23:58Z]: RubyCompletion: ruby1.8 at (wrapper managed-to-native) MonoDevelop.RubyBinding.RubyCompletion:ruby_init () at MonoDevelop.RubyBinding.RubyCompletion.m1 () [0x00000] in :0 at MonoDevelop.Ide.DispatchService.GuiSyncDispatch (MonoDevelop.Ide.MessageHandler cb) [0x0000a] in /path_to_my_pkg_build/monodevelop-beta/src/monodevelop-2.5.92/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DispatchService.cs:93 at MonoDevelop.RubyBinding.RubyCompletion.initialize () [0x00000] in :0 at MonoDevelop.RubyBinding.RubyCompletion+cAnonStorey2.<>m4 () [0x00000] in :0 at MonoDevelop.RubyBinding.RubyCompletion+cAnonStorey51[System.Collections.Generic.List1[MonoDevelop.Projects.Dom.Error]].<>m__6 () [0x00000] in :0 at MonoDevelop.Ide.DispatchService.GuiSyncDispatch (MonoDevelop.Ide.MessageHandler cb) [0x0000a] in /path_to_my_pkg_build/monodevelop-beta/src/monodevelop-2.5.92/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DispatchService.cs:93 at MonoDevelop.RubyBinding.RubyCompletion.GuiThreadSync[List1](System.Func1 realfunction) [0x00000] in :0

I am running MonoDevelop 2.5.92 from console on Arch Linux

nover commented 13 years ago

According to: http://www.ruby-forum.com/topic/215323

There is a bug in the rb_iterate method, however installing the latest trunk version of ruby on my machine does not solve the stacktrace issues with ruby 1.9. Something else must be wrong in the binding.

nover commented 13 years ago

I have been digging some more, and have found the source of the error....

It's in the function "rb_string_value" that something goes wrong. While the ruby-binding plugin is busy passing things into this method, it sends a ruby value type to it which is not a string.

One way to avoid this would be to use the rb_type method of ruby, however it's an internal method, so it can only be used from C / C++.. I have to figure out a way to check the type of a completion before passing it down to ruby.

nover commented 13 years ago

Oh, and the newest stacktrace is:

Stacktrace:

  at (wrapper managed-to-native) MonoDevelop.RubyBinding.RubyCompletion.rb_string_value_cstr (intptr&) 
  at MonoDevelop.RubyBinding.RubyCompletion.FromRubyString (intptr) 
  at MonoDevelop.RubyBinding.RubyCompletion.AddCompletion (intptr,string) 
  at MonoDevelop.RubyBinding.RubyCompletion/c__AnonStorey4.<>m__5 (intptr,intptr) 
  at (wrapper native-to-managed) MonoDevelop.RubyBinding.RubyCompletion/c__AnonStorey4.<>m__5 (intptr,intptr) 
  at (wrapper managed-to-native) MonoDevelop.RubyBinding.RubyCompletion.rb_funcall (intptr,intptr,int) 
  at (wrapper managed-to-native) MonoDevelop.RubyBinding.RubyCompletion.rb_iterate (MonoDevelop.RubyBinding.RubyCompletion/RubyFunction,intptr,MonoDevelop.RubyBinding.RubyCompletion/YieldFunction,intptr) 
  at MonoDevelop.RubyBinding.RubyCompletion.CompleteSymbol (string,string,string,int,string[2]) 
  at MonoDevelop.RubyBinding.RubyCompletion/c__AnonStorey1.<>m__3 () 
  at MonoDevelop.RubyBinding.RubyCompletion/c__AnonStorey5`1.<>m__6 () 
  at MonoDevelop.Ide.DispatchService.GuiSyncDispatch (MonoDevelop.Ide.MessageHandler) [0x0000a] in /my-pgk-build-path/monodevelop-beta/src/monodevelop-2.5.92/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DispatchService.cs:93
  at MonoDevelop.RubyBinding.RubyCompletion.GuiThreadSync (System.Func`1) 
  at MonoDevelop.RubyBinding.RubyCompletion.CompleteGlobal (string,string,int) 
  at MonoDevelop.RubyBinding.RubyTextEditorExtension.HandleCodeCompletion (MonoDevelop.Ide.CodeCompletion.CodeCompletionContext,char,bool,int&) 
  at MonoDevelop.RubyBinding.RubyTextEditorExtension.HandleCodeCompletion (MonoDevelop.Ide.CodeCompletion.CodeCompletionContext,char,int&) 
  at MonoDevelop.Ide.Gui.Content.CompletionTextEditorExtension.KeyPress (Gdk.Key,char,Gdk.ModifierType) [0x000db] in /my-pgk-build-path/monodevelop-beta/src/monodevelop-2.5.92/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:129
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Gdk.Key,char,Gdk.ModifierType) [0x00013] in /my-pgk-build-path/monodevelop-beta/src/monodevelop-2.5.92/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:115
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Gdk.Key,char,Gdk.ModifierType) [0x00013] in /my-pgk-build-path/monodevelop-beta/src/monodevelop-2.5.92/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:115
  at MonoDevelop.SourceEditor.ExtensibleTextEditor.ExtensionKeyPress (Gdk.Key,uint,Gdk.ModifierType) [0x00000] in /my-pgk-build-path/monodevelop-beta/src/monodevelop-2.5.92/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:256
  at MonoDevelop.SourceEditor.ExtensibleTextEditor.OnIMProcessedKeyPressEvent (Gdk.Key,uint,Gdk.ModifierType) [0x004e1] in /my-pgk-build-path/monodevelop-beta/src/monodevelop-2.5.92/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:442
  at Mono.TextEditor.TextEditor.IMCommit (object,Gtk.CommitArgs) [0x00070] in /my-pgk-build-path/monodevelop-beta/src/monodevelop-2.5.92/src/core/Mono.Texteditor/Mono.TextEditor/TextEditor.cs:494
  at (wrapper runtime-invoke) .runtime_invoke_void__this___object_object (object,intptr,intptr,intptr) 
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) 
  at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) [0x000d5] in /build/src/mono-2.10.2/mcs/class/corlib/System.Reflection/MonoMethod.cs:226
  at System.Reflection.MethodBase.Invoke (object,object[]) [0x00000] in /build/src/mono-2.10.2/mcs/class/corlib/System.Reflection/MethodBase.cs:96
  at System.Delegate.DynamicInvokeImpl (object[]) [0x000bf] in /build/src/mono-2.10.2/mcs/class/corlib/System/Delegate.cs:408
  at System.MulticastDelegate.DynamicInvokeImpl (object[]) [0x00018] in /build/src/mono-2.10.2/mcs/class/corlib/System/MulticastDelegate.cs:70
  at System.Delegate.DynamicInvoke (object[]) [0x00000] in /build/src/mono-2.10.2/mcs/class/corlib/System/Delegate.cs:382
  at GLib.Signal.ClosureInvokedCB (object,GLib.ClosureInvokedArgs) 
  at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs) 
  at GLib.SignalClosure.MarshalCallback (intptr,intptr,uint,intptr,intptr,intptr) 
  at (wrapper native-to-managed) GLib.SignalClosure.MarshalCallback (intptr,intptr,uint,intptr,intptr,intptr) 
  at (wrapper managed-to-native) Gtk.IMContext.gtk_im_context_filter_keypress (intptr,intptr) 
  at Gtk.IMContext.FilterKeypress (Gdk.EventKey) 
  at Mono.TextEditor.TextEditor.IMFilterKeyPress (Gdk.EventKey,Gdk.Key,uint,Gdk.ModifierType) [0x00037] in /my-pgk-build-path/monodevelop-beta/src/monodevelop-2.5.92/src/core/Mono.Texteditor/Mono.TextEditor/TextEditor.cs:809
  at Mono.TextEditor.TextEditor.OnKeyPressEvent (Gdk.EventKey) [0x000c0] in /my-pgk-build-path/monodevelop-beta/src/monodevelop-2.5.92/src/core/Mono.Texteditor/Mono.TextEditor/TextEditor.cs:849
  at MonoDevelop.SourceEditor.ExtensibleTextEditor.OnKeyPressEvent (Gdk.EventKey) [0x00077] in /my-pgk-build-path/monodevelop-beta/src/monodevelop-2.5.92/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:247
  at Gtk.Widget.keypressevent_cb (intptr,intptr) 
  at (wrapper native-to-managed) Gtk.Widget.keypressevent_cb (intptr,intptr) 
  at (wrapper managed-to-native) Gtk.Widget.gtksharp_widget_base_key_press_event (intptr,intptr) 
  at Gtk.Widget.OnKeyPressEvent (Gdk.EventKey) 
  at MonoDevelop.Ide.Gui.DefaultWorkbench.OnKeyPressEvent (Gdk.EventKey) [0x00103] in /my-pgk-build-path/monodevelop-beta/src/monodevelop-2.5.92/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs:1045
  at Gtk.Widget.keypressevent_cb (intptr,intptr) 
  at (wrapper native-to-managed) Gtk.Widget.keypressevent_cb (intptr,intptr) 
  at (wrapper managed-to-native) Gtk.Application.gtk_main () 
  at Gtk.Application.Run () 
  at MonoDevelop.Ide.IdeApp.Run () [0x00000] in /my-pgk-build-path/monodevelop-beta/src/monodevelop-2.5.92/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs:384
  at MonoDevelop.Ide.IdeStartup.Run (string[]) [0x00748] in /my-pgk-build-path/monodevelop-beta/src/monodevelop-2.5.92/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:265
  at MonoDevelop.Startup.MonoDevelopMain.Main (string[]) [0x00017] in /my-pgk-build-path/monodevelop-beta/src/monodevelop-2.5.92/src/core/MonoDevelop.Startup/MonoDevelop.Startup/MonoDevelopMain.cs:24
  at (wrapper runtime-invoke) .runtime_invoke_int_object (object,intptr,intptr,intptr)