Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Support for Interpreted Languages?

(1/12) > >>

dmoore:
I've seen some discussion on these boards re making projects wizards to support intepreted languages such as Matlab and R. Presumably, the same could also be done for more generic languages such as Python and Ruby. I'd hate to see Code::Blocks end up like Eclipse (a big, bloated, sluggish, memory hungry beast) but it would be very handy to be able to setup, edit and run interpreted language projects. Can the existing plugin framework handle this?

As an example, lets take my second favorite language Python (they're all my second favorites :D). I can open python files in the editor and seem to get basic code coloring, folding etc. (is this just default behavior of scintilla or something?) What I'd like to do is add a wizard for a python project. When the project is activated, c/c++ related elements of the GUI shoud be deactivated/hidden (e.g. compile etc.). However, I should be able to run the project in a console/new window and debug interactively (the latter would take some work, but could hook into Code::Blocks existing framework for debugging, such as tool bars. There should also be a dialog to enter Python specific configuration. So is all of this possible from within the current CB plugin framework??

cheers

(edited: title)

mandrav:
In short, no.
There are plans to support (i.e. not just editing) languages other than C/C++, but it won't happen in the near future.

dmoore:
So how about something a little simpler instead of offering full blown project support for interpreted languages. They are typically used as "glue" languages anyway, so the project infrastructure is usually unecessary.

Playing around in code::blocks I notice that it is possible to add groupings for different sources, allowing those sources to be added to any project and kept separate from everything else. So I'm thinking that I could write a plugin that adds a "Python", "Ruby" or, more generically, a "Scripting" menu that has (initially) a few options

* Config: setup location of interpreter, specify environment variables, command line options etc. [persistent]
* Current Interpreter Target: presents user with a list of the relevant sources as a possible run target. Allows additional environment variables, command line options. [save this target specific info in a target config file]
* Run Target: executes the target in a new window (asks user to save etc. first)
* Run Interpreter: run the interpreter in a new window

I have no experience with the CB plugin framework, but have written a variety of GUI bits and pieces in the past and have been looking at the source for some of the current CB plugins. I have a lot on my plate at the moment, so if someone wants to jump in first with this or something better, be my guest.

mandrav:
What you 're describing is trivial to do with a very simple plugin. So simple that might even serve as a plugin tutorial that actually does something more than greeting the world ;).

mandrav:
...and so I decided to write this tutorial. Hopefully it will help many would-be-plugin-developers :)

Work in progress: http://wiki.codeblocks.org/index.php?title=Creating_a_plugin_that_actually_does_something

Navigation

[0] Message Index

[#] Next page

Go to full version