diff --git a/.gitmodules b/.gitmodules index b19a3d2d..1e71bd4a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -325,9 +325,6 @@ [submodule "vendor/grammars/nemerle.tmbundle"] path = vendor/grammars/nemerle.tmbundle url = https://github.com/textmate/nemerle.tmbundle -[submodule "vendor/grammars/ninja.tmbundle"] - path = vendor/grammars/ninja.tmbundle - url = https://github.com/textmate/ninja.tmbundle [submodule "vendor/grammars/objective-c.tmbundle"] path = vendor/grammars/objective-c.tmbundle url = https://github.com/textmate/objective-c.tmbundle @@ -800,3 +797,9 @@ [submodule "vendor/grammars/language-haml"] path = vendor/grammars/language-haml url = https://github.com/ezekg/language-haml +[submodule "vendor/grammars/language-ninja"] + path = vendor/grammars/language-ninja + url = https://github.com/khyo/language-ninja +[submodule "vendor/grammars/language-fontforge"] + path = vendor/grammars/language-fontforge + url = https://github.com/Alhadis/language-fontforge diff --git a/grammars.yml b/grammars.yml index a9c21505..2c710cb2 100755 --- a/grammars.yml +++ b/grammars.yml @@ -362,6 +362,10 @@ vendor/grammars/language-csound: - source.csound-score vendor/grammars/language-emacs-lisp: - source.emacs.lisp +vendor/grammars/language-fontforge: +- source.fontforge +- source.opentype +- text.sfd vendor/grammars/language-gfm: - source.gfm vendor/grammars/language-graphql: @@ -396,6 +400,8 @@ vendor/grammars/language-maxscript: - source.maxscript vendor/grammars/language-ncl: - source.ncl +vendor/grammars/language-ninja: +- source.ninja vendor/grammars/language-povray: - source.pov-ray sdl vendor/grammars/language-python: @@ -477,8 +483,6 @@ vendor/grammars/nemerle.tmbundle: - source.nemerle vendor/grammars/nesC: - source.nesc -vendor/grammars/ninja.tmbundle: -- source.ninja vendor/grammars/nix: - source.nix vendor/grammars/nu.tmbundle: diff --git a/lib/linguist/heuristics.rb b/lib/linguist/heuristics.rb index 7216003f..b98465dd 100644 --- a/lib/linguist/heuristics.rb +++ b/lib/linguist/heuristics.rb @@ -110,6 +110,12 @@ module Linguist end end + disambiguate ".cls" do |data| + if /\\\w+{/.match(data) + Language["TeX"] + end + end + disambiguate ".cs" do |data| if /![\w\s]+methodsFor: /.match(data) Language["Smalltalk"] diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index da4aa889..e4c02558 100755 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -1141,9 +1141,9 @@ Emacs Lisp: - ".gnus" - ".spacemacs" - ".viper" - - "Project.ede" - - "_emacs" - - "abbrev_defs" + - Project.ede + - _emacs + - abbrev_defs extensions: - ".el" - ".emacs" @@ -1473,6 +1473,8 @@ Gnuplot: Go: type: programming color: "#375eab" + aliases: + - golang extensions: - ".go" ace_mode: golang @@ -1962,6 +1964,8 @@ JSON5: type: data extensions: - ".json5" + filenames: + - ".babelrc" tm_scope: source.js ace_mode: javascript codemirror_mode: javascript @@ -2956,6 +2960,15 @@ OpenSCAD: - ".scad" tm_scope: none ace_mode: scad + language_id: 431 +OpenType Feature File: + type: data + aliases: + - AFDKO + extensions: + - ".fea" + tm_scope: source.opentype + ace_mode: text language_id: 266 Org: type: prose @@ -3175,7 +3188,7 @@ Perl6: Pic: type: markup group: Groff - tm_scope: "source.pic" + tm_scope: source.pic extensions: - ".pic" - ".chem" @@ -4030,6 +4043,13 @@ SourcePawn: - ".sma" tm_scope: source.sp ace_mode: text + language_id: 432 +Spline Font Database: + type: data + extensions: + - ".sfd" + tm_scope: text.sfd + ace_mode: yaml language_id: 354 Squirrel: type: programming @@ -4261,6 +4281,7 @@ Text: - ".no" filenames: - COPYING + - FONTLOG - INSTALL - LICENSE - NEWS diff --git a/lib/linguist/vendor.yml b/lib/linguist/vendor.yml index 5e83cd50..16515c98 100644 --- a/lib/linguist/vendor.yml +++ b/lib/linguist/vendor.yml @@ -50,6 +50,9 @@ # Go dependencies - Godeps/_workspace/ +# GNU indent profiles +- .indent.pro + # Minified JavaScript and CSS - (\.|-)min\.(js|css)$ diff --git a/samples/JSON5/filenames/.babelrc b/samples/JSON5/filenames/.babelrc new file mode 100644 index 00000000..432c7684 --- /dev/null +++ b/samples/JSON5/filenames/.babelrc @@ -0,0 +1,6 @@ +{ + "presets": [ + "es2015", + "es2016" + ] +} diff --git a/test/test_file_blob.rb b/test/test_file_blob.rb index 84cee723..2c52b0a7 100644 --- a/test/test_file_blob.rb +++ b/test/test_file_blob.rb @@ -294,6 +294,8 @@ class TestFileBlob < Minitest::Test assert !sample_blob("Godeps/Godeps.json").vendored? assert sample_blob("Godeps/_workspace/src/github.com/kr/s3/sign.go").vendored? + assert sample_blob(".indent.pro").vendored? + # Rails vendor/ assert sample_blob("vendor/plugins/will_paginate/lib/will_paginate.rb").vendored? diff --git a/test/test_heuristics.rb b/test/test_heuristics.rb index 921cc021..4fe3d38a 100644 --- a/test/test_heuristics.rb +++ b/test/test_heuristics.rb @@ -73,6 +73,15 @@ class TestHeuristcs < Minitest::Test }) end + def test_cls_by_heuristics + assert_heuristics({ + "TeX" => all_fixtures("TeX", "*.cls"), + nil => all_fixtures("Apex", "*.cls"), + nil => all_fixtures("OpenEdge ABL", "*.cls"), + nil => all_fixtures("Visual Basic", "*.cls"), + }) + end + def test_cs_by_heuristics assert_heuristics({ "C#" => all_fixtures("C#", "*.cs"), diff --git a/vendor/README.md b/vendor/README.md index 6a3f5b9e..fdee48b3 100644 --- a/vendor/README.md +++ b/vendor/README.md @@ -224,7 +224,6 @@ This is a list of grammars that Linguist selects to provide syntax highlighting - **NewLisp:** [textmate/lisp.tmbundle](https://github.com/textmate/lisp.tmbundle) - **Nginx:** [brandonwamboldt/sublime-nginx](https://github.com/brandonwamboldt/sublime-nginx) - **Nimrod:** [Varriount/NimLime](https://github.com/Varriount/NimLime) -- **Ninja:** [textmate/ninja.tmbundle](https://github.com/textmate/ninja.tmbundle) - **Nit:** [R4PaSs/Sublime-Nit](https://github.com/R4PaSs/Sublime-Nit) - **Nix:** [wmertens/sublime-nix](https://github.com/wmertens/sublime-nix) - **NSIS:** [github-linguist/NSIS](https://github.com/github-linguist/NSIS) diff --git a/vendor/grammars/language-fontforge b/vendor/grammars/language-fontforge new file mode 160000 index 00000000..b8233304 --- /dev/null +++ b/vendor/grammars/language-fontforge @@ -0,0 +1 @@ +Subproject commit b8233304fdc9575a08a62f9280587050b10518f6 diff --git a/vendor/grammars/language-ninja b/vendor/grammars/language-ninja new file mode 160000 index 00000000..207a6037 --- /dev/null +++ b/vendor/grammars/language-ninja @@ -0,0 +1 @@ +Subproject commit 207a60371f4c86d094dcad17e12ea57d4ca0eb7f diff --git a/vendor/grammars/ninja.tmbundle b/vendor/grammars/ninja.tmbundle deleted file mode 160000 index 89d9cf33..00000000 --- a/vendor/grammars/ninja.tmbundle +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 89d9cf333074a6f948053bbcf724281ec4a7adc6 diff --git a/vendor/licenses/grammar/language-fontforge.txt b/vendor/licenses/grammar/language-fontforge.txt new file mode 100644 index 00000000..3c0b29a8 --- /dev/null +++ b/vendor/licenses/grammar/language-fontforge.txt @@ -0,0 +1,18 @@ +--- +type: grammar +name: language-fontforge +license: isc +--- +Copyright (c) 2016, John Gardner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/vendor/licenses/grammar/language-ninja.txt b/vendor/licenses/grammar/language-ninja.txt new file mode 100644 index 00000000..85caa518 --- /dev/null +++ b/vendor/licenses/grammar/language-ninja.txt @@ -0,0 +1,25 @@ +--- +type: grammar +name: language-ninja +license: mit +--- +Copyright (c) 2015 Kyle Howen + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/licenses/grammar/ninja.tmbundle.txt b/vendor/licenses/grammar/ninja.tmbundle.txt deleted file mode 100644 index 41f94c59..00000000 --- a/vendor/licenses/grammar/ninja.tmbundle.txt +++ /dev/null @@ -1,15 +0,0 @@ ---- -type: grammar -name: ninja.tmbundle -license: permissive -curated: true ---- - -If not otherwise specified (see below), files in this repository fall under the following license: - - Permission to copy, use, modify, sell and distribute this - software is granted. This software is provided "as is" without - express or implied warranty, and with no claim as to its - suitability for any purpose. - -An exception is made for files in readable text which contain their own license information, or files where an accompanying file exists (in the same directory) with a “-license” suffix added to the base-name name of the original file, and an extension of txt, html, or similar. For example “tidy” is accompanied by “tidy-license.txt”.