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 454796 - Completion popup for gtksourceview
Completion popup for gtksourceview
Status: RESOLVED OBSOLETE
Product: gtksourceview
Classification: Platform
Component: General
git master
Other All
: Normal enhancement
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2007-07-08 10:27 UTC by chuchiperriman
Modified: 2007-08-12 20:03 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
completion data (6.02 KB, text/x-csrc)
2007-07-08 10:32 UTC, chuchiperriman
  Details
completion data header (2.39 KB, text/x-chdr)
2007-07-08 10:32 UTC, chuchiperriman
  Details
the principal popup (22.58 KB, text/x-csrc)
2007-07-08 10:33 UTC, chuchiperriman
  Details
the principal popup (header) (3.52 KB, text/x-chdr)
2007-07-08 10:33 UTC, chuchiperriman
  Details
the completion data provider (2.84 KB, text/x-csrc)
2007-07-08 10:34 UTC, chuchiperriman
  Details
the completion data provider (header) (1.91 KB, text/x-chdr)
2007-07-08 10:34 UTC, chuchiperriman
  Details
Utils used by completion objects (4.32 KB, text/x-csrc)
2007-07-08 10:34 UTC, chuchiperriman
  Details
Utils used by completion objects (header) (1.49 KB, text/x-chdr)
2007-07-08 10:35 UTC, chuchiperriman
  Details
gtksourceview.c patch (2.91 KB, patch)
2007-07-08 10:35 UTC, chuchiperriman
none Details | Review
gtksourceview.h patch (799 bytes, patch)
2007-07-08 10:35 UTC, chuchiperriman
none Details | Review
Makefile.am patch (833 bytes, patch)
2007-07-08 10:36 UTC, chuchiperriman
none Details | Review
completion data (5.21 KB, text/x-csrc)
2007-07-09 00:26 UTC, chuchiperriman
  Details
completion data header (3.08 KB, text/x-chdr)
2007-07-09 00:27 UTC, chuchiperriman
  Details
the principal popup (22.50 KB, text/x-csrc)
2007-07-09 00:27 UTC, chuchiperriman
  Details
the completion data provider (header) (3.32 KB, text/x-chdr)
2007-07-09 00:27 UTC, chuchiperriman
  Details
the completion data provider (3.60 KB, text/x-csrc)
2007-07-09 00:28 UTC, chuchiperriman
  Details
the completion data provider (header) (2.80 KB, text/x-chdr)
2007-07-09 00:28 UTC, chuchiperriman
  Details
Utils used by completion objects (4.19 KB, text/x-csrc)
2007-07-09 00:28 UTC, chuchiperriman
  Details
Utils used by completion objects (header) (1.44 KB, text/x-chdr)
2007-07-09 00:29 UTC, chuchiperriman
  Details
gtksourceview.c patch (2.86 KB, patch)
2007-07-09 00:31 UTC, chuchiperriman
none Details | Review
gtksourceview.h patch (787 bytes, patch)
2007-07-09 00:31 UTC, chuchiperriman
none Details | Review
Makefile.am patch (801 bytes, patch)
2007-07-09 00:32 UTC, chuchiperriman
none Details | Review
gtksourcecompletion.c (21.26 KB, text/x-csrc)
2007-07-28 21:55 UTC, chuchiperriman
  Details
gtksourcecompletion.h (3.24 KB, text/x-chdr)
2007-07-28 21:56 UTC, chuchiperriman
  Details
gtksourcecompletion-events.c (4.76 KB, text/x-csrc)
2007-07-28 21:56 UTC, chuchiperriman
  Details
gtksourcecompletion-events.h (1.76 KB, text/x-chdr)
2007-07-28 21:57 UTC, chuchiperriman
  Details
gtksourcecompletion-provider.c (3.17 KB, text/x-csrc)
2007-07-28 21:57 UTC, chuchiperriman
  Details
gtksourcecompletion-provider.h (2.57 KB, text/x-chdr)
2007-07-28 21:57 UTC, chuchiperriman
  Details
gtksourcecompletion-utils.c (4.19 KB, text/x-csrc)
2007-07-28 21:58 UTC, chuchiperriman
  Details
gtksourcecompletion-utils.h (1.44 KB, text/x-chdr)
2007-07-28 21:58 UTC, chuchiperriman
  Details
