viernes, 27 de julio de 2007

Ninth Status Report

This week I started by implementing parameter completion, I'm pretty satisfied with the result, the parameter list widget is shown as soon as you press (, and it behaves like it does on C#, you can see other overloads by using the up and down arrow keys and the current parameter is highlighted in blue (this was already provided by MD).

Then I created "global" code completion, when you press ctrl+space it shows a list of available namespaces, classes, functions, structures, constants, etc. This was pretty straight forward since it doesn't have to resolve anything.

Also I changed how the class pad tree is built, instead of creating a single tags file for the entire project and then parsing that, now I create tags for each file (and it's non system #included files) and update the class pad information with this. This is done each time a file is saved.

Here is a screen shot of a C++ project and it's (wacky) class pad tree:

I also wanted to upload some images of the code completion and parameter completion, unfortunately when I press the screenshot key the widgets disappear and don't appear on the screenshots.

Challenges:
Supposedly this week I was going to create a simple parser to keep track of local variables and in what method the caret is currently in so that I can provide completion for something like coord. (and then the completion widget with the available fields would appear), but I found this would not be so simple and it would be very important that it is fast and efficient, so I decided to put it off until I have some information on what a good way to do this would be. So if anyone knows of any code that does something like this that I can look at or has any advice on how I should do this, I would love to know.

viernes, 20 de julio de 2007

Eight Status Report

* Accomplished this week:
Implemented a better formatting strategy using a text editor extension.
Implemented dependency tracking.
Projects can now reference other projects in the solution. The way this is done is each project that compiles into a static library has a pkg package and other projects add that package to their project packages. The edit packages dialog has been updated to better support this.
Some bugs were fixed.

* Plans for next week:
For next week I will create a file level parser to keep track of local variables and parameters for code completion.

* Interesting documents:
http://sourceware.org/automake/automake.html#Dependency-Tracking-Evolution

viernes, 13 de julio de 2007

Seventh Status Report

* This weeks accomplishments:
Finally got the class pad to get built in a separate thread, I'm not entirely satisfied with the implementation, but it will do for now.
Implemented support for precompiled headers in gcc and g++.
Implemented dragging and dropping of packages.
Implemented a very simple FormattingStrategy, but I think I will have to redo it so it will be much more robust.
Cleaned up the code a bit, fixed several bugs and did some small optimizations.

* Plans for next week:
I'm going to start by remaking the FormattingStrategy, there seems to be two ways to do this, subclassing and registering a Formatter which is what I did now, or subclassing and registering a TextEditorExtension, which I think is what the C# binding does. The first option (what I'm doing now) seems to be a bit restrictive, I couldn't work very well with it because it's behavior seems to be a bit strange, for example when typing a '}' I wanted to remove a '\t' from the beginning of that line, but it seems the method got called twice so I would end up removing two tabs (or getting an index out of bounds exception if there was only one tab. So I'm going to look more into this and see if I can figure it out or try the second method.

Also next week I'd like to implement dependency tracking.

* Interesting documents I used:
http://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html

domingo, 8 de julio de 2007

Testing out current work

If you have an svn build of MD, its very easy to to test out the CBinding addin.
Make sure you have a recent revision (at the time of this writing, the latest was 81606)

Apply this patch in the MD root directory:

Index: configure.in
===================================================================
--- configure.in (revision 81606)
+++ configure.in (working copy)
@@ -490,6 +490,7 @@
Extras/Deployment/Makefile
Extras/Deployment/MonoDevelop.Deployment/Makefile
Extras/Deployment/MonoDevelop.Deployment.Linux/Makefile
+Extras/CBinding/Makefile
Makefile
monodevelop
mdtool
Index: Extras/Makefile.am
===================================================================
--- Extras/Makefile.am (revision 81606)
+++ Extras/Makefile.am (working copy)
@@ -1,2 +1,2 @@

-SUBDIRS = MonoDevelop.DesignerSupport Deployment MonoDevelop.SourceEditor MonoDevelop.Autotools CSharpBinding DebuggerAddIn ILAsmBinding MonoQuery JavaBinding BooBinding NemerleBinding NUnit MonoDeveloperExtensions VersionControl VBNetBinding prj2make-sharp-lib WelcomePage ChangeLogAddIn MonoDevelop.GtkCore AspNetAddIn AspNetEdit MonoDevelop.WebReferences
+SUBDIRS = MonoDevelop.DesignerSupport Deployment MonoDevelop.SourceEditor MonoDevelop.Autotools CSharpBinding DebuggerAddIn ILAsmBinding MonoQuery JavaBinding BooBinding NemerleBinding NUnit MonoDeveloperExtensions VersionControl VBNetBinding prj2make-sharp-lib WelcomePage ChangeLogAddIn MonoDevelop.GtkCore AspNetAddIn AspNetEdit MonoDevelop.WebReferences CBinding


In a terminal, cd to the Extras directory and enter the following commands:

$ svn propset svn:externals "CBinding http://mono-soc-2007.googlecode.com/svn/trunk/mdavid/CBinding" .
$ svn up


Now just build MD, note that there is currently no option to enable/disable CBinding, if you want to disable it you will have to undo what the patch did (which takes a second or two).

Also note that there is still a lot to do, this project is not finished!

I hope I didn't forget anything... and any feedback is very welcome.

Oh, almost forgot, don't laugh at my crappy icons :( I did my best, someone who has better ones I can use please let me know.

viernes, 6 de julio de 2007

Sixth Status Report

* Accomplished this week:
This week all I could do was finish the class pad support.

* Plans/challenges for next week:
The current implementation is fine for small projects, but it's no good for large projects because it locks the UI while parsing the tags file. To solve this I decided to parse the tag file in a separate thread and
using events dynamically add new nodes to the tree as they were made available. Sounds pretty straight forward right? I thought so, so I just started hacking away without much planning. I suddenly found myself hacking around several things and the whole thing just felt really messy, so I stopped right there and decided to plan better what I was going to do before I did it. So for next week I plan on getting the class pad tree to get built without locking the UI, any advice on how to do this would be great. Also other things I want to do are implement support for pre-compiled headers and dependency tracking.