[TxMt] Re: Triggering based on namespace?

Ken Snyder ken+textmate at ken.net
Fri May 16 07:22:18 UTC 2014


As I don't really know *ruby *at all the second option would be hard
without an example. I am gravitating to your first option but I'm not sure
what's involved in creating the namespace scope. For instance I have a
namespace of:

namespace LG\API;


and after placing the cursor in front of a function within that namespace
my scope is:

text.html.php
> meta.embedded.block.php
> source.php
> attr.os-version.10.9.2
> attr.rev-path.php.Insights.API.LG.src.api.*path.to.file*
> attr.scm.branch.feature/insights-timeseries
> attr.scm.git
> attr.scm.status.clean
> dyn.caret.end.line


I don't know if the PHP syntax for namespace, which doesn't bracket the
scope but instead implies the whole file, is somehow to blame?

Ken


On 16 May 2014 00:35, Allan Odgaard <mailinglist at textmate.org> wrote:

> 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.
>
>
>
> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20140516/ede5c6b3/attachment.html>


More information about the textmate mailing list