Monthly Archives: August 2013

Adding a backend in Gedit Code Assistance Plugin

I’ve noticed that Gedit Code Assistance Plugin misses (or it’s not easy to search) some page like that: https://live.gnome.org/Gedit/PythonPluginHowTo where you can find the steps to create a plugin for Gedit by yourself. Maybe because this plugin are still in development.

This kind of page are important to find more contributors, to auxiliary developers and document the project.  So, I’ve decided to use this blog to show and describe steps that I followed during my development. I got this steps with assistance of my mentors Paolo and Ignacio.  As Paolo said “Code assistance supports plugin itself – plugins of plugin”.

So…

After you have installed JHBuild and been able to use Gedit 3.9 you can start to devel new features for Gedit Code Assistance (Gcp), such as making Gcp supports other programming languages.

First of all, you need to install Gedit-Code-Assistance. For this:

1- Clone Gcp from repository:

git clone https://git.gnome.org/gedit-code-assistance/

2- Using JHbuild enviroment, follow installation steps of README file. Pay attention with dependencies and install them using JHBuild as well.

3 – Test if your Gcp is working fine. To turn it on, you need to select on menu bar Preferences > Plugins > Gedit Code Assistance. Note that, for Gnome 3.10, Gedit Preferences are on top bar of your desktop enviroment. So, you will not find this on the Gedit Window.

After everything has occurred fine, you need to create a space to put your backend and turn it visible for Gcp:

1 – As languages already supported by plugin, create a folder in “backends” with the name of your language. In my case was backends/vala

2 – You can copy files from python folder: renaming to your language (gcpbackendpython.plugin -> gcpbackend<your_language>.plugin, modifing metadatas such as:

Loader (C is default): it is about language that you are writting your plugin.

X-Languages: this is about the new backend that you wanna implement

3 – You need to include somethings in auto tool’s configuration file:

  • In backends/Makefile.am:
    SUBDIRS += <folder_of_your_language>
  • In backends/<your_folder_language>/Makefile.am:
    If you are using vala, use C Makefile.am and change “SOURCES =”, “valapkgs =”, “plugin_DATA”, “EXTRA_DIST = ” and “GITIGNOREFILES =” as convenient.
  • In configure.ac
    – PKG_CHECK_MODULES: create a one related to your language packages

     – AC_CONFIG_FILES: add path related to your Makefile language

Next post I will describe files where you will develop your plugin

backends/vala/Makefile

Advertisements

“I have a dream…”

After FISL’s week, I came back to work on my project and, passed a few days, I was unmotivated about it. This happened for two reasons:
1- I had a deadline to fulfill, but I didn’t get progress in understanding of the issue which I needed to solve. I knew what I need to do and a notion about how gcp tool work, but I didn’t understand how I would do. I was confused about if I was really doing something.
2- I had activities (out of my project) to do and I didn’t have time enough to dedicate in my project. I didn’t realize how to organize my time.

For a while, I considered to give up. I was talking with others interns about my missed deadline and they said “Oh, I also had this problem”.
So, my mentor, Paolo asked me something like: “how is it going?” and completed with “We can help you, but you need to find what problem you need our help” That day I’ve dreamed (or a nightmare) with Paolo and Ignacio. It was funny because I don’t meet them, so, my brain just put their hackergotchis on a body and they talked with me that I need to work and do something.

I woke up anguished! Hahahaha… But I decided to focus on my project and “do something”

And, after some days (really) trying, I began to understand HOW I will do!

I don’t understand why I thought I didn’t do! For my first contribution, I had the same questions about HOW and the same problem with slow progress! But after a slow progress in the begining I improved exponentialy my performance.

And now… I’m progressing.