Re: [Pydev-code] Integration of Ajax Framework with PyDev
Brought to you by:
fabioz
From: Fabio Z. <fa...@gm...> - 2008-01-28 20:12:58
|
Hi Mark, > ... > Is it easy to register a class as a warnings/errors provider for PyDev? > > ... > > (At this point) I only need to examine the first two (string) arguments to a > decorator function (@Service). > I was hoping that there was a simple way to access an abstract-syntax-tree > or something similar that PyDev used internally. > > Could you give me some advise on how I could achieve this integration? Should not be difficult... although there's not much info about it... let me try giving you a brief explanation... the idea is that you can create a class that's a subclass of PyDevBuilderVisitor and override the needed methods (in your case, probably only visitChangedResource)... and register it as such: <extension point="org.python.pydev.pydev_builder"> <builder_participant class="my.pydev.BuilderClass"/> </extension> and you also want to give it a priority higher than code-completion (so that it's built after it, as you want may want the code-completion caches built already): @Override protected int getPriority() { return PyCodeCompletionVisitor.PRIORITY_CODE_COMPLETION+1; //just after the code-completion priority } in the visitChangedResource you can do something as: if(module == null){ module = getSourceModule(resource, document, nature); } module.getAst() --> returns the visitor structure you want to traverse.. And then just create the markers (regular eclipse markers) and add them to the resource being visited. Cheers, Fabio p.s. I'm putting pydev-code in the cc (those questions really belong there) |