Home Download Buy Blog Forum Support

tmlanguage

tmlanguage

Postby 3vi1john on Tue Dec 24, 2013 1:06 am

I need some help understanding a few things. I am creating a custom tmlanguage file but I am confused by some keywords. What is the difference between all of these? This is the example file I found.
https://github.com/tunnelsup/sublime-ci ... tmLanguage

To me they all look like strings other than the IP addresses. Thanks for your time.

<string>support.class</string>

<string>constant.numeric</string> In the example I seen, someone is using a word not a number

<string>markup.list</string>

<string>constant.character.escape</string>

<string>string.unquoted</string>
3vi1john
 
Posts: 3
Joined: Tue Dec 24, 2013 12:56 am

Re: tmlanguage

Postby weslly on Tue Dec 24, 2013 1:25 am

Those are called scopes. Syntax files (*.tmLanguage) bind them to regular expressions which are parsed by the editor to apply colorscheme colors and styles to the matched strings. They are also used by things like auto completion, snippets and plugins.
weslly
 
Posts: 202
Joined: Sun Aug 28, 2011 3:57 am
Location: Brazil

Re: tmlanguage

Postby 3vi1john on Tue Dec 24, 2013 1:31 am

Thanks for the response. How do we know which one to use for which?
3vi1john
 
Posts: 3
Joined: Tue Dec 24, 2013 12:56 am

Re: tmlanguage

Postby weslly on Tue Dec 24, 2013 1:34 am

weslly
 
Posts: 202
Joined: Sun Aug 28, 2011 3:57 am
Location: Brazil

Re: tmlanguage

Postby 3vi1john on Tue Dec 24, 2013 1:54 am

Thank you so much weslly!
3vi1john
 
Posts: 3
Joined: Tue Dec 24, 2013 12:56 am

Re: tmlanguage

Postby Orlmente on Wed Dec 25, 2013 6:03 pm

In addiction, if you want to know which scope is being applied to a specific part of code, you can use the "show_scope_name" command (default key-bindings is "ctrl+alt+shift+p" in win* but you can find it in default key-binds) that shows all scopes applied for the caret position.
hope it helps ;)
Orlmente
 
Posts: 96
Joined: Mon Mar 18, 2013 12:37 pm


Return to Plugin Development

Who is online

Users browsing this forum: Exabot [Bot] and 4 guests