NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Codecomplete aka autocomplete broken for Ruby on rails development

 
Post new topic   Reply to topic    NetBeans Forums -> Ruby Users
View previous topic :: View next topic  
Author Message
bhavinb



Joined: 09 Feb 2010
Posts: 1

PostPosted: Tue Feb 09, 2010 5:43 am    Post subject: Codecomplete aka autocomplete broken for Ruby on rails development Reply with quote

I am using Netbeans v6.8 on Ubuntu 9.10 for Ruby on Rails development.

My problem is that autocomplete works very inconsistently. For example, when I hit ctrl+space after typing "File.", I get all the methods neatly defined at the top in bold that can be called on the class. This list is demarcated and followed by all the other hundreds of methods from classes/modules other than File.

But if I hit ctrl+space on some other clause such as "ActionController::Base::logger.", I don't see the methods such as 'info' or 'error' at the top. I just get the generic hundreds of method listed alphabetically (info and error are from the logger class are included in this list but they are interspersed with the rest of the methods and hence not discoverable unless you know what you are looking for).

I initially thought that codecomplete just works for Ruby classes and not Rails but this is not the case as I can get it to work for some Rails classes quite accurately and consistenly.

This is getting very frustrating. Can someone please suggest a solution?
Back to top
Erno Mononen
Posted via mailing list.





PostPosted: Tue Feb 09, 2010 2:12 pm    Post subject: Codecomplete aka autocomplete broken for Ruby on rails development Reply with quote

Hi,

I think in this particular case the problem is that the IDE can't infer
the type for ActionController::Base::logger, so it just shows the
default code completion list. 'logger' is a class var in
ActionController::Base and since it isn't initialized in the same file,
its type is unknown to the IDE (this is currently a limitation in the
IDE indexing infrastructure).

