Re: [Vala] Vala completion support for vim



Hi Serge,

On Mon, 2011-08-29 at 16:15 -0700, Damien Radtke wrote:
Thanks for the suggestion. I began looking into it, but have run into
a couple of problems. I successfully built afrodite from the VTG
source, but ran into some issues when trying to compile a program that
uses it.

A little preface: afrodite is still very unstable and a little bit messy
because lack of time / knowledge in this specific field ;)

Having said that if you want to use it you're welcome and I'll try to
give you support as time permit.
 

1. First, there's an inconsistency with naming. The installed library
generates afrodite-0.12.vapi for the vala api, but uses
libafrodite-0.12.pc for pkg-config, so if --pkg=libafrodite-0.12 is
used then valac can't find it, but if --pkg=afrodite-0.12 is used,
then the needed cflags and libs aren't included. I had to manually
rename the vapi file to libafrodite-0.12.vapi in order to get it to
compile.

That's possible since I use the library with static linking so I can
miss this inconsistency. I'll look at it at fix asap.


2. Even after compilation succeeds, trying to use the library causes
the program to end in a segfault. For example, I have a simple program
that creates a new CodeDom object, and while the object creation
itself doesn't cause the program to crash (print statements placed
afterwards still show up), returning from main then results in a
segmentation fault. Removing the CodeDom object fixes it.

I should see your sample code, but this sound wrong: 'For example, I
have a simple program that creates a new CodeDom object'

You shouldn't create the codedom object directly. See this minimal code:
https://gitorious.org/vala-toys/vala-toys/blobs/master/afrodite/tests/completion-manager.vala#line37

As you can see:

line 41 a completionengine object is created
line 45 a sourcefile is queued for parsing

The engine parse the file and it builds the codedom.
You can query the codedom see line 63

This is how afrodite works in pratice:

1) you create a completionengine (vala-toys uses one engine for each
project)

2) you submit all the source files / vapi to the engine for parsing and
resolving

3) you can query the codedom for all the symbols in scope at a give
source/line

4) you can also submit a 'live buffer' (vala-toys does this for the
current edited file)



I would appreciate it if someone could help get these problems solved
so that Vim can get its completion plugin as soon as possible. =)


Please take in mind that there are a lot of bugs to be fixed and please
don't think that I'm satisfied with the current API. Even all about
afrodite is pretty in flux, it works most of the time and here it
doesn't crash to often ;) 

~Damien


HTH,
Andrea Del Signore





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]