Re: Code completion proposal for GtkSourceView



On Fri, 14 Jan 2005 17:34:54 -0500, Jae Jang <jae jang gmail com> wrote:

Hi,

> how about using tags files... don't most editors make use of ctags
> generated tags files? Doing a binary search on the content in tags
> files (which are stored presorted I believe), is supposedly pretty
> efficient even for "realtime" look ups.
> 
> Maybe a simple interface to tags files is all that's necessary.

The proposed API has, in fact, no implementation whatsoever[1] of a
code completion: that is left to the implementor of an editor, since
there are as different implementation as humans on the face of the
planet (at most), and implementing all of those inside
libgtksourceview would be just dumb. My proposal just tries to offer a
unified API for implementing code completion; plus, using
GtkSourceCompletionDialog (or also adding a GtkSourceCompletionTip),
users of libgtksourceview will be able to get a unified UI for their
needs, thus giving a consistent look to each application using
GtkSourceView.

> IMHO i think at the very most, gtksourceview should only have api's
> for stuff like bringing up calltips at the current cursor position,
> populating calltips (gtksourceview itself shouldn't have to know what
> to populate), handling events within calltips, completing the word
> after user chooses a option from the calltip, etc.

That is exactely the spirit of my proposal.

> In reality, I don't think this stuff is gtksourceview specific
> enough... should just separate it out so you can use it from regular
> textviews and other stuff... and keep gtksourceview simple and clean
> :-P

Creating Yet Another Library on the chain is something that I do not
advice: it would mean - at least - a runtime dependency, or - at most
- a compile time dependency. Over-dependencism is bad. And since
GtkSOurceView is a widget ofr source editors, giving an API for code
completion fits perfectly to the task of libgtksourceview.
 
Regards,
 Emmanuele.

[1] Well, I was hoping to add a simple "string match" as a default
completion engine, in order to achieve at least the ViM "Ctrl+N"
functionality.

-- 
It is against the grain of modern education to teach children to program.
What fun is there in making plans, acquiring discipline in organizing
thoughts, devoting attention to detail, and learning to be self-critical?
                -- Alan Perlis



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]