This site has been retired. For up to date information, see handbook.gnome.org or gitlab.gnome.org.


[Home] [TitleIndex] [WordIndex

Google Summer of Code 2013 proposal, by SébastienWilmet

1. GtkSourceView: add regex search and modernize existing features

1.0.1. Update

1.0.2. What is your e-mail address and IRC nick?

e-mail: swilmet@gnome.org

IRC nick: swilmet

1.0.3. Do you have a web page, blog, or microblog?

http://blogs.gnome.org/swilmet/

1.0.4. What is your academic background?

I study computer science at the Université Catholique de Louvain (Belgium). I'm currently at the first year of the master degree.

1.0.5. What is the ultimate goal of your proposal?

Broadly speaking, the purpose is to improve the developer experience when editing source code. The proposal involves primarily GtkSourceView, but some changes in other places of the stack are planned too. More precisely, here are what I would like to achieve:

The current API for searching text is basically two functions: forward_search() and backward_search(), with some flags. Lots of work is delegated to the application, such as highlighting the matches.

The idea is to have a higher level API in GtkSourceView, to asynchronously highlight the matches and report some pieces of information, like the total number of occurrences, and on which occurrence we are (to display something like "3 of 10" in the search entry).

It is currently not possible to perform a regular expression search (or a search and replace). I would like to add this feature to GTK+.

Use the new API in gedit, and be able to perform regex searches.

Currently the color scheme definitions (for syntax highlighting, background colors, …) are written in XML. The files are read by GtkSourceView and the data is exposed through an API. But this API is not really flexible. For example, it is not possible to override styles with user configurable settings.

We live in the GTK+ 3 era now, so it would be great to take advantage of all the goodness of the CSS machinery. The color scheme definitions would be converted to CSS (with a script), and it would be possible to override the styles.

1.0.6. What components/modules will the proposed work modify or create?

It will modify GtkSourceView, gedit and GTK+.

1.0.7. What benefits does your proposed work have for GNOME and its community?

GtkSourceView is a crucial component for text editors and IDEs in GNOME: gedit, Anjuta, LaTeXila, and others. Improving the former thus improve also the latter projects. GtkSourceView will also be a more solid ground for the upcoming GNOME JavaScript IDE.

1.0.8. Why are you the right person to work on this project?

Although it would be my first GSoC, I already have some years of experience in GNOME development. I co-maintain GtkSourceView, and I'm the main developer of LaTeXila, a LaTeX editor that uses GtkSourceView. I'm also a member of the GNOME Foundation since 2012.

1.0.9. How do you plan to achieve completion of your project?

Discuss API changes before the GSoC begins (at least for the first tasks). During the GSoC:

The first step is to have a GtkSourceTag class, a subclass of GtkTextTag, that has an associated style context. The CSS styles must be converted to the GtkTextTag properties (foreground and background colors, …). And use GtkSourceTag for the syntax highlighting.

Define a format for the style schemes (it must be valid CSS, but also carry some metadata like the author and the theme name). Write a script to convert the current style schemes from XML to CSS.

The priority is to finish the previous points, and make sure it is stable. But if time permits, I can investigate the required modifications to feed back GtkTextTag CSS styling in GTK+ itself.

1.0.10. What will be showable at mid-term?

The new search API in action in gedit, with the regex search.

1.0.11. What are your past experiences with the open source world as a user and as a contributor?

I've discovered GNU/Linux and GNOME in 2005. Apart from reporting bugs, my first contribution was to help the French translation of klavaro.

In 2009 I began LaTeXila during the summer. I made the mistake to begin a personal project instead of contributing to an existing one, so after several months, a rewrite was necessary. But I've learned lots of things, a big part of the code is in a good shape now (from my point of view), and users are happy with the features.

Apart from writing patches here and there, I began contributing to GtkSourceView in 2012, mainly on the completion framework (see this blog post).

1.0.12. What other relevant projects have you worked on previously and what knowledge you gained from working on them?

In summary:

1.0.13. Will you have any other time commitments, such as school work, another job, planned vacation, etc., between June 17 and September 23?

I have exams during the first week of the GSoC.


2024-10-23 11:28