viernes, 29 de junio de 2007

Fifth Status Report

* Accomplished this week:
I talked with Michael and he said it was ok if I put code completion aside for now and started working on code navigation first.

So far the class pad is filled with namespaces (nested or by full name), classes and methods/functions. When you double click on any item you are taken to the definition in the code.

The class pad information is generated using ctags, Mathias recommended I used globals (for code completion) but at least for navigation I'm using ctags because its more easily available in most distributions and for navigation it works great.

Well, not exactly *great*, let me explain. MonoDevelop creates the nodes hierarchy from top to bottom, yet ctags provides the information of its tags the other way around, for example in a class' tag you don't get any information on it's members, but in a member's tag you get information on it's class. This means the code is not as fast as it could be, but in the tests I have made the tree is still built pretty much instantly, and I don't have the fastest of computers. And since nodes are lazily built I'd expect even the largest projects to have their class pad tree to be built in acceptable time.

* Plans for upcoming week:
Finish the class pad including all of it's options.

lunes, 25 de junio de 2007

Goodbye code completion...

I hope not too many people were really looking forward to the ctags based code completion, because it has been set aside for now. I talked with Michael and he said it was ok if instead I work on code navigation. Code navigation will also use ctags, stay tuned for this week's status report.

viernes, 22 de junio de 2007

Fourth Status Report

* Accomplished this week:
Compiler errors are now parsed using regexp.
Added a ProjectServiceExtension so that *.o files are removed when the project is cleaned.
Changed the code generation panel, now the extra compiler options and extra linker options are show in a TextView each, so that you can put an extra option per line. Also added a "Define Symbols" field, by deault the Debug configuration defines DEBUG and both Debug and Release configurations define MONODEVELOP.
The Debug configuration now creates debug information.

Started work on the code completion feature, this is how its currently planned:
The code completion is done by a separate, generic AddIn which uses ctags. The goal is that this AddIn will allow to easily add basic code completion to any ctags supported language.
The ctags AddIn defines a "CTagsProject" which must be subclased by any project which wishes to use the code completion feature. Projects that inherit CTagsProject my as well ignore it completely and they won't be affected. Projects that inherit CTagsProject and do want to use the code completion feature must set the WantCodeCompletion property to true and implement AddTagsToProvider which is where the logic about which entries should be added to the completion list window takes place.

Currently the tags of a project are created when the project is built, but this will probably be moved to somewhere more appropriate.

* Plans for upcoming week
For next week I plan to implement a much more robust AddTagsToProvider so that correct tags are shown at the correct time, this will probably require a lot more work than I was expecting since tags don't work exactly as I thought they did.

* Challenges I might be facing
implementing a robust AddTagsToProvider won't be as easy as I thought because tags don't contain all the info I thought they did, for example the tag for a local variable does not contain the information about its type, also, tags for parameters are not created.

* Interesting resources
http://ctags.sourceforge.net/FORMAT
http://ctags.sourceforge.net/ctags.html

viernes, 15 de junio de 2007

Third Report

* Accomplished this week:
Changed how the compiler command is executed, instead of calling gcc/g++ directly now it calls bash.
Finished the package selection dialog.
Finished the package folder node and package nodes.
C/C++ project templates can now specify more options like arguments to send to the linker and compiler.
`pkg-config --cflags` is now only sent to the compiler and `pkg-config --libs` to the linker.
Implemented DoExecute ().
Source files are only compiled if the object code is outdated.
Created the output options panel.

* Plans for upcoming week:
Change CreateErrorFromErrorString and CreateLinkerErrorFromErrorString to use regular expressions.
Start work on integrating makefile integration. Michael suggested and I agreed to start working on makefile integration before code completion.

* Challanges I might be facing:
I started looking into regular expressions with C# and msdn seems to have very little documentation on the subject, if someone has some good resources on this I would appreciate it.

viernes, 8 de junio de 2007