However, I think we should add some special case handling for this as it
is a rather common case, I will try to do that for 6.9 (if you like you
can file an issue to track this at
https://netbeans.org/bugzilla/enter_bug.cgi). Do you have any other such
cases in mind? I could add support for them too. Of course, best would
be to have a general solution for this, i.e. in this case the IDE should
track wherever the logger is initialized and index its type correctly. I
plan to work on indexing improvements for 6.9, but can't yet tell
whether there'll be enough time to implement this specific enhancement.

Thanks,
Erno

bhavinb wrote:
Quote:
I am using Netbeans v6.8 on Ubuntu 9.10 for Ruby on Rails development.

My problem is that autocomplete works very inconsistently. For example, when I hit ctrl+space after typing "File.", I get all the methods neatly defined at the top in bold that can be called on the class. This list is demarcated and followed by all the other hundreds of methods from classes/modules other than File.

But if I hit ctrl+space on some other clause such as "ActionController::Base::logger.", I don't see the methods such as 'info' or 'error' at the top. I just get the generic hundreds of method listed alphabetically (info and error are from the logger class are included in this list but they are interspersed with the rest of the methods and hence not discoverable unless you know what you are looking for).

I initially thought that codecomplete just works for Ruby classes and not Rails but this is not the case as I can get it to work for some Rails classes quite accurately and consistenly.

This is getting very frustrating. Can someone please suggest a solution?





Back to top
Paul Rosen
Posted via mailing list.





PostPosted: Tue Feb 09, 2010 2:38 pm    Post subject: Codecomplete aka autocomplete broken for Ruby on rails development Reply with quote

I've noticed this too, especially in views contained in html.erb files.

The biggest thing I need CodeComplete for is the models that I create,
and mostly for a list of the fields that are in the database for models
that are based on ActiveRecord.

The other thing that would be great (but I'm not sure what the UI would
be) is if there were some way to get a list of all helper methods I've
created, again when in html.erb files.

Keep up the good work. 6.8 has a much better UX for me than 6.7.

Erno Mononen wrote:
Quote:
Hi,

I think in this particular case the problem is that the IDE can't infer
the type for ActionController::Base::logger, so it just shows the
default code completion list. 'logger' is a class var in
ActionController::Base and since it isn't initialized in the same file,
its type is unknown to the IDE (this is currently a limitation in the
IDE indexing infrastructure).

However, I think we should add some special case handling for this as it
is a rather common case, I will try to do that for 6.9 (if you like you
can file an issue to track this at
https://netbeans.org/bugzilla/enter_bug.cgi). Do you have any other such
cases in mind? I could add support for them too. Of course, best would
be to have a general solution for this, i.e. in this case the IDE should
track wherever the logger is initialized and index its type correctly. I
plan to work on indexing improvements for 6.9, but can't yet tell
whether there'll be enough time to implement this specific enhancement.

Thanks,
Erno

bhavinb wrote:
Quote:
I am using Netbeans v6.8 on Ubuntu 9.10 for Ruby on Rails development.

My problem is that autocomplete works very inconsistently. For
example, when I hit ctrl+space after typing "File.", I get all the
methods neatly defined at the top in bold that can be called on the
class. This list is demarcated and followed by all the other hundreds
of methods from classes/modules other than File.

But if I hit ctrl+space on some other clause such as
"ActionController::Base::logger.", I don't see the methods such as
'info' or 'error' at the top. I just get the generic hundreds of
method listed alphabetically (info and error are from the logger class
are included in this list but they are interspersed with the rest of
the methods and hence not discoverable unless you know what you are
looking for).

I initially thought that codecomplete just works for Ruby classes and
not Rails but this is not the case as I can get it to work for some
Rails classes quite accurately and consistenly.

This is getting very frustrating. Can someone please suggest a solution?






Back to top
Erno Mononen
Posted via mailing list.





PostPosted: Wed Feb 10, 2010 9:28 am    Post subject: Codecomplete aka autocomplete broken for Ruby on rails development Reply with quote

Hi Paul,

thanks for the feedback. I agree support for CC for models in erb files
would be important, I will take a look at what can be done for 6.9. I
think it shouldn't be too much work, but I'll know better when I
actually start to work on it. As for the list of helper methods, the IDE
should display also helper methods in CC, but I guess you mean some
other way of viewing them (e.g. just the helper methods and nothing else)?

Thanks,
Erno

Paul Rosen wrote:
Quote:
I've noticed this too, especially in views contained in html.erb files.

The biggest thing I need CodeComplete for is the models that I create,
and mostly for a list of the fields that are in the database for
models that are based on ActiveRecord.

The other thing that would be great (but I'm not sure what the UI
would be) is if there were some way to get a list of all helper
methods I've created, again when in html.erb files.

Keep up the good work. 6.8 has a much better UX for me than 6.7.

Erno Mononen wrote:
Quote:
Hi,

I think in this particular case the problem is that the IDE can't
infer the type for ActionController::Base::logger, so it just shows
the default code completion list. 'logger' is a class var in
ActionController::Base and since it isn't initialized in the same
file, its type is unknown to the IDE (this is currently a limitation
in the IDE indexing infrastructure).

However, I think we should add some special case handling for this as
it is a rather common case, I will try to do that for 6.9 (if you
like you can file an issue to track this at
https://netbeans.org/bugzilla/enter_bug.cgi). Do you have any other
such cases in mind? I could add support for them too. Of course, best
would be to have a general solution for this, i.e. in this case the
IDE should track wherever the logger is initialized and index its
type correctly. I plan to work on indexing improvements for 6.9, but
can't yet tell whether there'll be enough time to implement this
specific enhancement.

Thanks,
Erno

bhavinb wrote:
Quote:
I am using Netbeans v6.8 on Ubuntu 9.10 for Ruby on Rails development.

My problem is that autocomplete works very inconsistently. For
example, when I hit ctrl+space after typing "File.", I get all the
methods neatly defined at the top in bold that can be called on the
class. This list is demarcated and followed by all the other
hundreds of methods from classes/modules other than File.

But if I hit ctrl+space on some other clause such as
"ActionController::Base::logger.", I don't see the methods such as
'info' or 'error' at the top. I just get the generic hundreds of
method listed alphabetically (info and error are from the logger
class are included in this list but they are interspersed with the
rest of the methods and hence not discoverable unless you know what
you are looking for).

I initially thought that codecomplete just works for Ruby classes
and not Rails but this is not the case as I can get it to work for
some Rails classes quite accurately and consistenly.

This is getting very frustrating. Can someone please suggest a
solution?







Back to top
Paul Rosen
Posted via mailing list.





PostPosted: Wed Feb 10, 2010 3:33 pm    Post subject: Codecomplete aka autocomplete broken for Ruby on rails development Reply with quote

I mean, when I'm in a view, I'll type "<%=" then think, "I know I wrote
a helper for this last year, what was it?", and since helpers are
scattered across a number of files, I have to look all over for it.

(And it's possible that there is already a key for this that I just
haven't discovered.)

There is also the case where rails supplies a helper. I usually remember
whether I wrote it or not, so having separate lists of rails helpers and
my helpers would be best for me.

Erno Mononen wrote:
Quote:
Hi Paul,

thanks for the feedback. I agree support for CC for models in erb files
would be important, I will take a look at what can be done for 6.9. I
think it shouldn't be too much work, but I'll know better when I
actually start to work on it. As for the list of helper methods, the IDE
should display also helper methods in CC, but I guess you mean some
other way of viewing them (e.g. just the helper methods and nothing else)?

Thanks,
Erno

Paul Rosen wrote:
Quote:
I've noticed this too, especially in views contained in html.erb files.

The biggest thing I need CodeComplete for is the models that I create,
and mostly for a list of the fields that are in the database for
models that are based on ActiveRecord.

The other thing that would be great (but I'm not sure what the UI
would be) is if there were some way to get a list of all helper
methods I've created, again when in html.erb files.

Keep up the good work. 6.8 has a much better UX for me than 6.7.

Erno Mononen wrote:
Quote:
Hi,

I think in this particular case the problem is that the IDE can't
infer the type for ActionController::Base::logger, so it just shows
the default code completion list. 'logger' is a class var in
ActionController::Base and since it isn't initialized in the same
file, its type is unknown to the IDE (this is currently a limitation
in the IDE indexing infrastructure).

However, I think we should add some special case handling for this as
it is a rather common case, I will try to do that for 6.9 (if you
like you can file an issue to track this at
https://netbeans.org/bugzilla/enter_bug.cgi). Do you have any other
such cases in mind? I could add support for them too. Of course, best
would be to have a general solution for this, i.e. in this case the
IDE should track wherever the logger is initialized and index its
type correctly. I plan to work on indexing improvements for 6.9, but
can't yet tell whether there'll be enough time to implement this
specific enhancement.

Thanks,
Erno

bhavinb wrote:
Quote:
I am using Netbeans v6.8 on Ubuntu 9.10 for Ruby on Rails development.

My problem is that autocomplete works very inconsistently. For
example, when I hit ctrl+space after typing "File.", I get all the
methods neatly defined at the top in bold that can be called on the
class. This list is demarcated and followed by all the other
hundreds of methods from classes/modules other than File.

But if I hit ctrl+space on some other clause such as
"ActionController::Base::logger.", I don't see the methods such as
'info' or 'error' at the top. I just get the generic hundreds of
method listed alphabetically (info and error are from the logger
class are included in this list but they are interspersed with the
rest of the methods and hence not discoverable unless you know what
you are looking for).

I initially thought that codecomplete just works for Ruby classes
and not Rails but this is not the case as I can get it to work for
some Rails classes quite accurately and consistenly.

This is getting very frustrating. Can someone please suggest a
solution?








Back to top
Erno Mononen
Posted via mailing list.





PostPosted: Thu Feb 11, 2010 9:17 am    Post subject: Codecomplete aka autocomplete broken for Ruby on rails development Reply with quote

I see, thanks for the clarification. On a related note, I did a little
testing and found some issues with CC for helper methods in views, for
example methods from ApplicationHelper were not shown. I fixed that and
another related issue, so in 6.9 this should be a bit better now.

Thanks,
Erno

Paul Rosen wrote:
Quote:
I mean, when I'm in a view, I'll type "<%=" then think, "I know I
wrote a helper for this last year, what was it?", and since helpers
are scattered across a number of files, I have to look all over for it.

(And it's possible that there is already a key for this that I just
haven't discovered.)

There is also the case where rails supplies a helper. I usually
remember whether I wrote it or not, so having separate lists of rails
helpers and my helpers would be best for me.

Erno Mononen wrote:
Quote:
Hi Paul,

thanks for the feedback. I agree support for CC for models in erb
files would be important, I will take a look at what can be done for
6.9. I think it shouldn't be too much work, but I'll know better when
I actually start to work on it. As for the list of helper methods,
the IDE should display also helper methods in CC, but I guess you
mean some other way of viewing them (e.g. just the helper methods and
nothing else)?

Thanks,
Erno

Paul Rosen wrote:
Quote:
I've noticed this too, especially in views contained in html.erb files.

The biggest thing I need CodeComplete for is the models that I
create, and mostly for a list of the fields that are in the database
for models that are based on ActiveRecord.

The other thing that would be great (but I'm not sure what the UI
would be) is if there were some way to get a list of all helper
methods I've created, again when in html.erb files.

Keep up the good work. 6.8 has a much better UX for me than 6.7.

Erno Mononen wrote:
Quote:
Hi,

I think in this particular case the problem is that the IDE can't
infer the type for ActionController::Base::logger, so it just shows
the default code completion list. 'logger' is a class var in
ActionController::Base and since it isn't initialized in the same
file, its type is unknown to the IDE (this is currently a
limitation in the IDE indexing infrastructure).

However, I think we should add some special case handling for this
as it is a rather common case, I will try to do that for 6.9 (if
you like you can file an issue to track this at
https://netbeans.org/bugzilla/enter_bug.cgi). Do you have any other
such cases in mind? I could add support for them too. Of course,
best would be to have a general solution for this, i.e. in this
case the IDE should track wherever the logger is initialized and
index its type correctly. I plan to work on indexing improvements
for 6.9, but can't yet tell whether there'll be enough time to
implement this specific enhancement.

Thanks,
Erno

bhavinb wrote:
Quote:
I am using Netbeans v6.8 on Ubuntu 9.10 for Ruby on Rails
development.

My problem is that autocomplete works very inconsistently. For
example, when I hit ctrl+space after typing "File.", I get all the
methods neatly defined at the top in bold that can be called on
the class. This list is demarcated and followed by all the other
hundreds of methods from classes/modules other than File.

But if I hit ctrl+space on some other clause such as
"ActionController::Base::logger.", I don't see the methods such as
'info' or 'error' at the top. I just get the generic hundreds of
method listed alphabetically (info and error are from the logger
class are included in this list but they are interspersed with the
rest of the methods and hence not discoverable unless you know
what you are looking for).

I initially thought that codecomplete just works for Ruby classes
and not Rails but this is not the case as I can get it to work for
some Rails classes quite accurately and consistenly.

This is getting very frustrating. Can someone please suggest a
solution?









Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Ruby Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo