Hi Jonathan,
I'm not sure of all the way to do it, so, I'll present some of the steps I'=
d
consider the first ones for doing it:
- Create a sub-class of PyEdit that would be actually used when recognizing
python in html
- Create a PartitionScanner to separate what is html and what is python --
this class is used in Eclipse so that it can interpret each part in a
different way. The current partitioner (
org.python.pydev.editor.PyPartitionScanner) separates comments, literals,
backquotes and the code itself. You'd need to connect this partitioner with
the new class you created as the editor for that... Maybe you'd should
actually create something as an AbstractPyEdit and make PyEdit and that new
editor you're creating subclass, so that you could make those things as
setting the partitioner, adding other custom actions, etc.
Well, those would be the first steps... As you said it's nontrivial, but no=
t
impossible. So, if you're willing to do it, I think it can be worked out!
Another thing is that I think you should create a new plugin (something as
org.python.pydev.embeddedpython -- or maybe there's a better name) to put
the classes related to that.
I guess that you'd also need a background to know the basic infrastructure
of the plugin (how's the editor created, what is a partitioner, etc). The
place I'd reccomend for that is the Eclipse FAQ:
http://wiki.eclipse.org/index.php/Eclipse_FAQs.
Cheers,
Fabio
On 4/20/06, Jonathan Ellis <jon...@ut...> wrote:
>
> How hard would it be to get PyDev to recognize python code embedded in
> html, a la Spyce or mod_python's psp?
>
> I imagine it's nontrivial, but if it touches a relatively small number of
> modules I'm kind of inclined to try. :)
>
> --
> Jonathan Ellis
> http://spyced.blogspot.com
>
|