From d7b2826113847d05ccb5d0df414d356e63c3eb7b Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sun, 8 Nov 2015 06:25:32 -0500 Subject: [PATCH] Add SuperCollider grammar plus a few minor language support updates including: - recognize `sclang` and `scsynth` interpreters - set `tm_scope: source.supercollider` - reorder extensions so that `.sc` is primary --- .gitmodules | 3 +++ grammars.yml | 2 ++ lib/linguist/languages.yml | 7 +++++-- test/test_language.rb | 8 +++++++- vendor/grammars/language-supercollider | 1 + 5 files changed, 18 insertions(+), 3 deletions(-) create mode 160000 vendor/grammars/language-supercollider diff --git a/.gitmodules b/.gitmodules index e9e9cc5f3e..b164e0104d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -85,6 +85,9 @@ [submodule "vendor/grammars/language-shellscript"] path = vendor/grammars/language-shellscript url = https://github.com/atom/language-shellscript +[submodule "vendor/grammars/language-supercollider"] + path = vendor/grammars/language-supercollider + url = https://github.com/supercollider/language-supercollider [submodule "vendor/grammars/language-yaml"] path = vendor/grammars/language-yaml url = https://github.com/atom/language-yaml diff --git a/grammars.yml b/grammars.yml index 0b4525dff8..dd6fb35040 100644 --- a/grammars.yml +++ b/grammars.yml @@ -354,6 +354,8 @@ vendor/grammars/language-python: vendor/grammars/language-shellscript: - source.shell - text.shell-session +vendor/grammars/language-supercollider: +- source.supercollider vendor/grammars/language-xbase: - source.harbour vendor/grammars/language-yaml: diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 2ca9be57f7..1761b85d4b 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -3336,9 +3336,12 @@ SuperCollider: type: programming color: "#46390b" extensions: - - .scd - .sc - tm_scope: none + - .scd + interpreters: + - sclang + - scsynth + tm_scope: source.supercollider ace_mode: text Swift: diff --git a/test/test_language.rb b/test/test_language.rb index 5da3b8c735..5613f235b9 100644 --- a/test/test_language.rb +++ b/test/test_language.rb @@ -57,6 +57,7 @@ def test_find_by_alias assert_equal Language['Shell'], Language.find_by_alias('sh') assert_equal Language['Shell'], Language.find_by_alias('shell') assert_equal Language['Shell'], Language.find_by_alias('zsh') + assert_equal Language['SuperCollider'], Language.find_by_alias('supercollider') assert_equal Language['TeX'], Language.find_by_alias('tex') assert_equal Language['TypeScript'], Language.find_by_alias('ts') assert_equal Language['VimL'], Language.find_by_alias('vim') @@ -119,6 +120,7 @@ def test_search_term assert_equal 'vim', Language['VimL'].search_term assert_equal 'jsp', Language['Java Server Pages'].search_term assert_equal 'rst', Language['reStructuredText'].search_term + assert_equal 'supercollider', Language['SuperCollider'].search_term end def test_popular @@ -138,6 +140,7 @@ def test_programming assert_equal :programming, Language['Ruby'].type assert_equal :programming, Language['TypeScript'].type assert_equal :programming, Language['Makefile'].type + assert_equal :programming, Language['SuperCollider'].type end def test_markup @@ -227,7 +230,8 @@ def test_find_by_interpreter "python" => "Python", "python2" => "Python", "python3" => "Python", - "sbcl" => "Common Lisp" + "sbcl" => "Common Lisp", + "sclang" => "SuperCollider" }.each do |interpreter, language| assert_equal [Language[language]], Language.find_by_interpreter(interpreter) end @@ -339,6 +343,7 @@ def test_extensions assert Language['Perl'].extensions.include?('.pl') assert Language['Python'].extensions.include?('.py') assert Language['Ruby'].extensions.include?('.rb') + assert Language['SuperCollider'].extensions.include?('.scd') end def test_primary_extension @@ -349,6 +354,7 @@ def test_primary_extension assert_equal '.coffee', Language['CoffeeScript'].primary_extension assert_equal '.t', Language['Turing'].primary_extension assert_equal '.ts', Language['TypeScript'].primary_extension + assert_equal '.sc', Language['SuperCollider'].primary_extension end def test_eql diff --git a/vendor/grammars/language-supercollider b/vendor/grammars/language-supercollider new file mode 160000 index 0000000000..2b1da230e3 --- /dev/null +++ b/vendor/grammars/language-supercollider @@ -0,0 +1 @@ +Subproject commit 2b1da230e3b606a8d841d6ceda36ee1330d96aea