Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added keywords, regex for functional notation highlighting, quit lang shortcut, updated README #100

Closed
wants to merge 8 commits into from
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -3,3 +3,4 @@ npm-debug.log
node_modules
tags
doing
.npmignore
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -200,6 +200,9 @@ See the [supercollider.js configuration documentation](http://supercolliderjs.re

`"C:\Program Files\SuperCollider\sclang.exe"`

## Themes

A couple SuperCollider-specific themes have been created to add symbol colorization, argument tags, argument parameters in pipes, and function names when using functional notation: [Woolgathering Light Syntax](https://atom.io/themes/woolgathering-light-syntax) and [Woolgathering Dark Syntax](https://atom.io/themes/woolgathering-dark-syntax).

## Missing Features

Expand Down
11 changes: 10 additions & 1 deletion grammars/supercollider.cson
Expand Up @@ -8,7 +8,7 @@
'name': 'SuperCollider'
'patterns': [
{
'match': '\\b(arg|var|classvar|const|this|thisThread|thisMethod|thisFunction|thisProcess|true|false|inf|nil)\\b'
'match': '\\b(arg|var|classvar|const|this|thisThread|thisMethod|thisFunction|thisProcess|true|false|inf|nil|for|forBy|if|switch|which|case|pi|while)\\b'
'name': 'keyword.control.supercollider'
}
{
Expand Down Expand Up @@ -59,6 +59,11 @@
'name': 'entity.name.class.supercollider'
'match': '[^a-zA-Z0-9\\\\]([A-Z_]{1}[a-zA-Z0-9_]*)[^a-zA-Z0-9_]'
}
# find *pi as keyword
{
'match': '([0-9\d])+pi'
'name': 'keyword.control.supercollider'
}
{
'match': '\\\\[a-zA-Z0-9\\_]+'
'name': 'entity.name.symbol.supercollider'
Expand All @@ -82,6 +87,10 @@
'end': '\\*\\/'
'name': 'comment.multiline.supercollider'
}
{
'match': '(^[a-z]{1}\\w+)(?=\\()'
'name': 'entity.name.functional-name.supercollider'
}
{
'comment': 'source: ruby bundle'
'match': '\\b(0[xX][0-9A-Fa-f](?>_?[0-9A-Fa-f])*|\\d(?>_?\\d)*(\\.(?![^[:space:][:digit:]])(?>_?\\d)*)?([eE][-+]?\\d(?>_?\\d)*)?|0[bB][01]+)\\b'
Expand Down
6 changes: 4 additions & 2 deletions keymaps/supercollider.cson
Expand Up @@ -10,15 +10,17 @@

# Windows and Linux
'atom-workspace':
'shift-alt-k': 'supercollider:clear-post-window'
'shift-alt-c': 'supercollider:clear-post-window'
"atom-workspace atom-text-editor[data-grammar~='supercollider']":
'shift-alt-k': 'supercollider:recompile'
'ctrl-alt-l': 'supercollider:open-post-window'
'shift-enter': 'supercollider:eval'
'alt-.': 'supercollider:cmd-period'
'shift-alt-k': 'supercollider:clear-post-window'
'shift-alt-c': 'supercollider:clear-post-window'
'ctrl-shift-h': 'supercollider:open-help-file'
'alt-shift-b': 'supercollider:boot-server'
'alt-shift-q': 'supercollider:quit-server'
'shift-alt-ctrl-x': 'supercollider:quit-lang'

# OS X
'.platform-darwin atom-workspace':
Expand Down
7 changes: 6 additions & 1 deletion lib/controller.coffee
Expand Up @@ -29,6 +29,8 @@ class Controller
'supercollider:cmd-period', => @cmdPeriod()
atom.commands.add 'atom-workspace',
'supercollider:boot-server', => @bootServer()
atom.commands.add 'atom-workspace',
'supercollider:quit-lang', => @quitLang()
atom.commands.add 'atom-workspace',
'supercollider:quit-server', => @quitServer()
atom.commands.add 'atom-workspace',
Expand Down Expand Up @@ -138,7 +140,7 @@ class Controller
currentView = atom.views.getView atom.workspace.getActiveTextEditor()

options =
split: (atom.config.get 'openPostWindowOn') || 'right'
split: (atom.config.get 'openPostWindowOn') || 'down'
searchAllPanes: true
atom.workspace.open(uri, options)
.then () =>
Expand Down Expand Up @@ -166,6 +168,9 @@ class Controller
quitServer: () ->
@evalWithRepl('Server.default.quit;')

quitLang: () ->
@evalWithRepl('0.exit;')

rebootServer: () ->
@evalWithRepl('Server.default.reboot;')

Expand Down
2 changes: 1 addition & 1 deletion settings/language-supercollider.cson
Expand Up @@ -2,5 +2,5 @@
'editor':
'autoIndentOnPaste': true
'softTabs': false
'tabLength': 4
'tabLength': 2
'commentStart': '// '
6 changes: 0 additions & 6 deletions styles/supercollider.less
Expand Up @@ -317,9 +317,3 @@ atom-text-editor.editor.is-focused.insert-mode .line.cursor-line
.unfolder:checked ~ label .unfold-icon {
display: none;
}
// a hack for the syntax colors
// because most syntax themes do not
// specify a color for symbol
span.entity.name.symbol {
color: @syntax-color-tag;
}