forked from rkh/atom-sonic
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some partial syntax highlighting and snippets support for Sonic P…
…i functions; add command to open online tutorial; add title to toolbar Also, update README.md
- Loading branch information
Showing
7 changed files
with
193 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
'name': 'Sonic Pi' | ||
'scopeName': 'source.ruby.sonic-pi' | ||
'fileTypes': [ | ||
'.rb' | ||
] | ||
'patterns': [ | ||
{ | ||
'include': 'source.ruby' | ||
} | ||
{ # Sonic Pi functions - incomplete | ||
'begin': '\\b(?<!\\.|::)(play|chord|chord_invert|stop|cue|sync|in_thread|live_loop|print|use_synth|with_fx|with_synth|with_synth_defaults)\\b(?![?!])' | ||
'captures': | ||
'1': | ||
'name': 'keyword.other.special-method.ruby.sonic-pi' | ||
'end': '$|(?=#|})' | ||
'name': 'meta.declaration.ruby.sonic-pi' | ||
'patterns': [ | ||
{ | ||
'include': '$self' | ||
} | ||
] | ||
} | ||
# { # define | ||
# 'begin': '''(?x) | ||
# (?=define\\b) # optimization to help Oniguruma fail fast | ||
# (?<=^|\\s)(def)\\s+ | ||
# ( | ||
# (?>[a-zA-Z_]\\w*(?>\\.|::))? # method prefix | ||
# (?> # method name | ||
# [a-zA-Z_]\\w*(?>[?!]|=(?!>))? | ||
# | | ||
# ===?|!=|>[>=]?|<=>|<[<=]?|[%&`/\\|]|\\*\\*?|=?~|[-+]@?|\\[]=? | ||
# ) | ||
# ) | ||
# \\s*(\\() | ||
# ''' | ||
# 'beginCaptures': | ||
# '1': | ||
# 'name': 'keyword.control.def.ruby' | ||
# '2': | ||
# 'name': 'entity.name.function.ruby' | ||
# '3': | ||
# 'name': 'punctuation.definition.parameters.ruby' | ||
# 'comment': 'The method pattern comes from the symbol pattern. See there for an explanation.' | ||
# 'end': '\\)' | ||
# 'endCaptures': | ||
# '0': | ||
# 'name': 'punctuation.definition.parameters.ruby' | ||
# 'name': 'meta.function.method.with-arguments.ruby' | ||
# 'patterns': [ | ||
# { | ||
# 'begin': '(?![\\s,)])' | ||
# 'end': '(?=,|\\)\\s*$)' | ||
# 'patterns': [ | ||
# { | ||
# 'captures': | ||
# '1': | ||
# 'name': 'storage.type.variable.ruby' | ||
# '2': | ||
# 'name': 'constant.other.symbol.hashkey.parameter.function.ruby' | ||
# '3': | ||
# 'name': 'punctuation.definition.constant.hashkey.ruby' | ||
# '4': | ||
# 'name': 'variable.parameter.function.ruby' | ||
# 'match': '\\G([&*]?)(?:([_a-zA-Z]\\w*(:))|([_a-zA-Z]\\w*))' | ||
# } | ||
# { | ||
# 'include': '$self' | ||
# } | ||
# ] | ||
# } | ||
# ] | ||
# } | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'.source.ruby.sonic-pi': | ||
# Incomplete | ||
'in_thread do … end': | ||
'prefix': 'in_thread' | ||
'body': 'in_thread do\n\t$1\nend' | ||
'live_loop do … end': | ||
'prefix': 'live_loop' | ||
'body': 'live_loop :${1:name} do\n\t$2\nend' | ||
'live_loop sync:… do … end': | ||
'prefix': 'live_loop sync' | ||
'body': 'live_loop :${1:name} sync: ${2:cue_name} do\n\t$3\nend' | ||
'with_synth do ... end': | ||
'prefix': 'with_synth' | ||
'body': 'with_synth :${1:synth} do\n\t$2\nend' | ||
'with_fx do ... end': | ||
'prefix': 'with_fx' | ||
'body': 'with_fx :${1:fx} ${2:opts} do\n\t$3\nend' | ||
'with_synth_defaults do ... end': | ||
'prefix': 'with_synth_defaults' | ||
'body': 'with_synth_defaults ${1:opts} do\n\t$3\nend' |