Re: [anjuta-devel] The new parser-engine Plugin



Hello Abderrahim,

The purpose of my questions isn't to challenge you or something like
that, I just want to make sure I understand what you're doing so I can
help you. (And I think you may also understand things better by
explaining how they work). So you shouldn't feel attacked, right? :-)
All right. :)

> So the question is how a language support plugin is supposed to work
> after your changes? And how are plugins are going to communicate?

If I move IAnjutaCalltipProvider to IAnjutaProvider, a language support
plugins will work as before my changes.

What do you mean by "before my changes"? The same way it's working right now in anjuta master? (i.e. having plugins register for a watch on the
current document, and register the provider on the editor)
Yes, that's it, what I meant. After my changes the language support plugins have less work, but they have to integrate the new IAnjutaProvider interface.

 Only the IAnjutaProvider
interface will change and integrate following methods:
  * populate: As before to show completion
  * get_context: Searches for a calltip context
  * get_boolean: Get setting like PREF_CALLTIP_ENABLE
* clear_context: Clears the calltip context and brings it back into a
save state
  * query: Starts an async query for the calltip

Is there an implementation of something similar to this already in your
repository?
Yesterday I moved the code form the parser-engine plugin to the sourceview plugin, which handle with the IAnjutaProvider methods.[1] During my working I saw, that I need some new methods. The current state is the following[2]:
 * populate
 * get_editor
 * get_name
 * get_context
 * get_boolean
 * clear_context
 * query

(btw, the methods could use a better name, what is a
"calltip context". I'm also concerned that you may be leaking some
implementation details into the interface.)
I'm too bad to conceive good methods names. ;-) So I leave the names at they were named in the language support plugins. If everything works, I'll rename the methods or find a better name...

Another question: How about your problem with communication between
plugins (the purpose of your original post), is it solved by using this
interface?
Yes, but therefore I've other problems:
* The snippets-manager plugin have to adapt to the new IAnjutaProvider interface. * How can I execute the finalize() method[3]? I added this method to free allocated memory. I thought, that this works like in other plugins (i.e. the assist class of the cpp-java plugin [4]) * prov->iprov in sourceview-provider.c [6] is sometimes a GdaHolder object and not IAnjutaProvider. This has the consequence, that get_boolean can fail. But this happens only in the my new code, the master code[5] runs without errors. (I'll remove the get_boolean() method later, so ignore the fact, that this method is still available.)

Regards,
Moritz

[1] https://github.com/ritze/anjuta-clang/commit/deb649dc7842a3ac289c73559dc260ce9179a2d0 [2] https://github.com/ritze/anjuta-clang/blob/parser/libanjuta/interfaces/libanjuta.idl#L2625 [3] https://github.com/ritze/anjuta-clang/blob/215195c631547c648d172f9e73377ae8fe275dd1/plugins/sourceview/sourceview-provider.c#L491 [4] http://git.gnome.org/browse/anjuta/tree/plugins/language-support-cpp-java/cpp-java-assist.c#n1405 [5] http://git.gnome.org/browse/anjuta/tree/plugins/sourceview/sourceview-provider.c#n57 [6] https://github.com/ritze/anjuta-clang/blob/parser/plugins/sourceview/sourceview-provider.c#L361



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