Re: Proposal: GtkSourceCompletion into GtkSourceView
Paolo Maggi <[email protected]> Fri, 25 Apr 2008 19:46:04 +0200
| Newsgroups | gmane.comp.gnome.devtools |
|---|---|
| Message-ID | <1209145564.6005.4.camel@localhost> |
[Resending to the gnome-devtools list] Hi perriman, as you know we would love to have support for "auto-completion" in GtkSourceView, and we are aware of your effort in developing the GtkSourceCompletion library. Today, pbor and I have reviewed the architecture and API of your library and have compared it with other similar libraries, in particular with the one used by Eclipse [1][2]. We think the architecture of your library is good and not so different by the one of ContentAssistant in Eclipse. In particular we agree on having a "completion" object, connected to a source viewer, that provides support on interactive content completion. Its purpose is to propose, display, and insert completions of the content of the source viewer's document at the viewer's cursor position. A "completion" object manages a list of "completion provider" objects. These ones compute the "completion proposals" and, if required, are responsible to "apply" the proposal to the document. Clients must register "triggers" on the "completion" object. Their role is to make the "completion" know when it must show the "completion proposals" to the user. As you can see, the architecture I have described is very similar to the one implemented by your library. Although the architecture of your library seems sound, we think the API and the coding style need some love before being ready to be included in GtkSourceView. In order to speed up the process of defining a revised API, pbor and I will propose a new (documented) API. This one will be publicly discussed with you and with all the people interested in this argument. When the API will be defined, we will try to sketch up an implementation plan. We hope to be able to re-used as much code as possible from your current library. What do you think about this plan? Regards, Paolo ----- [1] The documentation of the ContentAssistant class: http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/text/contentassist/IContentAssistant.html [2] An interesting article on how to add content assistants to a SWT-based editor: http://www.ibm.com/developerworks/opensource/library/os-ecca/?ca=dgr-lnxw09SWTContentAssist%22