Re: Shell Scripting Exention?

Trent Mick <[email protected]>
Newsgroups gmane.comp.ide.komodo.general
Message-ID <[email protected]>
R. Hicks wrote:
> Robert wrote:
>> Is there a plugin available for BASH and the like?
>>
> Ah...I see it does BASH. I didn't know that. I tend to think of Komodo 
> for Python, Perl, Tcl, PHP and HTMLish stuff.

Those (along with Ruby, XML and a lot of the popular templating 
languages like Django templates, RHTML, PHP-Smarty, Mason, etc.) are the 
main languages. However, there is a fair amount of basic support for a 
whole bunch of other languages.

"Basic" support is typically: syntax coloring, often reasonable 
auto-indent, auto-commenting, and all the general text editing features.

We should fix this Bash-related Komodo bug: 
http://bugs.activestate.com/show_bug.cgi?id=67090

[Jeff beat me with a response. Replying anyway.]


A while back on a bored Friday afternoon I whipped up a quick proof of 
concept for Bash debugging in Komodo:

> ----------
>> > $ cat dbgpclient.sh
>> > #!/bin/bash
>> > bash --debugger -c "(source dbgptrace.sh; source $1)"
>> > $ cat dbgptrace.sh
>> > function trace() {
>> >     #echo FUNCNAME: ${FUNCNAME[0]} ${FUNCNAME[1]} ${FUNCNAME[2]}
>> >     #echo BASH_LINENO keys: ${!BASH_LINENO[@]}
>> >     #echo BASH_LINENO: ${BASH_LINENO[0]} ${BASH_LINENO[1]} ${BASH_LINENO[2]}
>> >     #echo BASH_SOURCE keys: ${!BASH_SOURCE[@]}
>> >     #echo BASH_SOURCE: ${BASH_SOURCE[0]} ${BASH_SOURCE[1]} ${BASH_SOURCE[2]}
>> >     if test -n "${BASH_SOURCE[1]}"; then
>> >         echo -n \[dbpg trace ${BASH_SOURCE[1]}:${BASH_LINENO[0]}\] \`$BASH_COMMAND\` \$
>> >         read
>> >     fi
>> > }
>> > trap 'trace' DEBUG
>> > $ cat foo.sh
>> > #!/bin/sh
>> > 
>> > function call_bar() {
>> >     source bar.sh
>> > }
>> > 
>> > echo "hi"
>> > if test -e $HOME; then
>> >     echo "your home dir exists!"
>> > fi
>> > call_bar
>> > echo "bye"
>> > [trentm@vm-ubuntu80-trentm:~/tmp/bashd]
>> > $ ./dbgpclient.sh foo.sh
>> > [dbpg trace foo.sh:7] `echo "hi"` $
>> > hi
>> > [dbpg trace foo.sh:8] `test -e $HOME` $
>> > [dbpg trace foo.sh:9] `echo "your home dir exists!"` $
>> > your home dir exists!
>> > [dbpg trace foo.sh:11] `call_bar` $
>> > [dbpg trace foo.sh:3] `call_bar` $
>> > [dbpg trace foo.sh:4] `source bar.sh` $
>> > [dbpg trace bar.sh:2] `echo hi from bar` $
>> > hi from bar
>> > [dbpg trace foo.sh:12] `echo "bye"` $
>> > bye
> ----------
> 
> Fun fun. From there we'd just need to extend dbgptrace to talk DBGP to 
> Komodo instead of just doing "read" to pause before each line..


Not something I'll have the time to take further, but perhaps a 
motivator for someone that would like to learn and play with DBGP
(http://xdebug.org/docs-dbgp.php).

Trent


-- 
Trent Mick
trentm at activestate.com
_______________________________________________
Komodo-discuss mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/Komodo-discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.