|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
(Custom) code completion for .so filesI compiled and installed ruby 1.9 myself. I also compiled and installed several ruby- libraries (in lack of a better word; I mean the .so files), amongst others gnome2 and it's sub-package gtk2. (Note: because these are compiled by myself, these aren't gems) Now, I really like code completion (as an aid), and especially for new (for me) and big libraries like gtk2, it's a really use full function. The thing is, however, that there is no code completion for things like gnome2, gtk2, or gosu. This is of course understandable.. but I can't find a way to add this myself. Is there any way to let Netbeans know about any of this? Netbeans doesn't only 'not know' what to code complete; but it also can't find the extra libraries when completing the require statements. (An extra weird thing about the require completion is, that gtk2/base (instead of just gtk2 ! ), gnome2, libglade and others are there, but others like atk and bonobo2 aren't) One thing to note about this, though, is that my libraries are not included in ruby/1.9.1/, but instead in ruby/site_ruby/1.9.1/ (and they are still picked up by ruby itself) Is there any way to add code completion for these self-compiled libraries? Thanks, DS Minder SPAM in de verbeterde Windows Live Hotmail |
|
|
Re: (Custom) code completion for .so filesHi, One problem here might be that the IDE doesn't recognize ruby/site_ruby/1.9.1/ as a ruby lib dir, it assumes the site_ruby dir is located at <ruby_home>/lib/ruby/site_ruby. So the dir doesn't get scanned by the IDE and hence nothing from there is shown in code completion. Since ruby/site_ruby/1.9.1/ appears to a valid location for site_ruby, this should probably be fixed in in the IDE. As an experiment you may try adding the dir as a source root to your project (in Project Properties -> Sources), this way the IDE should index all the ruby files in the dir, but it isn't really a real solution for this. Another problem is that the IDE can't index native libraries (C files), you'd have to generate "ruby stubs" (i.e. skeleton ruby class files) from the .c files and place those stubs into a directory where the IDE will find them. We generate stubs for the native built-in Ruby classes, but I don't know how easily this could be done for gtk2 and other libraries. I can give it a try at some point, but if you want to play with this yourself, you need to clone http://hg.netbeans.org/main/misc and then check the rdocscanner and generator projects in ruby/stubs. ruby/stubs/UPDATE.txt describes the process, but it may be rather hard to get started with it though - if you decide to try it, please feel free to ask here in case of any problems. Erno Death Star wrote: > Hi, > > I compiled and installed ruby 1.9 myself. > I also compiled and installed several ruby- libraries (in lack of a > better word; I mean the .so files), amongst others gnome2 and it's > sub-package gtk2. (Note: because these are compiled by myself, these > aren't gems) > > Now, I really like code completion (as an aid), and especially for new > (for me) and big libraries like gtk2, it's a really use full function. > The thing is, however, that there is no code completion for things > like gnome2, gtk2, or gosu. This is of course understandable.. but I > can't find a way to add this myself. Is there any way to let Netbeans > know about any of this? > > Netbeans doesn't only 'not know' what to code complete; but it also > can't find the extra libraries when completing the require statements. > (An extra weird thing about the require completion is, that gtk2/base > (instead of just gtk2 ! ), gnome2, libglade and others are there, but > others like atk and bonobo2 aren't) > One thing to note about this, though, is that my libraries are not > included in ruby/1.9.1/, but instead in ruby/site_ruby/1.9.1/ (and > they are still picked up by ruby itself) > > Is there any way to add code completion for these self-compiled libraries? > > Thanks, > > DS > ------------------------------------------------------------------------ > Minder SPAM in de verbeterde Windows Live Hotmail <http://mail.live.com> --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
|
|
|
Re: (Custom) code completion for .so filesAnonymous wrote: > Hi, > > Thanks for your help. > > About the require's: adding /usr/local/lib/ruby/site_ruby/1.9.1 as a > source path had no effect, but I did find something. > Every library that Netbeans recognizes, has at leas /something/ declared. > When I just added a dummy 'module bonobo; end;' to a file called > bonobo2.rb (which normally only included 2 other 'require' lines), I > /could/ see the entry. It was called bonobo2, and behind that, the > dummy module name. > So apparently, Netbeans only recognizes files with something declared > in it. Bug? Could be a bug indeed unless the IDE for some reason skips empty files intentionally for a reason I can't remember now. I'll take a look at it anyway. > > I haven't tried the generator yet, but I will definitely look in to it. > I'm not sure that the generator will work for me, so just in case; is > there a way to define the stubs manually? Basically just skeleton classes anywhere in the source roots (either project's or platform's) should work as long as the files are compilable. > I remember with NB 6.5 that I tried making my own stubs, but that failed. It might have had to do with the fact in 6.5 the stubs in rubystubs/1.8.7-p72 were preindexed, at least if you tried putting your stubs to that directory. > > Also, some files in rubystubs/1.8.7-p72/ have stub_<name>.rb (like > stub_file.rb), but others just <name>.rb (like socket.rb) .. is there > anything special about this? The indexer has a bit of special handling for stub_* files in the rubystubs/1.8.7-p72 directory, but for your own stubs it shouldn't make any difference (as long as they're not in rubystubs/1.8.7-p72) . > Also, like I just said, they are stored in 1.8.7-p72 .. and I have > 1.9.1.. .. that won't be too problematic I hope? Shouldn't be, but note that you don't need to put your stubs to rubystubs/1.8.7-p72 . Cheers, Erno > > Thanks, > > DS > > Erno Mononen wrote: >> Hi, >> One problem here might be that the IDE doesn't recognize >> ruby/site_ruby/1.9.1/ as a ruby lib dir, it assumes the site_ruby dir >> is located at <ruby_home>/lib/ruby/site_ruby. So the dir doesn't get >> scanned by the IDE and hence nothing from there is shown in code >> completion. Since ruby/site_ruby/1.9.1/ appears to a valid location >> for site_ruby, this should probably be fixed in in the IDE. As an >> experiment you may try adding the dir as a source root to your >> project (in Project Properties -> Sources), this way the IDE should >> index all the ruby files in the dir, but it isn't really a real >> solution for this. >> >> Another problem is that the IDE can't index native libraries (C >> files), you'd have to generate "ruby stubs" (i.e. skeleton ruby class >> files) from the .c files and place those stubs into a directory where >> the IDE will find them. We generate stubs for the native built-in >> Ruby classes, but I don't know how easily this could be done for gtk2 >> and other libraries. I can give it a try at some point, but if you >> want to play with this yourself, you need to clone >> http://hg.netbeans.org/main/misc and then check the rdocscanner and >> generator projects in ruby/stubs. ruby/stubs/UPDATE.txt describes the >> process, but it may be rather hard to get started with it though - if >> you decide to try it, please feel free to ask here in case of any >> problems. >> >> Erno >> >> >> Death Star wrote: >>> Hi, >>> >>> I compiled and installed ruby 1.9 myself. >>> I also compiled and installed several ruby- libraries (in lack of a >>> better word; I mean the .so files), amongst others gnome2 and it's >>> sub-package gtk2. (Note: because these are compiled by myself, these >>> aren't gems) >>> >>> Now, I really like code completion (as an aid), and especially for >>> new (for me) and big libraries like gtk2, it's a really use full >>> function. >>> The thing is, however, that there is no code completion for things >>> like gnome2, gtk2, or gosu. This is of course understandable.. but I >>> can't find a way to add this myself. Is there any way to let >>> Netbeans know about any of this? >>> >>> Netbeans doesn't only 'not know' what to code complete; but it also >>> can't find the extra libraries when completing the require statements. >>> (An extra weird thing about the require completion is, that >>> gtk2/base (instead of just gtk2 ! ), gnome2, libglade and others are >>> there, but others like atk and bonobo2 aren't) >>> One thing to note about this, though, is that my libraries are not >>> included in ruby/1.9.1/, but instead in ruby/site_ruby/1.9.1/ (and >>> they are still picked up by ruby itself) >>> >>> Is there any way to add code completion for these self-compiled >>> libraries? >>> >>> Thanks, >>> >>> DS >>> ------------------------------------------------------------------------ >>> >>> Minder SPAM in de verbeterde Windows Live Hotmail >>> <http://mail.live.com> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@... > For additional commands, e-mail: users-help@... > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
| Free embeddable forum powered by Nabble | Forum Help |