After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 630198 - Auto Completion does not work properly as needed.
Auto Completion does not work properly as needed.
Status: RESOLVED OBSOLETE
Product: anjuta
Classification: Applications
Component: plugins: language-support-c-cpp-java
2.30.x
Other Linux
: Normal enhancement
: ---
Assigned To: Naba Kumar
Anjuta maintainers
Depends on:
Blocks:
 
 
Reported: 2010-09-20 19:01 UTC by Mohammad Alhobayyeb
Modified: 2020-11-07 12:12 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Mohammad Alhobayyeb 2010-09-20 19:01:01 UTC
You have to write 4 letters to see the auto complete menu.

A: It should be configurable so I can change the number of letters before showing the menu.

B: The menu of auto complete should appear directly after (::) (->) or (.)

C: The menu does not show related suggestions it shows all the available suggestions in the database.

Example:

If you loaded the gtkmm libraries in "Symbol Database" and you worked with a c++ file that did not included any gtkmm library. If you typed (Gtk::Butt) you will see the auto complete menu and you will get all gtkmm items there with Butt.

It should show them only if the file gtkmm.h included.
Comment 1 Johannes Schmid 2010-09-20 19:07:00 UTC
> A: It should be configurable so I can change the number of letters before
> showing the menu.

That could be done rather easy. I was removed because it didn't make much sense to use less than 3 characters.
 
> B: The menu of auto complete should appear directly after (::) (->) or (.)

It does, if it can find suggestions, there is another bug though about improving the coverage of the expression parser.

> C: The menu does not show related suggestions it shows all the available
> suggestions in the database.
> 
> Example:
> 
> If you loaded the gtkmm libraries in "Symbol Database" and you worked with a
> c++ file that did not included any gtkmm library. If you typed (Gtk::Butt) you
> will see the auto complete menu and you will get all gtkmm items there with
> Butt.
> 
> It should show them only if the file gtkmm.h included.

Well, anjuta doesn't (and can't) look at the header files included. As such, it gives you completions for all the libraries included in the project.

Example:
test.cc includes test.h, test.h includes test2.h which includes test3.h and this somehow includes gtkmm.h - hardly possible to get that right.
Comment 2 Mohammad Alhobayyeb 2010-09-20 20:41:08 UTC
(In reply to comment #1)
> Well, anjuta doesn't (and can't) look at the header files included. As such, it
> gives you completions for all the libraries included in the project.
> 
> Example:
> test.cc includes test.h, test.h includes test2.h which includes test3.h and
> this somehow includes gtkmm.h - hardly possible to get that right.

I think you did not get my idea, since this is how Qt Creator work.

I mean just like in Qt Creator (Have you used it? Try it.)
In Qt Creator, if you do not included <iostream> the auto complete menu will not appear after typing "std::" simply because you did not include the file that contain it. Got my Idea?
Comment 3 Naba Kumar 2010-12-11 11:31:40 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Well, anjuta doesn't (and can't) look at the header files included. As such, it
> > gives you completions for all the libraries included in the project.
> > 
> > Example:
> > test.cc includes test.h, test.h includes test2.h which includes test3.h and
> > this somehow includes gtkmm.h - hardly possible to get that right.
> 
> I think you did not get my idea, since this is how Qt Creator work.
> 
> I mean just like in Qt Creator (Have you used it? Try it.)
> In Qt Creator, if you do not included <iostream> the auto complete menu will
> not appear after typing "std::" simply because you did not include the file
> that contain it. Got my Idea?

I would say that part of autocomplete usefulness is also to help you complete APIs you may not have thought of including/using beforehand. One can of course argue which one should be decided first, but it's quite normal to go back and forth between writing the code first or including the necessary headers first. 

Sometimes, it can even be used to see what available APIs are there to tackle a specific situation - which is more of an experimentation than a pre-determined intention to use a known function.

So, what I am trying to say is that it should be user configurable preference, rather than permanent behavior. In small projects and well spaced APIs, global autocomplete is instant search for system APIs. While in large projects with very tight API spacing, it can be overwhelming.
Comment 4 André Klapper 2020-11-07 12:12:14 UTC
bugzilla.gnome.org is being replaced by gitlab.gnome.org. We are closing all
old feature requests in Bugzilla which have not seen updates for many years.

If you are still requesting this feature in a currently supported version of GNOME (currently that would be 3.38), then please feel free to report it at https://gitlab.gnome.org/GNOME/anjuta/-/issues/

Thank you for reporting this issue and we are sorry it could not be implemented.