La Vita è Bella

Friday, April 07, 2006

A patch for iComplete

iComplete is a code completion system, can be used with the omni-completion feature of vim 7, to provide language sensitive code completion.

It uses Exuberant-ctags to generate tag file. Exuberant-ctags is also a popular extension tool for vimmers. But the tag file generated by iComplete is different from the one we usually use, so it makes a problem sometimes.

I've made this patch to provide a additional command line parameter: tagfile(t) for iComplete, in which we can specify the tag filename used by iComplete (default to `tags'), so we can avoid break the tags file.

I also added a variable "g:cppcomplete_tagfile" to represent this option in vim

To apply this patch, first you should get the source of iComplete either by the source tarball or via SourceForge CVS, and the run the following command at the root directory:

patch -p1 -i icomplete.patch

I've submitted this patch to the author of iComplete, and it's supposed to be applied to the official branch soon.

Here's the patch file: icomplete.patch



tags: , ,

01:24:57 by fishy - opensource - Permanent Link

3 comments - no trackbacks yet - karma: -1 [+/-]

Wednesday, April 05, 2006

What about a Error Code Management System?

UPDATED: about the name, according to wine (Wine Is Not an Emulator), I think we can call it sine (Sine Is Not an Error), or even cosine (COSine Is Not an Error). In fact, in Chinese, "cosine" is pronounced as "yuxian", which is very similar to my name "yuxuan" :P

Microsoft had maintained a huge KB of error codes, so if you met some error, you can always look it up in the MSDN by its error code.

For any project, it's important to keep your error codes unambiguous. If -1 means "no such file" in function A, but means "MySQL connection timeout" in function B, that's nightmare.

So what about a Error Code Management System? It maintain the whole error code database, automatically generate the error code header, and automatically generate the document.

It's supposed to be a simple PHP script, use MySQL as database back end, and support cvs/svn commit.

The work process is supposed to be like this:

  1. A programmer need to define a new error code.
  2. He opens the System, input number, macro name, description, etc.
  3. The System checks if the number is already taken. If not, accept the error code.
  4. Add it into database.
  5. Generate new header file, commit it.
  6. Generate the document. Or it may be another system, just read descriptions from database.

As usual, a project name is needed. :P



tags: , ,

18:44:28 by fishy - thought - Permanent Link

2 comments - no trackbacks yet - karma: 9 [+/-]

A blog about open source, patches, thoughts and geeks