Re: [Komodo-discuss] Autocomplete for Tcl?
by Eric Promislow other posts by this author
Jul 8 2008 12:52PM messages near this date
view in the new Beta List Site
Re: [Komodo-discuss] Autocomplete for Tcl?
|
Re: [Komodo-discuss] Autocomplete for Tcl?
Hi Tom,
As of version 4.3, Komodo has supported prefix-sensitive
abbreviations. They're based on three things: the language
of the file you're editing, the word to the right of the
cursor, and the contents of the snippet in any Toolbox
folder with the path Abbreviations/<language> /<word>
Komodo ships with five snippets for Tcl, including "proc",
with this value:
proc [[%tabstop:NAME]] {[[%tabstop:ARGS]]} {
[[%tabstop]]
}
You would type "proc", then Ctrl-T (default keybindings), and
it would expand to the above.
You can easily add another snippet called "pro" to the
Samples/Abbreviations/Tcl folder, with contents like
this:
#############################################################
# Procedure: [[%tabstop:procName]]
#
# Arguments:
# [[%tabstop:args]]
#
# Returns:
# [[%tabstop:Nothing]]
#
# See Also:
# [[%tabstop:]]
#
proc [[%tabstop:procName]] {[[%tabstop:args]]} {
[[%tabstop:]]
}
You would then type "pro" followed by Ctrl-T (we're working
on getting Tab to work here, but it has some conflicting operations
bound to it), and then tab through to set the various settings.
The *.tip files are more useful for navigating through APIs.
Regards,
Eric Promislow
Tom SAVELL wrote:
> Hi Jeff,
>
> Thanks for the quick reply.
>
> Okay, so I see that if I type
>
> pro
>
> up comes a drop-down that shows "proc", and if I hit the tab key, it types
> "proc" for me.
>
> What I would prefer is I type
>
> pro<tab>
>
> And it auto-completes as:
>
> #############################################################
> # Procedure:
> #
> # Arguments:
> # None
> #
> # Returns:
> # Nothing
> #
> # See Also:
> #
> proc procName {args} {
>
> }
>
> It's not clear to me that this is possible with *.tip files, e.g. tcl-core.tip.
> Here is the entry for proc:
>
> proc <name> <args> <body>
>
> I see that the behavior of Komodo when I type "proc<space>" is that it produces
> a floating help box that shows "<name> <args> <body>". So I don't really see
> how to make the auto-complete put in an entire proc template for me. I would
> like the same behavior for other statements like switch, if, while, etc.
>
> Can I do this with the *.tip files?
>
> -Tom
>
> --------------------------------------------------------------------------------
> *Notice*
> The information in this message is confidential and may be legally privileged.
> It is intended solely for the addressee. Access to this message by anyone else
> is unauthorized. If you are not the intended recipient, any disclosure,
> copying or distribution of the message, or any action taken by you in reliance
> on it, is prohibited and may be unlawful. If you have received this message in
> error, please delete it and contact the sender immediately. Thank you.
>
>
> *Jeff Hobbs <jeffh@[...].com>*
>
> 07/08/2008 10:54 AM
>
>
> To
> Tom SAVELL <tcs@[...].com>
> cc
> komodo-discuss@[...].com
> Subject
> Re: [Komodo-discuss] Autocomplete for Tcl?
>
>
>
>
>
>
>
>
> Hi Tom,
>
> Tom SAVELL wrote:
> > I use Komodo for Tcl development. I really want auto-complete. But it
> > seems like it is not implemented for Tcl.
> >
> > How can I get auto-complete for Tcl?
>
> Komodo does have auto-complete for Tcl among its stable of dynamic
> language intelligence. If you are in a recognized Tcl file (by default,
> anything with .tcl), and type something like 'nam...' you should see the
> dropdown with all the 'namespace' options. In addition, you will have
> calltips when no further options are available.
>
> It is possible to have this turned off in Preferences -> Code
> Intelligence, but it is on by default.
>
> > The other editor I have used made it very easy to implement
> > auto-complete, and they included a basic Tcl auto-complete template. I
> > was able to easily edit the template to customize it to my preferred style.
>
> It is easy to extend the default set of known commands. These are in
> /path/to/Komodo/lib/support/tcl/ as the *.tip files. You can create
> your own .tip or extend those (they are text files in a simple format).
>
> Regards,
>
> Jeff
>
> ForwardSourceID:NT00047EAA
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Komodo-discuss mailing list
> Komodo-discuss@[...].com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> Other options: http://listserv.ActiveState.com/mailman/listinfo/Komodo-discuss
_______________________________________________
Komodo-discuss mailing list
Komodo-discuss@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/Komodo-discuss
Thread:
Tom SAVELL
Jeff Hobbs
Tom SAVELL
Eric Promislow
Trent Mick
Troy Topnik
Tom SAVELL
|