Home Download Buy Blog Forum Support

Is it possible to expand a capture inside a scope name?

Is it possible to expand a capture inside a scope name?

Postby mmmpie on Thu May 17, 2012 6:36 pm

Im working a syntax highlighter for coldfusion, and want to implement paired tags which also name the scope of the tag specifically for themselves.
It is straight forward to use a capture from the begin regex in the end regex, but can it also be done in the scope name?

Code: Select all
"pairedtag": {
      "begin": "(<cf([^\\s>]+)([^>]*)>)",
      "beginCaptures": {
        "1": { "name": "entity.tag.open.cfml.\\2" }
      },
     
      "patterns": [{ "include": "$self" }],
     
      "end": "(</cf\\2>)",
      "endCaptures": {
        "1": { "name": "entity.tag.close.cfml" }
      }
mmmpie
 
Posts: 6
Joined: Wed Apr 18, 2012 5:44 pm

Re: Is it possible to expand a capture inside a scope name?

Postby nick. on Thu May 17, 2012 10:17 pm

I wouldn't expect it to, but try it yourself and see.
nick.
 
Posts: 266
Joined: Wed Jan 18, 2012 3:45 am

Re: Is it possible to expand a capture inside a scope name?

Postby mmmpie on Tue May 22, 2012 4:23 pm

I have tried, several different syntaxes, but none of them worked.
Hence the question.

The reason that I want it is to allow completions for very specific scopes to be defined without having to explicitly create all of those scopes in the syntax file.
mmmpie
 
Posts: 6
Joined: Wed Apr 18, 2012 5:44 pm

Re: Is it possible to expand a capture inside a scope name?

Postby atomi on Tue May 22, 2012 4:57 pm

mmmpie wrote:I have tried, several different syntaxes, but none of them worked.
Hence the question.

The reason that I want it is to allow completions for very specific scopes to be defined without having to explicitly create all of those scopes in the syntax file.


I've been wanting to do this too. It's not a terrible amount of work if you use multiple selection and the json form then export to xml, finally copy-paste that into the existing ColdFusion.tmLanguage file from the Package Control ColdFusion package.

By the way, why not contribute to the existing ColdFusion package? I can add you on as a developer if we can agree on direction.
Edit: Did you go to law school, I think I remember you from IRC lol :)
atomi
 
Posts: 342
Joined: Thu Jan 20, 2011 5:06 pm
Location: Los Angeles CA US


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 20 guests