Second Status Report

As I said earlier I wasn't able to work much this week, so here is what little I did.

* Accomplished this week:
First I fixed the order in the Project Tree following Lluis' advice so that the packages node is placed before everything else, then I had the References node disappear only if the current Project is a CProject.

I also added support to send extra arguments to the linker as well as the compiler and I cleaned up a bit, changing ProjectReferenceCollection to ProjectPackageCollection where necessary.

* Plans for the upcoming week:
Next week is my last week of finals, after that I will be focusing on completing the Edit packages dialog.

sábado, 2 de junio de 2007

First Status Report

* Accomplished this week:
Well, I have been working since interim period so its pretty much what
I have done, though not so much because I have had classes.

First I created the basic C/C++ addin and added functionality for for
compiling C projects using gcc and C++ with g++.

Then created the code generation panel where the following options are
available:
-Warning level: this can be set to "no warnings", "normal" and "all".
-Optimization level: can be set to 0-3.
-Target: "Executable", "Static Library" or "Shared Object".
-Extra Compiler arguments: You can add whatever options you want to
send to the compiler (ie -DDEBUG to define DEBUG, etc.)
-Libraries: Here you can select what libraries to link with your
project.
-Include: Add extra folders to search for #include files.
-Library: Add extra folders to search for libraries.

I also created a dialog to select what compiler to use, by default the
addin uses gcc for C and g++ for C++, but you can create a class that
implements ICompiler and register it in the MonoDevelop Addin Tree
(specifically, in "/CBinding/Compilers"). This dialog loads all
registered classes and allows you to select which one to use for your
project.

And currently I'm working on creating a dialog to select what pkg-
config packages to include in your project, this works very similar to
references in .NET languages. In the project solution pad I removed
the "References" node and created a "Packages" node which has an "Edit
packages..." command in it's context menu which launches the Edit
packages dialog where you will be able to add/remove packages from
your project.

* Plans for the upcoming week:
Since I'm getting closer to finals I have a lot of final projects for
school to complete and I have to get ready for finals, so I don't
think I will be working much until around the 16 of June when I have
my last exam. I still hope to be able to get some work done anyway.

This is why I have been working since the interim period, to make up
for the time I won't have in the next 2 weeks.

When I get back to work I will be focusing on completing the edit
packages dialog, which still has a long way to go, and fixing some
small details that were bothering me.

* Challenges or problems that I might be facing:
To add the packages node I created a NodeBuilderExtension that extends
the Project node and adds the packages node, the problem here is that
it adds the node at the end of the list of nodes, even after the
project source files which is just not nice, I didn't find any easy
way to fix this and there probably is one.

Also for some reason the activalanguage condition is not working for
the NodeBuilderExtensions, if I put the condition the condition is
never true so for now I just commented out the condition so I
recommend you don't use this addin in your stable MonoDevelop just
yet, since it will remove the References node and add the Packages
node even if its a C# project.

Whats very weird about this problem is that the exact same condition
does indeed work for the Dialogs... I don't get it, though I didn't
dig much into the problem.

Another challenge I will have is filtering the pkg-config packages so
that only suited packages appear in the edit packages dialog
selection, I'm not quite sure how I'm going to do this yet.

This probably won't be a challenge but since I have never done it
before I'm adding it here anyway, I will have to get the value for the
pkg-config env variable to search all the paths there for packages, I
have no idea how to get an env variable's value... but if it's simple
like I think it is, some quick googling should solve this.

* Interesting resources that helped you during the week.
http://www.monodevelop.com/Articles
Thats full with sweet information I need oh so often, though I tend to
miss key articles I need. Thanks go to Michael for having the patience
to point them to me when they are right in front of my nose, lol.
And also thanks to Michael for helping me in many ways, many times.

And thats pretty much it for my report, I'd like to finish by assuring
you guys that my next report will be in on time, and by wishing you
all some Happy Hacking!