Vanilla 1.1.1 is a product of Lussumo. More Information: Documentation, Community Support.
Take a look at the existing javascript.itBundle.
Look at the .itGrammer in the syntaxes folder.
This file describes javascript’s syntax.
In the snippets folder you’ll find a prototype snippet.
Copy it and adapt it to fit your needs.
Existing Bundle folder structure
-javascript.itBundle
--snippets
---prototype.itSnippet
--syntaxes
---javascript.itGrammer
-info.itInfo -- optional describes the menu structure.
JQuery will be easier cause you’ll mainly be creating snippets cause the javascript grammar is already there.
Yes, that’s actually true. But until we have some documentation for this I can help you with this in this thread. First, create a folder named “JavaScript jQuery.itBundle” in bundles folder. Bundles in Intype currently consists of three basic components:
Take a look at organization of HTML.itBundle for example.
Format used for all those items is called Jasmine. It is simple serialization format for definig structured config files which can contain: arrays, associative arrays called dictionaries (like objects in JavaScript), strings (unquoted – called symbols, quoted and double quoted), numbers (int, unsigned int, float), flags (boolean) and null value:
Arrays are delimited by square brackets []. So example array might look like this one:
[
'orange'
'apple'
'peach'
]
In jasmine, there’s no need to delimit items by comma, but nothing happens if you use it.
Dictionaries are associative containers. Each value it it MUST have key symbol associated with it.
For example:
{
title: 'jQuery'
scope_name: 'source.js.jquery'
file_types: [
'js'
'jquery'
]
}
Threre are two types of string in Jasmine: single quoted and double quoted.
Single quoted string is a very simple string for direct input and it does not translate any escape sequences. ‘ \n ‘ outputs \n as chars not as new line character. There’s only one special sequence for inserting a single quote into string: ‘’ (two single quotes).
Double quoted string supports these escapes:
Both strings are multilined. There are many other features in Jasmine and will be detailed in documentation.
Another special case of string is a symbol. Symbol is mainly used as a key value in directory. Symbol can only consist of uppercase letters (‘A’ to ‘Z’), lowercase letters (‘a’ to ‘z’), numeric characters (‘0’ to ‘9’) and three special characters ‘_’ underscore, ‘-’ minus and ‘.’ dot.
Now we can start with a grammar.
For the library like jQuery the grammar is simple. You have to only define keywords and include the JavaScript grammar in it. The example grammar for us would be JavaScript YUI.itBundle (download) because it is very similiar to jQuery — it extends JavaScript grammar by adding keyword definitions.
{
title: 'jQuery'
scope_name: 'source.js.jquery'
patterns: [
{
match: /\b(YAHOO)\b/
name: 'support.class.js.yui'
}
{
match: /\.(util|widget|example)\b/
name: 'support.class.js.yui'
}
...
{
include: 'source.js'
}
]
}
Try to take a look at the Javascript YUI grammar.
1 to 6 of 6