gtksourceview.diff (4.69 KB, patch)
2007-07-28 22:03 UTC, chuchiperriman
none Details | Review
completiontest.tar.gz (gedit plugin) (59.61 KB, application/x-gzip)
2007-07-28 22:12 UTC, chuchiperriman
  Details

Description chuchiperriman 2007-07-08 10:27:00 UTC
I am developed a popup to gtksourceview. It supports add new data providers, add custom events, raise completion by code, automatically or when the users press control+return.

It is a generic popup without any provider. The application developer may add the provider that he wants (autocompletion, snippets provider, symbols provider etc.)
Comment 1 chuchiperriman 2007-07-08 10:29:10 UTC
I upload the patch. Really is a gzip with the new files and with come diff of files modified.

I try to upload a gedit plugin example using the completion support and you can see the easy of use this popup and develop new providers.
Comment 2 chuchiperriman 2007-07-08 10:32:35 UTC
Created attachment 91407 [details]
completion data
Comment 3 chuchiperriman 2007-07-08 10:32:53 UTC
Created attachment 91408 [details]
completion data header
Comment 4 chuchiperriman 2007-07-08 10:33:24 UTC
Created attachment 91410 [details]
the principal popup
Comment 5 chuchiperriman 2007-07-08 10:33:40 UTC
Created attachment 91411 [details]
the principal popup (header)
Comment 6 chuchiperriman 2007-07-08 10:34:01 UTC
Created attachment 91412 [details]
the completion data provider
Comment 7 chuchiperriman 2007-07-08 10:34:18 UTC
Created attachment 91413 [details]
the completion data provider (header)
Comment 8 chuchiperriman 2007-07-08 10:34:45 UTC
Created attachment 91414 [details]
Utils used by completion objects
Comment 9 chuchiperriman 2007-07-08 10:35:05 UTC
Created attachment 91415 [details]
Utils used by completion objects (header)
Comment 10 chuchiperriman 2007-07-08 10:35:34 UTC
Created attachment 91416 [details] [review]
gtksourceview.c patch
Comment 11 chuchiperriman 2007-07-08 10:35:55 UTC
Created attachment 91417 [details] [review]
gtksourceview.h patch
Comment 12 chuchiperriman 2007-07-08 10:36:17 UTC
Created attachment 91418 [details] [review]
Makefile.am patch
Comment 13 chuchiperriman 2007-07-09 00:26:42 UTC
Created attachment 91455 [details]
completion data
Comment 14 chuchiperriman 2007-07-09 00:27:07 UTC
Created attachment 91456 [details]
completion data header
Comment 15 chuchiperriman 2007-07-09 00:27:28 UTC
Created attachment 91457 [details]
the principal popup
Comment 16 chuchiperriman 2007-07-09 00:27:42 UTC
Created attachment 91458 [details]
the completion data provider (header)
Comment 17 chuchiperriman 2007-07-09 00:28:03 UTC
Created attachment 91459 [details]
the completion data provider
Comment 18 chuchiperriman 2007-07-09 00:28:19 UTC
Created attachment 91460 [details]
the completion data provider (header)
Comment 19 chuchiperriman 2007-07-09 00:28:44 UTC
Created attachment 91461 [details]
Utils used by completion objects
Comment 20 chuchiperriman 2007-07-09 00:29:03 UTC
Created attachment 91462 [details]
Utils used by completion objects (header)
Comment 21 chuchiperriman 2007-07-09 00:31:21 UTC
Created attachment 91463 [details] [review]
gtksourceview.c patch
Comment 22 chuchiperriman 2007-07-09 00:31:42 UTC
Created attachment 91464 [details] [review]
gtksourceview.h patch
Comment 23 chuchiperriman 2007-07-09 00:32:02 UTC
Created attachment 91465 [details] [review]
Makefile.am patch
Comment 24 chuchiperriman 2007-07-09 00:35:34 UTC
.- I have changed the objects names from gtk-source-view-completion... to gtk-source-completion.

.- I have added the license in all files

.- I have cleaned some vala and gob code

.- I have removed some spanish comments

.- I have formatted some functions to gnome style

If you think that there are something wrong, make me know please.
Comment 25 Paolo Maggi 2007-07-09 14:48:37 UTC
Could you please give us  more info about this patch?

I only read the gtksource-completion-data.h file. Here my comments:

