(debian,vim,Qt,ruby) on vim : no completion but everything elseworks fine

L

lolveley

Hello,

I have a little/big problem with vim and ruby.
little because almost all works fine : on debian I installed
vim,vim-ruby,ruby1.8,qt4-qtruby, and Qt.
on vim I have the syntax coloring that's working, and a program like "print
require 'Qt4' " returns true : Qt4 is recognized.

but I have not the completion for Qt : if I enter "a=Qt:: " +CTRL X+CTRL O,
I have the messsage "pattern not found" .

on vim I have:
:set ofu? => omnifunc=rubycomplete#Complete
:set ft? => filetype=ruby
:filetype => all 3 are ON

can you help me to have the completion?
or maybe I have made a mistake, an oversight.

thx,

olivier.







___________________________________________________________________________
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
http://fr.mail.yahoo.com
 
R

richard.j.dale

Hello,

I have a little/big problem with vim and ruby.
little because almost all works fine : on debian I installed
vim,vim-ruby,ruby1.8,qt4-qtruby, and Qt.
on vim I have the syntax coloring that's working, and a program like "print
require 'Qt4' " returns true : Qt4 is recognized.

but I have not the completion for Qt : if I enter "a=Qt:: " +CTRL X+CTRL O,
I have the messsage "pattern not found" .

on vim I have:
:set ofu?     =>  omnifunc=rubycomplete#Complete
:set ft?       =>  filetype=ruby
:filetype      => all 3 are ON

can you help me to have the completion?
or maybe I have made a mistake, an oversight.
Code completion with QtRuby will only work if you are interacting with
running code with a tool such as irb. It won't work with static
environments like vim. So I would run irb as well as vim to try things
out, and also use the command line 'rbqtapi' tool to introspect the
QtRuby api.

-- Richard
 
L

lolveley

(e-mail address removed) a écrit :
Code completion with QtRuby will only work if you are interacting with
running code with a tool such as irb. It won't work with static
environments like vim. So I would run irb as well as vim to try things
out, and also use the command line 'rbqtapi' tool to introspect the
QtRuby api.

-- Richard
well, it's amazing : I have succeeded in having the completion of Qt
classes and methods by typing : let g:rubycomplete_buffer_loading=1.

olivier.





___________________________________________________________________________
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
http://fr.mail.yahoo.com
 
R

richard.j.dale

(e-mail address removed) a écrit :




well, it's amazing : I have succeeded in having the completion of Qt
classes and methods by typing : let g:rubycomplete_buffer_loading=1.
Oh, that's intesting. I was assuming that vim code completion worked
by statically analyzing the ruby sources. But if it works with QtRuby
it must mean it is running code and doing introspection. Nearly all
method calls in QtRuby are trapped by method_missing() and then
forwarded as C++ invocations. So that means that the Ruby methods
don't really exist as such, they are not defined with rb_define_method
() or as Ruby code.

irb(main):002:0> Qt::Widget.instance_methods.sort
=> ["==", "===", "=~", "QT_TRANSLATE_NOOP", "QT_TR_NOOP", "SIGNAL",
"SLOT", "__id__", "__send__", "acceptDrops", "acceptDrops=",
"accessibleDescription", "accessibleDescription=","accessibleName",
"accessibleName=", "actions", "activateWindow", "activeWindow?",
"addAction", "addActions", "adjustSize", "attribute=",
"autoFillBackground", "autoFillBackground=", "backgroundRole",
"backgroundRole=", "baseSize", "baseSize=", "blockSignals", "childAt",
"children", "childrenRect", "childrenRegion", "class", "className",
"class_name", "clear
....


So vim must be making Ruby method calls like the above to know about
QtRuby methods (instance_methods() queries the 'Smoke' library runtime
to find the names of the Qt C++ methods).

-- Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top