[TxMt] Re: Triggering based on namespace?

Allan Odgaard mailinglist at textmate.org
Thu May 15 23:35:48 UTC 2014


On 15 May 2014, at 15:59, Ken Snyder wrote:

> I'm guessing this isn't possible but I'd love to have my 'doc' tab 
> trigger
> for PHP distinguish between the namespace it is in. Is this possible?

There are two options:

1. Put the namespace in the scope. We do this for C++, so for this code:

         namespace oak
         {
             ‸
         }

     The scope contains `meta.namespace-block.oak.c++`. Though we 
don’t actually use this extra information for anything.

2. Change the `doc⇥` trigger to run a command that takes 
‘document’ as input and have the command itself extract the 
namespace and act accordingly. In Objective-C we do that for the 
`logm⇥` and `super⇥` snippets, the first one inserts a log statement 
that output all the parameters passed to the method, the latter inserts 
a call to the superclass.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20140516/48c6927d/attachment.html>


More information about the textmate mailing list