- it seems there is no way to prioritize items
- GtkSourceCompletionData is a GObject, so there is no need to a special free function
- I don't thinks GtkSourceCompletionData should be a GObject, probably a boxed type is enough
- It would be nice to be able to add additional info to a completion item, like for example a "help" message, like in Eclipse. 
- I don't think using a GdkPixbuf for the icon is a good idea, there should be a way to use stock icons to promote consistency.
Comment 26 chuchiperriman 2007-07-10 11:52:46 UTC
I have create a wiki page on http://live.gnome.org/GtkSourceView/GtkSourceCompletion where I explain a bit GtkSourceCompletion. I will write more about.

- Completion cannot prioritize data. I was waitting to talk with gtksourceview developers and take a solution for it. i think we can add an int field priority and order the items, or add an int field and prioritize the providers.

- If GtkSourceCompletionData isn't a GObject, you cannot override it. Perhaps we can  create a boxed type but we need add some more functions to data provider to manage the data content. 

- I will add to completion a "preview" but I need to talk you you about how you want to do it. Perhaps a tooltip near the item or a GtkSourceView on the right of data list shown the preview of the selected item etc...

- I think GdkPixbuf is good because a program like openldev or anjuta can change the default icons. We can add a new method to support stock icons.


If you want, we can talk about it on IRC and we can write some changes and I modify the code.
Comment 27 chuchiperriman 2007-07-20 20:38:08 UTC
I have changed some things:

 - Added a priority property to GtkSourceCompletionData
 - GtkSourceCompletionPopup sort all items by priority
 - I have removed gtk_source_completion_popup_add_event
 - I have changed gtk_source_completion_popup_register_provider. Now you must 
   pass a parameter with the event name. When an event occurs, the popup only call
   the providers registered for this event.

If you have some another change, make me know.
Comment 28 chuchiperriman 2007-07-28 21:55:13 UTC
Created attachment 92617 [details]
gtksourcecompletion.c
Comment 29 chuchiperriman 2007-07-28 21:56:11 UTC
Created attachment 92618 [details]
gtksourcecompletion.h
Comment 30 chuchiperriman 2007-07-28 21:56:40 UTC
Created attachment 92619 [details]
gtksourcecompletion-events.c
Comment 31 chuchiperriman 2007-07-28 21:57:04 UTC
Created attachment 92620 [details]
gtksourcecompletion-events.h
Comment 32 chuchiperriman 2007-07-28 21:57:31 UTC
Created attachment 92621 [details]
gtksourcecompletion-provider.c
Comment 33 chuchiperriman 2007-07-28 21:57:59 UTC
Created attachment 92622 [details]
gtksourcecompletion-provider.h
Comment 34 chuchiperriman 2007-07-28 21:58:31 UTC
Created attachment 92623 [details]
gtksourcecompletion-utils.c
Comment 35 chuchiperriman 2007-07-28 21:58:56 UTC
Created attachment 92624 [details]
gtksourcecompletion-utils.h
Comment 36 chuchiperriman 2007-07-28 22:03:03 UTC
Created attachment 92625 [details] [review]
gtksourceview.diff
Comment 37 chuchiperriman 2007-07-28 22:10:07 UTC
Hi all again,

I have refactored the code and cleaned some issues:

1.- GtkSourceCompletionData: now is GtkSourceCompletionItem and it isn't a GObject, only a boxed type.

2.- Events are in a separate file called gtksourcecompletion-events.c. There are two implemented events: user request event and autocompletion event.

3.- GtkSourceCompletionPopup is now GtkSourceCompletion

4.- Renamed some variables.
Comment 38 chuchiperriman 2007-07-28 22:12:41 UTC
Created attachment 92626 [details]
completiontest.tar.gz (gedit plugin)
Comment 39 chuchiperriman 2007-07-28 22:15:53 UTC
I have attached a gedit plugin using the completion mechanism. with only a few lines, we can create a provider and activate the completion support.

This plugin is very simple, only shows constant data in user request event and use the priority feature. It use autocompletion event too, showing some lines with the actual word.

Comment 40 chuchiperriman 2007-08-12 20:03:10 UTC
I have created a new library: gtksourcecompletion. Perhaps we add this functionality to gtksourceview in a future. Now, you can download the completion support at http://tools.assembla.com/gtkdevtools. There are two packages, the gtksourcecompletion library and a gedit plugin using it. The plugin complete words wrotten in the document.

The code is very changed (but not the api) and we have a lot of new features.

Regards,
Chuchi