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

Support for Interpreted Languages?

<< < (8/12) > >>

keenblade:

--- Quote from: dmoore on November 20, 2006, 03:05:34 am ---Personally, I like that it works this way as I don't necessarily want to have to open a file before I run it or run the currently active file.

--- End quote ---
That's ok. Also to keep your personal taste and to add some more usability, what do you think about using $processafile that means process the active file in ide like this:

load;$processafile $interpreter $file

Additionaly There are times I have more than one file open. I want to process them all like this:

consult;$processallfiles $interpreter consult('$files').

So, All the files are processed with a sequence like this:

consult;$interpreter consult('$file1').
consult;$interpreter consult('$file2').
consult;$interpreter consult('$file_etc').
that would be cool.


--- Quote from: dmoore on November 20, 2006, 03:05:34 am ---What I wanted to do was respond to right clicks in the editors tabs and/or editor pane with menu options for the appropriate actions...  Will this be acceptable? My other plan is to put the last 10 executed commands directly in the interpreters menu as another shortcut way to execute commonly run scripts. These will be stored persistently...
2. recent command list on the interpreters menu

--- End quote ---
It's nice if right clicks would bring a compact menu gathered within an "InterpretedLang" or something smilar.
Recent command list on the interpreters menu is also nice.

--- Quote from: dmoore on November 20, 2006, 03:05:34 am ---3. rerouting console input and output to a dockable window in codeblocks (there will be a few problems implementing this but its not a big deal)

--- End quote ---
That's what I'm eager with.

dmoore:

--- Quote ---what do you think about using $processafile that means process the active file in ide like this:

load;$processafile $interpreter $file

Additionaly There are times I have more than one file open. I want to process them all like this:

consult;$processallfiles $interpreter consult('$files').
--- End quote ---

Nice. I have thought about adding some more variables for the actions (such as $activefile, $allopenfiles, $allprojectfiles). since you are thinking along the same lines I'll put it on the todo list. running a sequence of commands is a pretty cute idea - I'd like to think some more about the syntax for this. Unfortunately, I have a busy week at work this week, so I doubt I'll get to look at the code again till sometime next week (my priority will be to get 2 and 3 working first, then I'll look at this issue). In any case, you are welcome to modify the code - this is open source after all. With that in mind i'll also setup a project on Berlios soon.


--- Quote ---It's nice if right clicks would bring a compact menu gathered within an "InterpretedLang" or something smilar.
Recent command list on the interpreters menu is also nice
--- End quote ---

a submenu on the context menu? (should be easy enough).

This reminds me of another potentially annoying "feature": the actions are only populated for the first interpreter matching the wildcard (hence the ability to move priority up/down in the environment settings) - maybe I should provide all matching interpreters. An example of the use of multiple interpreters on the same file extension is when you want to test code that works on Python 2.4 against Python 2.5

dmoore:

--- Quote from: Pecan on November 19, 2006, 02:10:57 am ---Caused by an incorrect arrangement of #includes and pre-compiled header.
Or an -include sdk.h flag in the project while using pre-compiled headers.

--- End quote ---

could someone please explain this to me in more detail, so I can put up error free project files? (I'm not all the familiar with correct PCH usage, especially as regards the C::B sdk)

thanks,
Damien

dmoore:
files for this project can now be found at my berlios project site: https://developer.berlios.de/projects/cbilplugin/

dmoore:
An update on this project:

I've just added very basic support for spawning new interpreter shells in a wxFlatnotebook (which is embedded in a CB dockable window). There's still a lot of work to do with translating keycodes etc, but you should be able to get very basic console based scripts running in the window.

files

here's a link to a win32 build of CB (rev. 4064) with the plugin installed (rev 15 of my svn): http://prdownload.berlios.de/cbilplugin/CodeBlocksRev4084_ILpluginsRev15_wx263_1.exe - run the executable and choose an extraction path

the project source is attached to this post (also in my SVN - see my sig) and contains windows and linux projects (note that I use --personality=debug in the cb runner exec arguments, so don't be surprised if your layout is not how you like it - you can always copy your default.conf to debug.conf before you start). EDIT: Source updated 3:17pm 6/6/2007

info

To make an interpreter action launch in the notebook you just need to add the character "W" to the semi-colon separated action string (e.g. "Run;$interpreter $file;W" (see the screenshot in my next post). You might also need to tell your intepreter to run in an unbuffered mode (e.g. in python I specify python -u) to enure that output appears. To delete process from the notebook just click on the "x" in the tab - if it is still running you will get a warning (you may need to kill more than once and the project may fail to die properly)


TODOs (feel free to add to these):
* report stderr
* improve keycodes handling (ctrl-key sequences etc)
* more macro substitutions (eg. $ALL_OPEN_FILES)
* smarter file handling (only ask for files to open if there is a $file in the argument list, dont offer actions that don't apply to individual files for context clicks etc)
* better process handling (killing etc)
* allow subclasses from the basic terminal control for more sophisticated interpreters (e.g. I plan to write a simple python interpreter, because the standard dos python shell cannot be piped in interactive mode)
* add to the UI (drag and drop etc)
* update my berlios site (eventually)

[attachment deleted by admin]

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version