[Vala] Autocomplete with Vala



First, let me say that Vala is awesome. I've started to play around
(mostly little test programs to get a feel for it) and I've not only
been blown away by how complete the system is, but how _real_ the
execution was. (as in, real C, really compiled ;) )

Anyways, I currently do a lot of development under Mono, and have
really grown attached to code completion. I know lots of people see
code complete as the 'lazy way out' etc, but I think its important to
recognize how important it can be. Not only does it make learning a
new language/api close to painless (depending on the API/library of
course ;) ) but for someone with dyslexia (like me!) it can make
little things (like finding the correct spelling of lenght.. errr
lenhgt.. LENGTH! ;) much easier). Anyways, while I can experiment left
and right with Vala and have all sorts of fun, before it becomes a
realistic option for larger-scale projects (for me, I make no
presumption about what others want to see) some form of basic
autocomplete really needs to be available. I should note, I'm not
talking about a complete IDE or project type support, all those can me
managed manually, I have no objection to autotools (beyond the obvious
;) ) but to hit a real development stride, Ctrl+Space is a big part of
my development rhythm.

Now, lucky for Vala, it didn't try to reinvent the wheel, Vala isn't
some new and radical syntax, its C# with some glorified/awesome
goodies to make GObject work more native. As a result, there are
plenty of systems we could base and auto complete system on.

While the obvious political choice is Anjunta (as the quasi-official
Gnome IDE) or Eclipse (the defacto Open Source IDE standard) I'm more
inclined to look at a little less public option. Monodevelop has
become quite stable, and I use it for most of my new code in C#. While
I ignore most of its project models and still just have a terminal for
my 'make' and 'make run' tests, I add all my sources and library
references and I get lovely, inline autocomplete, with
documentation/declaration tooltips.

In addition, Monodevelop has been designed to be as extensible as
possible, adding support for a new language/project type is no hack or
patch, but a full-fledged first class citizen, utilizing the
Mono.Addin system. In addition, when it comes to parsing vala source
files, with syntax so similar to C#, we could utilize a healthy
portion of the already existing C# support. And designing a new
project model _should_ be as easy as determining how our reference
list is to be managed. While autotools/makefile integration might be a
little far off, the basic parsing and completition of all object
available in the current projects source should be easy enough. The
problem comes from the next step.

The mono compiler produces an intermediate language (often called
simply IL) which is quite easy to parse and manipulate, this makes
extracting autocompletion sources from existing system libraries
without access to the source possible. This is where I stonewall. I
would be more than willing to help get some rudimentary Vala support
working in Monodevelop up to this point (parsing and completion of
in-project source types), but the next step is a real brick wall for
me. I have the following questions:
1) Is it possible to get this information from the native libraires? I
know ctags does something like this, could we utilize information from
a ctags database to provide the information needed?
2) If the above is not realistic, how could we get autocompete
information from binding/system libraries? Could we parse some
generated documentation? Would it need to be developed with the
generation of the bindings? Or would we need to have access to the
source? (maybe generate an autocomplete DB from the source, but still
requiring access to the source for initial generation) What about
access to just the C source? Could we offer autocomplete support for
binding to native libraries?
3) Would someone be willing to work with me to help implement
something like this? I don't want to pour the time and energy into a
partial implementation for monodevelop only to have it shunned by the
Vala dev team. Furthermore, parsing the libraries is beyond me, I'll
admit that without some help or guidance, I really wouldn't know what
to do/where to start/how to proceed.
4) Finally, what are people's thoughts? I want this effort to have
community support, as I doubt I can maintain support for all the new
syntax features that Vala keeps adding. I love that Vala has been
under such active development, its just that with the lack of general
documentation available, maintaining this will require more help from
the developers familiar with Vala's functionality.

Anyways, let me know what people think, please share any thoughts you
may have, I'm open to suggestions!

-- 
Cheers,
Kevin Kubasik
http://kubasik.net/blog



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