From 22d4865c52aae3e625836e1f06e08d4741644517 Mon Sep 17 00:00:00 2001 From: Alhadis Date: Sun, 11 Sep 2016 00:51:03 +1000 Subject: [PATCH 01/45] Revise patterns for Vim modeline detection The current expressions fail to match certain permutations of options: vim: noexpandtab: ft=javascript: vim: titlestring=foo\ ft=notperl ft=javascript: Version-specific modelines are also unaccounted for: vim600: set foldmethod=marker ft=javascript: # >= Vim 6.0 vim<600: set ft=javascript: # < Vim 6.0 See http://vimdoc.sourceforge.net/htmldoc/options.html#modeline --- lib/linguist/strategy/modeline.rb | 67 ++++++++++++++++++++++---- test/fixtures/Data/Modelines/iamjs.pl | 3 ++ test/fixtures/Data/Modelines/iamjs2.pl | 4 ++ test/test_modelines.rb | 4 ++ 4 files changed, 69 insertions(+), 9 deletions(-) create mode 100644 test/fixtures/Data/Modelines/iamjs.pl create mode 100644 test/fixtures/Data/Modelines/iamjs2.pl diff --git a/lib/linguist/strategy/modeline.rb b/lib/linguist/strategy/modeline.rb index 4e16a03c..d9ddf9c3 100644 --- a/lib/linguist/strategy/modeline.rb +++ b/lib/linguist/strategy/modeline.rb @@ -2,18 +2,67 @@ module Linguist module Strategy class Modeline EMACS_MODELINE = /-\*-\s*(?:(?!mode)[\w-]+\s*:\s*(?:[\w+-]+)\s*;?\s*)*(?:mode\s*:)?\s*([\w+-]+)\s*(?:;\s*(?!mode)[\w-]+\s*:\s*[\w+-]+\s*)*;?\s*-\*-/i + VIM_MODELINE = / - # First form vim modeline - # [text]{white}{vi:|vim:|ex:}[white]{options} - # ex: 'vim: syntax=ruby' - VIM_MODELINE_1 = /(?:vim|vi|ex):\s*(?:ft|filetype|syntax)=(\w+)\s?/i + # Start modeline. Could be `vim:`, `vi:` or `ex:` + (?: + (?:\s|^) + vi + (?:m[<=>]?\d+|m)? # Version-specific modeline + | + (?!^)\s + ex + ) - # Second form vim modeline (compatible with some versions of Vi) - # [text]{white}{vi:|vim:|Vim:|ex:}[white]se[t] {options}:[text] - # ex: 'vim set syntax=ruby:' - VIM_MODELINE_2 = /(?:vim|vi|Vim|ex):\s*se(?:t)?.*\s(?:ft|filetype|syntax)=(\w+)\s?.*:/i + # If the option-list begins with `set ` or `se `, it indicates an alternative + # modeline syntax partly-compatible with older versions of Vi. Here, the colon + # serves as a terminator for an option sequence, delimited by whitespace. + (?= + # So we have to ensure the modeline ends with a colon + : (?=\s* set? \s [^\n:]+ :) | - MODELINES = [EMACS_MODELINE, VIM_MODELINE_1, VIM_MODELINE_2] + # Otherwise, it isn't valid syntax and should be ignored + : (?!\s* set? \s) + ) + + # Possible (unrelated) `option=value` pairs to skip past + (?: + # Option separator. Vim uses whitespace or colons to separate options (except if + # the alternate "vim: set " form is used, where only whitespace is used) + (?: + \s + | + \s* : \s* # Note that whitespace around colons is accepted too: + ) # vim: noai : ft=ruby:noexpandtab + + # Option's name. All recognised Vim options have an alphanumeric form. + \w* + + # Possible value. Not every option takes an argument. + (?: + # Whitespace between name and value is allowed: `vim: ft =ruby` + \s*= + + # Option's value. Might be blank; `vim: ft= ` says "use no filetype". + (?: + [^\\\s] # Beware of escaped characters: titlestring=\ ft=ruby + | # will be read by Vim as { titlestring: " ft=ruby" }. + \\. + )* + )? + )* + + # The actual filetype declaration + [\s:] (?:filetype|ft|syntax) \s*= + + # Language's name + (\w+) + + # Ensure it's followed by a legal separator + (?=\s|:|$) + /xi + + MODELINES = [EMACS_MODELINE, VIM_MODELINE] # Scope of the search for modelines # Number of lines to check at the beginning and at the end of the file diff --git a/test/fixtures/Data/Modelines/iamjs.pl b/test/fixtures/Data/Modelines/iamjs.pl new file mode 100644 index 00000000..b5d8f236 --- /dev/null +++ b/test/fixtures/Data/Modelines/iamjs.pl @@ -0,0 +1,3 @@ +# vim: noexpandtab: ft=javascript + +"It's JavaScript, baby"; diff --git a/test/fixtures/Data/Modelines/iamjs2.pl b/test/fixtures/Data/Modelines/iamjs2.pl new file mode 100644 index 00000000..623b827a --- /dev/null +++ b/test/fixtures/Data/Modelines/iamjs2.pl @@ -0,0 +1,4 @@ +# vim:noexpandtab titlestring=hi\|there\\\ ft=perl ts=4 +# vim:noexpandtab titlestring=hi|there\\ ft=javascript ts=4 + +"Still JavaScript, bruh"; diff --git a/test/test_modelines.rb b/test/test_modelines.rb index 192da9d4..b2eba82a 100644 --- a/test/test_modelines.rb +++ b/test/test_modelines.rb @@ -30,6 +30,8 @@ class TestModelines < Minitest::Test assert_modeline Language["Text"], fixture_blob("Data/Modelines/fundamentalEmacs.c") assert_modeline Language["Prolog"], fixture_blob("Data/Modelines/not_perl.pl") assert_modeline Language["Smalltalk"], fixture_blob("Data/Modelines/example_smalltalk.md") + assert_modeline Language["JavaScript"], fixture_blob("Data/Modelines/iamjs.pl") + assert_modeline Language["JavaScript"], fixture_blob("Data/Modelines/iamjs2.pl") assert_modeline Language["PHP"], fixture_blob("Data/Modelines/iamphp.inc") assert_modeline nil, sample_blob("C/main.c") end @@ -51,6 +53,8 @@ class TestModelines < Minitest::Test assert_equal Language["Text"], fixture_blob("Data/Modelines/fundamentalEmacs.c").language assert_equal Language["Prolog"], fixture_blob("Data/Modelines/not_perl.pl").language assert_equal Language["Smalltalk"], fixture_blob("Data/Modelines/example_smalltalk.md").language + assert_equal Language["JavaScript"], fixture_blob("Data/Modelines/iamjs.pl").language + assert_equal Language["JavaScript"], fixture_blob("Data/Modelines/iamjs2.pl").language assert_equal Language["PHP"], fixture_blob("Data/Modelines/iamphp.inc").language end end From e73a4ecd0ece2a6599625e28aace649f5fa0eba3 Mon Sep 17 00:00:00 2001 From: Alhadis Date: Mon, 12 Sep 2016 19:59:08 +1000 Subject: [PATCH 02/45] Allow " ex:" to match at beginning of file Although unlikely to be valid syntax in most programming languages, such a modeline is valid syntax in Vim, and will trigger any filetype modes. --- lib/linguist/strategy/modeline.rb | 2 +- test/fixtures/Data/Modelines/ruby10 | 3 +++ test/test_modelines.rb | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/Data/Modelines/ruby10 diff --git a/lib/linguist/strategy/modeline.rb b/lib/linguist/strategy/modeline.rb index d9ddf9c3..61ba723a 100644 --- a/lib/linguist/strategy/modeline.rb +++ b/lib/linguist/strategy/modeline.rb @@ -10,7 +10,7 @@ module Linguist vi (?:m[<=>]?\d+|m)? # Version-specific modeline | - (?!^)\s + [\t\x20] # `ex:` requires whitespace, because "ex:" might be short for "example:" ex ) diff --git a/test/fixtures/Data/Modelines/ruby10 b/test/fixtures/Data/Modelines/ruby10 new file mode 100644 index 00000000..67dd4864 --- /dev/null +++ b/test/fixtures/Data/Modelines/ruby10 @@ -0,0 +1,3 @@ + ex: noexpandtab: ft=ruby + +# Still Ruby diff --git a/test/test_modelines.rb b/test/test_modelines.rb index b2eba82a..1437ee6a 100644 --- a/test/test_modelines.rb +++ b/test/test_modelines.rb @@ -17,6 +17,7 @@ class TestModelines < Minitest::Test assert_modeline Language["Ruby"], fixture_blob("Data/Modelines/ruby7") assert_modeline Language["Ruby"], fixture_blob("Data/Modelines/ruby8") assert_modeline Language["Ruby"], fixture_blob("Data/Modelines/ruby9") + assert_modeline Language["Ruby"], fixture_blob("Data/Modelines/ruby10") assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplus") assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs1") assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs2") From abf7bee4645b392a35e49c1ab4505c30fd2c4333 Mon Sep 17 00:00:00 2001 From: Alhadis Date: Mon, 12 Sep 2016 20:00:05 +1000 Subject: [PATCH 03/45] Include tests for version-specific Vim modelines --- test/fixtures/Data/Modelines/ruby11 | 3 +++ test/fixtures/Data/Modelines/ruby12 | 3 +++ test/test_modelines.rb | 2 ++ 3 files changed, 8 insertions(+) create mode 100644 test/fixtures/Data/Modelines/ruby11 create mode 100644 test/fixtures/Data/Modelines/ruby12 diff --git a/test/fixtures/Data/Modelines/ruby11 b/test/fixtures/Data/Modelines/ruby11 new file mode 100644 index 00000000..3d167468 --- /dev/null +++ b/test/fixtures/Data/Modelines/ruby11 @@ -0,0 +1,3 @@ +# vim600: ft=ruby + +# Targets Vim 6.0 or later diff --git a/test/fixtures/Data/Modelines/ruby12 b/test/fixtures/Data/Modelines/ruby12 new file mode 100644 index 00000000..a7ef89a9 --- /dev/null +++ b/test/fixtures/Data/Modelines/ruby12 @@ -0,0 +1,3 @@ +vim<520: ft=ruby + +# Targets Vim 5.20 and earlier diff --git a/test/test_modelines.rb b/test/test_modelines.rb index 1437ee6a..16a68a17 100644 --- a/test/test_modelines.rb +++ b/test/test_modelines.rb @@ -18,6 +18,8 @@ class TestModelines < Minitest::Test assert_modeline Language["Ruby"], fixture_blob("Data/Modelines/ruby8") assert_modeline Language["Ruby"], fixture_blob("Data/Modelines/ruby9") assert_modeline Language["Ruby"], fixture_blob("Data/Modelines/ruby10") + assert_modeline Language["Ruby"], fixture_blob("Data/Modelines/ruby11") + assert_modeline Language["Ruby"], fixture_blob("Data/Modelines/ruby12") assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplus") assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs1") assert_modeline Language["C++"], fixture_blob("Data/Modelines/seeplusplusEmacs2") From cd288a8ee446938d5e34a62bbd07aee59a34ef6c Mon Sep 17 00:00:00 2001 From: Alhadis Date: Thu, 15 Sep 2016 17:06:59 +1000 Subject: [PATCH 04/45] Add .gnus, .viper and Project.ede as Emacs Lisp extensions --- lib/linguist/languages.yml | 3 +++ samples/Emacs Lisp/filenames/.gnus | 20 ++++++++++++++ samples/Emacs Lisp/filenames/.viper | 10 +++++++ samples/Emacs Lisp/filenames/Project.ede | 34 ++++++++++++++++++++++++ 4 files changed, 67 insertions(+) create mode 100644 samples/Emacs Lisp/filenames/.gnus create mode 100644 samples/Emacs Lisp/filenames/.viper create mode 100644 samples/Emacs Lisp/filenames/Project.ede diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 861a7efa..495d25e1 100755 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -1039,7 +1039,10 @@ Emacs Lisp: filenames: - ".emacs" - ".emacs.desktop" + - ".gnus" - ".spacemacs" + - ".viper" + - "Project.ede" extensions: - ".el" - ".emacs" diff --git a/samples/Emacs Lisp/filenames/.gnus b/samples/Emacs Lisp/filenames/.gnus new file mode 100644 index 00000000..bfd859dd --- /dev/null +++ b/samples/Emacs Lisp/filenames/.gnus @@ -0,0 +1,20 @@ +(setq user-full-name "Alhadis") +(setq user-mail-address "fake.account@gmail.com") + +(auto-image-file-mode) +(setq mm-inline-large-images t) +(add-to-list 'mm-attachment-override-types "image/*") + +(setq gnus-select-method + '(nnimap "gmail" + (nnimap-address "imap.gmail.com") + (nnimap-server-port 777) + (nnimap-stream ssl))) + +(setq message-send-mail-function 'smtpmail-send-it + smtpmail-starttls-credentials '(("smtp.gmail.com" 600 nil nil)) + smtpmail-auth-credentials '(("smtp.gmail.com" 700 "me@lisp.com" nil)) + smtpmail-default-smtp-server "smtp.gmail.com" + smtpmail-smtp-server "smtp.gmail.com" + smtpmail-smtp-service 800 + setq gnus-ignored-from-addresses "^from\\.Telstra[ \t\r\n]+Thanks") diff --git a/samples/Emacs Lisp/filenames/.viper b/samples/Emacs Lisp/filenames/.viper new file mode 100644 index 00000000..c3eeb658 --- /dev/null +++ b/samples/Emacs Lisp/filenames/.viper @@ -0,0 +1,10 @@ +(setq viper-inhibit-startup-message 't) +(setq viper-expert-level '5) + +; Key bindings +(define-key viper-vi-global-user-map "\C-d" 'end-of-line) + +; Return to top of window +(defun my-viper-return-to-top () + (interactive) + (beginning-of-buffer)) diff --git a/samples/Emacs Lisp/filenames/Project.ede b/samples/Emacs Lisp/filenames/Project.ede new file mode 100644 index 00000000..36a0c8bd --- /dev/null +++ b/samples/Emacs Lisp/filenames/Project.ede @@ -0,0 +1,34 @@ +;; Object EDE +(ede-proj-project "Linguist" + :name "Linguist" + :version "4.9" + :file "Project.ede" + :targets (list + (ede-proj-target-elisp-autoloads "autoloads" + :name "autoloads" + :path "test/samples/Emacs Lisp" + :autoload-file "dude.el" + ) + (ede-proj-target-elisp "init" + :name "init" + :path "" + :source '("ede-load.el" "wait-what.el") + :compiler 'ede-emacs-preload-compiler + :pre-load-packages '("sample-names") + ) + (ede-proj-target-elisp "what" + :name "the" + :path "" + :source '("h.el" "am-i-writing.el") + :versionsource '("hell.el") + :compiler 'ede-emacs-preload-compiler + :aux-packages '("what" "the" "hell-files" "am-i-writing") + ) + ) + :web-site-url "https://github.com/github/linguist" + :web-site-directory "../" + :web-site-file "CONTRIBUTING.md" + :ftp-upload-site "/ftp@git.hub.com:/madeup" + :configuration-variables 'nil + :metasubproject 't + ) From 81ca6e776662312881b0bd1391ed495e09871b44 Mon Sep 17 00:00:00 2001 From: Alhadis Date: Thu, 15 Sep 2016 18:57:13 +1000 Subject: [PATCH 05/45] Add "abbrev_defs" and "_emacs" as Elisp filenames --- lib/linguist/languages.yml | 3 + samples/Emacs Lisp/filenames/.abbrev_defs | 6 ++ samples/Emacs Lisp/filenames/_emacs | 70 +++++++++++++++++++++++ samples/Emacs Lisp/filenames/abbrev_defs | 8 +++ 4 files changed, 87 insertions(+) create mode 100644 samples/Emacs Lisp/filenames/.abbrev_defs create mode 100644 samples/Emacs Lisp/filenames/_emacs create mode 100644 samples/Emacs Lisp/filenames/abbrev_defs diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 495d25e1..8b3d39e5 100755 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -1037,12 +1037,15 @@ Emacs Lisp: - elisp - emacs filenames: + - ".abbrev_defs" - ".emacs" - ".emacs.desktop" - ".gnus" - ".spacemacs" - ".viper" - "Project.ede" + - "_emacs" + - "abbrev_defs" extensions: - ".el" - ".emacs" diff --git a/samples/Emacs Lisp/filenames/.abbrev_defs b/samples/Emacs Lisp/filenames/.abbrev_defs new file mode 100644 index 00000000..dc29dfde --- /dev/null +++ b/samples/Emacs Lisp/filenames/.abbrev_defs @@ -0,0 +1,6 @@ +(define-abbrev-table 'c-mode-abbrev-table '( + )) +(define-abbrev-table 'fundamental-mode-abbrev-table '( + ("TM" "™" nil 0) + ("(R)" "®" nil 0) + ("C=" "€" nil 0))) diff --git a/samples/Emacs Lisp/filenames/_emacs b/samples/Emacs Lisp/filenames/_emacs new file mode 100644 index 00000000..4968f8eb --- /dev/null +++ b/samples/Emacs Lisp/filenames/_emacs @@ -0,0 +1,70 @@ +;; UTF-8 support +;; (set-language-environment "UTF-8") +(setenv "LANG" "en_AU.UTF-8") +(setenv "LC_ALL" "en_AU.UTF-8") +(setq default-tab-width 4) + + +;;; Function to load all ".el" files in ~/.emacs.d/config +(defun load-directory (directory) + "Recursively load all Emacs Lisp files in a directory." + (dolist (element (directory-files-and-attributes directory nil nil nil)) + (let* ((path (car element)) + (fullpath (concat directory "/" path)) + (isdir (car (cdr element))) + (ignore-dir (or (string= path ".") (string= path "..")))) + (cond + ((and (eq isdir t) (not ignore-dir)) + (load-directory fullpath)) + ((and (eq isdir nil) (string= (substring path -3) ".el")) + (load (file-name-sans-extension fullpath))))))) + +;; Tell Emacs we'd like to use Hunspell for spell-checking +(setq ispell-program-name (executable-find "hunspell")) + +;; Load Homebrew-installed packages +(let ((default-directory "/usr/local/share/emacs/site-lisp/")) + (normal-top-level-add-subdirs-to-load-path)) +(load "aggressive-indent") +(add-hook 'emacs-lisp-mode-hook #'aggressive-indent-mode) +(autoload 'rust-mode "rust-mode" nil t) +(add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode)) + +;; Load Git-related syntax highlighting +(add-to-list 'load-path "~/.emacs.d/lisp/") +(load "git-modes") +(load "git-commit") + +;; Keybindings +(global-set-key (kbd "C-u") (lambda () + (interactive) + (kill-line 0))) + +;; Show cursor's current column number +(setq column-number-mode t) + +;; Disable autosave +(setq auto-save-default nil) + +;; Use a single directory for storing backup files +(setq backup-directory-alist `(("." . "~/.emacs.d/auto-save-list"))) +(setq backup-by-copying t) +(setq delete-old-versions t + kept-new-versions 6 + kept-old-versions 2 + version-control t) + +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(blink-cursor-mode nil) + '(column-number-mode t) + '(show-paren-mode t)) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + ) diff --git a/samples/Emacs Lisp/filenames/abbrev_defs b/samples/Emacs Lisp/filenames/abbrev_defs new file mode 100644 index 00000000..87dfad8c --- /dev/null +++ b/samples/Emacs Lisp/filenames/abbrev_defs @@ -0,0 +1,8 @@ +(define-abbrev-table 'fundamental-mode-abbrev-table '( + ("cat" "Concatenate" nil 0) + ("WTF" "World Trade Federation " nil 0) + ("rtbtm" "Read that back to me" nil 0))) + +(define-abbrev-table 'shell-script-mode-abbrev-table '( + ("brake", "bundle rake exec" nil 0) + ("pls", "warning: setting Encoding.default_external"))) From 5bc88814e2a88c919a95eaf6df6f797cee9d973e Mon Sep 17 00:00:00 2001 From: Alhadis Date: Fri, 16 Sep 2016 02:47:26 +1000 Subject: [PATCH 06/45] Swap grammar used for Vimscript highlighting --- .gitmodules | 6 ++--- grammars.yml | 4 ++-- lib/linguist/languages.yml | 1 + vendor/grammars/Sublime-VimL | 1 - vendor/grammars/language-viml | 1 + vendor/licenses/grammar/language-viml.txt | 27 +++++++++++++++++++++++ 6 files changed, 34 insertions(+), 6 deletions(-) delete mode 160000 vendor/grammars/Sublime-VimL create mode 160000 vendor/grammars/language-viml create mode 100644 vendor/licenses/grammar/language-viml.txt diff --git a/.gitmodules b/.gitmodules index fa4fd377..cbf7a602 100644 --- a/.gitmodules +++ b/.gitmodules @@ -22,9 +22,9 @@ [submodule "vendor/grammars/Sublime-REBOL"] path = vendor/grammars/Sublime-REBOL url = https://github.com/Oldes/Sublime-REBOL -[submodule "vendor/grammars/Sublime-VimL"] - path = vendor/grammars/Sublime-VimL - url = https://github.com/SalGnt/Sublime-VimL +[submodule "vendor/grammars/language-viml"] + path = vendor/grammars/language-viml + url = https://github.com/Alhadis/language-viml [submodule "vendor/grammars/ColdFusion"] path = vendor/grammars/ColdFusion url = https://github.com/SublimeText/ColdFusion diff --git a/grammars.yml b/grammars.yml index e51e8848..3a38ca96 100755 --- a/grammars.yml +++ b/grammars.yml @@ -103,8 +103,6 @@ vendor/grammars/Sublime-SQF-Language: vendor/grammars/Sublime-Text-2-OpenEdge-ABL: - source.abl - text.html.abl -vendor/grammars/Sublime-VimL: -- source.viml vendor/grammars/SublimeBrainfuck: - source.bf vendor/grammars/SublimeClarion: @@ -414,6 +412,8 @@ vendor/grammars/language-toc-wow: - source.toc vendor/grammars/language-turing: - source.turing +vendor/grammars/language-viml: +- source.viml vendor/grammars/language-wavefront: - source.wavefront.mtl - source.wavefront.obj diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 861a7efa..4919a9ab 100755 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -4001,6 +4001,7 @@ VimL: type: programming color: "#199f4b" search_term: vim + tm_scope: source.viml aliases: - vim - nvim diff --git a/vendor/grammars/Sublime-VimL b/vendor/grammars/Sublime-VimL deleted file mode 160000 index b453aff6..00000000 --- a/vendor/grammars/Sublime-VimL +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b453aff6f783769b6b895986da605a2db0db7379 diff --git a/vendor/grammars/language-viml b/vendor/grammars/language-viml new file mode 160000 index 00000000..ccdaff45 --- /dev/null +++ b/vendor/grammars/language-viml @@ -0,0 +1 @@ +Subproject commit ccdaff4535b5720e9a89460afcc7b8dc65f46d27 diff --git a/vendor/licenses/grammar/language-viml.txt b/vendor/licenses/grammar/language-viml.txt new file mode 100644 index 00000000..0bb64e03 --- /dev/null +++ b/vendor/licenses/grammar/language-viml.txt @@ -0,0 +1,27 @@ +--- +type: grammar +name: language-viml +license: mit +--- +The MIT License (MIT) + +Copyright (c) 2014-2016 Evan Hahn +Copyright (c) 2016 John Gardner + +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. From 5fd8d718582480bd93ac19b612bb91e6351b76ea Mon Sep 17 00:00:00 2001 From: Alhadis Date: Fri, 16 Sep 2016 06:17:16 +1000 Subject: [PATCH 07/45] Remove license for old grammar --- vendor/licenses/grammar/Sublime-VimL.txt | 26 ------------------------ 1 file changed, 26 deletions(-) delete mode 100644 vendor/licenses/grammar/Sublime-VimL.txt diff --git a/vendor/licenses/grammar/Sublime-VimL.txt b/vendor/licenses/grammar/Sublime-VimL.txt deleted file mode 100644 index fe443d3e..00000000 --- a/vendor/licenses/grammar/Sublime-VimL.txt +++ /dev/null @@ -1,26 +0,0 @@ ---- -type: grammar -name: Sublime-VimL -license: mit ---- -The MIT License (MIT) - -Copyright (c) 2014 Max Vasiliev, Salvatore Gentile - -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. From 697380336c980420f4ea1038cc8b0b6287f015ff Mon Sep 17 00:00:00 2001 From: Alhadis Date: Sat, 17 Sep 2016 19:45:43 +1000 Subject: [PATCH 08/45] Revise pattern for Emacs modeline detection This is a rewrite of the regex that handles Emacs modeline matching. The current one is a little flaky, causing some files to be misclassified as "E", among other things. It's worth noting malformed modelines can still change a file's language in Emacs. Provided the -*- delimiters are intact, and the mode's name is decipherable, Emacs will set the appropriate language mode *and* display a warning about a malformed modeline: -*- foo-bar mode: ruby -*- # Malformed, but understandable -*- mode: ruby--*- # Completely invalid The new pattern accommodates this leniency, making no effort to validate a modeline's syntax beyond readable mode-names. In other words, if Emacs accepts certain errors, we should too. --- lib/linguist/strategy/modeline.rb | 31 ++++++++++++++++++- .../Data/Modelines/seeplusplusEmacs10 | 3 ++ .../Data/Modelines/seeplusplusEmacs11 | 1 + .../Data/Modelines/seeplusplusEmacs12 | 1 + test/test_modelines.rb | 6 ++++ 5 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/Data/Modelines/seeplusplusEmacs10 create mode 100644 test/fixtures/Data/Modelines/seeplusplusEmacs11 create mode 100644 test/fixtures/Data/Modelines/seeplusplusEmacs12 diff --git a/lib/linguist/strategy/modeline.rb b/lib/linguist/strategy/modeline.rb index 4e16a03c..56b33aae 100644 --- a/lib/linguist/strategy/modeline.rb +++ b/lib/linguist/strategy/modeline.rb @@ -1,7 +1,36 @@ module Linguist module Strategy class Modeline - EMACS_MODELINE = /-\*-\s*(?:(?!mode)[\w-]+\s*:\s*(?:[\w+-]+)\s*;?\s*)*(?:mode\s*:)?\s*([\w+-]+)\s*(?:;\s*(?!mode)[\w-]+\s*:\s*[\w+-]+\s*)*;?\s*-\*-/i + EMACS_MODELINE = / + -\*- + (?: + # Short form: `-*- ruby -*-` + \s* (?= [^:;\s]+ \s* -\*-) + | + # Longer form: `-*- foo:bar; mode: ruby; -*-` + (?: + .*? # Preceding variables: `-*- foo:bar bar:baz;` + [;\s] # Which are delimited by spaces or semicolons + | + (?<=-\*-) # Not preceded by anything: `-*-mode:ruby-*-` + ) + mode # Major mode indicator + \s*:\s* # Allow whitespace around colon: `mode : ruby` + ) + ([^:;\s]+) # Name of mode + + # Ensure the mode is terminated correctly + (?= + # Followed by semicolon or whitespace + [\s;] + | + # Touching the ending sequence: `ruby-*-` + (? Date: Tue, 20 Sep 2016 23:23:22 -0700 Subject: [PATCH 09/45] Add Codemirror modes --- .gitignore | 1 + lib/linguist/language.rb | 12 +++ lib/linguist/languages.yml | 198 ++++++++++++++++++++++++++++++++++++- 3 files changed, 209 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c0ab5df0..4b360dba 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /Gemfile.lock .bundle/ +.idea benchmark/ lib/linguist/samples.json /grammars diff --git a/lib/linguist/language.rb b/lib/linguist/language.rb index 7ae48b17..7f4fd903 100644 --- a/lib/linguist/language.rb +++ b/lib/linguist/language.rb @@ -300,6 +300,7 @@ module Linguist end @ace_mode = attributes[:ace_mode] + @codemirror_mode = attributes[:codemirror_mode] @wrap = attributes[:wrap] || false # Set legacy search term @@ -397,6 +398,17 @@ module Linguist # Returns a String name or nil attr_reader :ace_mode + # Public: Get Codemirror mode + # + # Examples + # + # # => "nil" + # # => "javascript" + # # => "clike" + # + # Returns a String name or nil + attr_reader :codemirror_mode + # Public: Should language lines be wrapped # # Returns true or false diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 861a7efa..541fd71f 100755 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -6,6 +6,8 @@ # ace_mode - A String name of the Ace Mode used for highlighting whenever # a file is edited. This must match one of the filenames in http://git.io/3XO_Cg. # Use "text" if a mode does not exist. +# codemirror_mode - A String name of the Codemirror Mode used for highlighting whenever a file is edited. +# This must match a mode from https://git.io/vi9Fx # wrap - Boolean wrap to enable line wrapping (default: false) # extensions - An Array of associated extensions (the first one is # considered the primary extension, the others should be @@ -57,6 +59,7 @@ AGS Script: - ".ash" tm_scope: source.c++ ace_mode: c_cpp + codemirror_mode: clike language_id: 2 AMPL: type: programming @@ -94,6 +97,7 @@ APL: - dyalog tm_scope: source.apl ace_mode: text + codemirror_mode: apl language_id: 6 ASN.1: type: data @@ -103,6 +107,7 @@ ASN.1: - ".asn1" tm_scope: source.asn ace_mode: text + codemirror_mode: asn.1 language_id: 7 ASP: type: programming @@ -121,6 +126,7 @@ ASP: - ".aspx" - ".axd" ace_mode: text + codemirror_mode: htmlembedded language_id: 8 ATS: type: programming @@ -183,6 +189,7 @@ Alpine Abuild: - APKBUILD tm_scope: source.shell ace_mode: sh + codemirror_mode: shell language_id: 14 Ant Build System: type: data @@ -191,6 +198,7 @@ Ant Build System: - ant.xml - build.xml ace_mode: xml + codemirror_mode: xml language_id: 15 ApacheConf: type: markup @@ -209,6 +217,7 @@ Apex: - ".cls" tm_scope: source.java ace_mode: java + codemirror_mode: clike language_id: 17 Apollo Guidance Computer: type: programming @@ -218,6 +227,7 @@ Apollo Guidance Computer: - ".agc" tm_scope: source.agc ace_mode: assembly_x86 + codemirror_mode: gas language_id: 18 AppleScript: type: programming @@ -246,6 +256,7 @@ Arduino: - ".ino" tm_scope: source.c++ ace_mode: c_cpp + codemirror_mode: clike language_id: 21 AsciiDoc: type: prose @@ -278,6 +289,7 @@ Assembly: - ".nasm" tm_scope: source.assembly ace_mode: assembly_x86 + codemirror_mode: gas language_id: 24 Augeas: type: programming @@ -415,6 +427,7 @@ Brainfuck: - ".bf" tm_scope: source.bf ace_mode: text + codemirror_mode: brainfuck language_id: 38 Brightscript: type: programming @@ -441,10 +454,12 @@ C: interpreters: - tcc ace_mode: c_cpp + codemirror_mode: clike language_id: 41 C#: type: programming ace_mode: csharp + codemirror_mode: clike tm_scope: source.cs search_term: csharp color: "#178600" @@ -459,6 +474,7 @@ C#: C++: type: programming ace_mode: c_cpp + codemirror_mode: clike search_term: cpp color: "#f34b7d" aliases: @@ -486,6 +502,7 @@ C-ObjDump: - ".c-objdump" tm_scope: objdump.x86asm ace_mode: assembly_x86 + codemirror_mode: gas language_id: 44 C2hs Haskell: type: programming @@ -496,6 +513,7 @@ C2hs Haskell: - ".chs" tm_scope: source.haskell ace_mode: haskell + codemirror_mode: haskell language_id: 45 CLIPS: type: programming @@ -512,6 +530,7 @@ CMake: filenames: - CMakeLists.txt ace_mode: text + codemirror_mode: cmake language_id: 47 COBOL: type: programming @@ -522,6 +541,7 @@ COBOL: - ".cobol" - ".cpy" ace_mode: cobol + codemirror_mode: cobol language_id: 48 COLLADA: type: data @@ -529,11 +549,13 @@ COLLADA: - ".dae" tm_scope: text.xml ace_mode: xml + codemirror_mode: xml language_id: 49 CSS: type: markup tm_scope: source.css ace_mode: css + codemirror_mode: css color: "#563d7c" extensions: - ".css" @@ -589,6 +611,7 @@ ChucK: - ".ck" tm_scope: source.java ace_mode: java + codemirror_mode: clike language_id: 57 Cirru: type: programming @@ -625,6 +648,7 @@ Click: Clojure: type: programming ace_mode: clojure + codemirror_mode: clojure color: "#db5855" extensions: - ".clj" @@ -643,6 +667,7 @@ CoffeeScript: type: programming tm_scope: source.coffee ace_mode: coffee + codemirror_mode: coffeescript color: "#244776" aliases: - coffee @@ -708,6 +733,7 @@ Common Lisp: - clisp - ecl ace_mode: lisp + codemirror_mode: commonlisp language_id: 66 Component Pascal: type: programming @@ -720,6 +746,7 @@ Component Pascal: - delphi - objectpascal ace_mode: pascal + codemirror_mode: pascal language_id: 67 Cool: type: programming @@ -747,6 +774,7 @@ Cpp-ObjDump: aliases: - c++-objdump ace_mode: assembly_x86 + codemirror_mode: gas language_id: 70 Creole: type: prose @@ -762,6 +790,7 @@ Crystal: extensions: - ".cr" ace_mode: ruby + codemirror_mode: crystal tm_scope: source.crystal interpreters: - crystal @@ -811,6 +840,7 @@ Cuda: - ".cuh" tm_scope: source.cuda-c++ ace_mode: c_cpp + codemirror_mode: clike color: "#3A4E3A" language_id: 77 Cycript: @@ -819,6 +849,7 @@ Cycript: - ".cy" tm_scope: source.js ace_mode: javascript + codemirror_mode: javascript language_id: 78 Cython: type: programming @@ -830,6 +861,7 @@ Cython: aliases: - pyrex ace_mode: text + codemirror_mode: python language_id: 79 D: type: programming @@ -838,6 +870,7 @@ D: - ".d" - ".di" ace_mode: d + codemirror_mode: d language_id: 80 D-ObjDump: type: data @@ -845,6 +878,7 @@ D-ObjDump: - ".d-objdump" tm_scope: objdump.x86asm ace_mode: assembly_x86 + codemirror_mode: gas language_id: 81 DIGITAL Command Language: type: programming @@ -883,6 +917,7 @@ DTrace: - dtrace tm_scope: source.c ace_mode: c_cpp + codemirror_mode: clike language_id: 85 Darcs Patch: type: data @@ -903,6 +938,7 @@ Dart: interpreters: - dart ace_mode: dart + codemirror_mode: dart language_id: 87 Diff: type: data @@ -913,6 +949,7 @@ Diff: - udiff tm_scope: source.diff ace_mode: diff + codemirror_mode: diff language_id: 88 Dockerfile: type: data @@ -922,6 +959,7 @@ Dockerfile: filenames: - Dockerfile ace_mode: dockerfile + codemirror_mode: dockerfile language_id: 89 Dogescript: type: programming @@ -940,6 +978,7 @@ Dylan: - ".intr" - ".lid" ace_mode: text + codemirror_mode: dylan language_id: 91 E: type: programming @@ -959,6 +998,7 @@ ECL: - ".eclxml" tm_scope: none ace_mode: text + codemirror_mode: ecl language_id: 93 ECLiPSe: type: programming @@ -984,6 +1024,7 @@ EQ: - ".eq" tm_scope: source.cs ace_mode: csharp + codemirror_mode: clike language_id: 96 Eagle: type: markup @@ -993,6 +1034,7 @@ Eagle: - ".brd" tm_scope: text.xml ace_mode: xml + codemirror_mode: xml language_id: 97 Ecere Projects: type: data @@ -1001,6 +1043,7 @@ Ecere Projects: - ".epj" tm_scope: source.json ace_mode: json + codemirror_mode: json language_id: 98 Eiffel: type: programming @@ -1008,6 +1051,7 @@ Eiffel: extensions: - ".e" ace_mode: eiffel + codemirror_mode: eiffel language_id: 99 Elixir: type: programming @@ -1028,6 +1072,7 @@ Elm: - ".elm" tm_scope: source.elm ace_mode: elm + codemirror_mode: elm language_id: 101 Emacs Lisp: type: programming @@ -1045,6 +1090,7 @@ Emacs Lisp: - ".emacs" - ".emacs.desktop" ace_mode: lisp + codemirror_mode: commonlisp language_id: 102 EmberScript: type: programming @@ -1054,6 +1100,7 @@ EmberScript: - ".emberscript" tm_scope: source.coffee ace_mode: coffee + codemirror_mode: coffeescript language_id: 103 Erlang: type: programming @@ -1071,6 +1118,7 @@ Erlang: - rebar.config.lock - rebar.lock ace_mode: erlang + codemirror_mode: erlang interpreters: - escript language_id: 104 @@ -1086,6 +1134,7 @@ F#: - ".fsx" tm_scope: source.fsharp ace_mode: text + codemirror_mode: mllike language_id: 105 FLUX: type: programming @@ -1110,6 +1159,7 @@ FORTRAN: - ".fpp" tm_scope: source.fortran.modern ace_mode: text + codemirror_mode: fortran language_id: 107 Factor: type: programming @@ -1120,6 +1170,7 @@ Factor: - ".factor-boot-rc" - ".factor-rc" ace_mode: text + codemirror_mode: factor language_id: 108 Fancy: type: programming @@ -1175,6 +1226,7 @@ Forth: - ".frt" - ".fs" ace_mode: forth + codemirror_mode: forth language_id: 114 FreeMarker: type: programming @@ -1229,6 +1281,7 @@ GAS: - ".ms" tm_scope: source.assembly ace_mode: assembly_x86 + codemirror_mode: gas language_id: 120 GCC Machine Description: type: programming @@ -1236,6 +1289,7 @@ GCC Machine Description: - ".md" tm_scope: source.lisp ace_mode: lisp + codemirror_mode: commonlisp language_id: 121 GDB: type: programming @@ -1280,6 +1334,7 @@ Game Maker Language: - ".gml" tm_scope: source.c++ ace_mode: c_cpp + codemirror_mode: clike language_id: 125 Genshi: type: programming @@ -1290,6 +1345,7 @@ Genshi: - xml+genshi - xml+kid ace_mode: xml + codemirror_mode: xml language_id: 126 Gentoo Ebuild: type: programming @@ -1298,6 +1354,7 @@ Gentoo Ebuild: - ".ebuild" tm_scope: source.shell ace_mode: sh + codemirror_mode: shell language_id: 127 Gentoo Eclass: type: programming @@ -1306,6 +1363,7 @@ Gentoo Eclass: - ".eclass" tm_scope: source.shell ace_mode: sh + codemirror_mode: shell language_id: 128 Gettext Catalog: type: prose @@ -1326,6 +1384,7 @@ Glyph: - ".glf" tm_scope: source.tcl ace_mode: tcl + codemirror_mode: tcl language_id: 130 Gnuplot: type: programming @@ -1346,6 +1405,7 @@ Go: extensions: - ".go" ace_mode: golang + codemirror_mode: go language_id: 132 Golo: type: programming @@ -1391,6 +1451,7 @@ Grammatical Framework: color: "#79aa7a" tm_scope: source.haskell ace_mode: haskell + codemirror_mode: haskell language_id: 137 Graph Modeling Language: type: data @@ -1450,10 +1511,12 @@ Groff: - nroff - troff ace_mode: text + codemirror_mode: troff language_id: 141 Groovy: type: programming ace_mode: groovy + codemirror_mode: groovy color: "#e69f56" extensions: - ".groovy" @@ -1475,6 +1538,7 @@ Groovy Server Pages: - ".gsp" tm_scope: text.html.jsp ace_mode: jsp + codemirror_mode: htmlembedded language_id: 143 HCL: type: programming @@ -1482,6 +1546,7 @@ HCL: - ".hcl" - ".tf" ace_mode: ruby + codemirror_mode: ruby tm_scope: source.ruby language_id: 144 HLSL: @@ -1498,6 +1563,7 @@ HTML: type: markup tm_scope: text.html.basic ace_mode: html + codemirror_mode: html color: "#e44b23" aliases: - xhtml @@ -1523,6 +1589,7 @@ HTML+Django: - html+jinja - htmldjango ace_mode: django + codemirror_mode: django language_id: 147 HTML+ECR: type: markup @@ -1533,6 +1600,7 @@ HTML+ECR: extensions: - ".ecr" ace_mode: text + codemirror_mode: htmlembedded language_id: 148 HTML+EEX: type: markup @@ -1543,6 +1611,7 @@ HTML+EEX: extensions: - ".eex" ace_mode: text + codemirror_mode: htmlembedded language_id: 149 HTML+ERB: type: markup @@ -1554,6 +1623,7 @@ HTML+ERB: - ".erb" - ".erb.deface" ace_mode: text + codemirror_mode: htmlembedded language_id: 150 HTML+PHP: type: markup @@ -1562,6 +1632,7 @@ HTML+PHP: extensions: - ".phtml" ace_mode: php + codemirror_mode: php language_id: 151 HTTP: type: data @@ -1569,10 +1640,12 @@ HTTP: - ".http" tm_scope: source.httpspec ace_mode: text + codemirror_mode: http language_id: 152 Hack: type: programming ace_mode: php + codemirror_mode: php extensions: - ".hh" - ".php" @@ -1586,6 +1659,7 @@ Haml: - ".haml" - ".haml.deface" ace_mode: haml + codemirror_mode: haml color: "#ECE2A9" language_id: 154 Handlebars: @@ -1600,6 +1674,7 @@ Handlebars: - ".hbs" tm_scope: text.html.handlebars ace_mode: handlebars + codemirror_mode: handlebars language_id: 155 Harbour: type: programming @@ -1618,10 +1693,12 @@ Haskell: interpreters: - runhaskell ace_mode: haskell + codemirror_mode: haskell language_id: 157 Haxe: type: programming ace_mode: haxe + codemirror_mode: haxe color: "#df7900" extensions: - ".hx" @@ -1652,6 +1729,7 @@ IDL: - ".pro" - ".dlm" ace_mode: text + codemirror_mode: idl language_id: 161 IGOR Pro: type: programming @@ -1675,6 +1753,7 @@ INI: aliases: - dosini ace_mode: ini + codemirror_mode: properties language_id: 163 IRC log: type: data @@ -1774,6 +1853,7 @@ JSON: tm_scope: source.json group: JavaScript ace_mode: json + codemirror_mode: javascript searchable: false extensions: - ".json" @@ -1792,11 +1872,13 @@ JSON5: - ".json5" tm_scope: source.js ace_mode: javascript + codemirror_mode: javascript language_id: 175 JSONLD: type: data group: JavaScript ace_mode: javascript + codemirror_mode: javascript extensions: - ".jsonld" tm_scope: source.js @@ -1805,6 +1887,7 @@ JSONiq: color: "#40d47e" type: programming ace_mode: jsoniq + codemirror_mode: javascript extensions: - ".jq" tm_scope: source.jq @@ -1825,6 +1908,7 @@ Jade: - ".pug" tm_scope: text.jade ace_mode: jade + codemirror_mode: pug language_id: 179 Jasmin: type: programming @@ -1836,6 +1920,7 @@ Jasmin: Java: type: programming ace_mode: java + codemirror_mode: clike color: "#b07219" extensions: - ".java" @@ -1850,11 +1935,13 @@ Java Server Pages: - ".jsp" tm_scope: text.html.jsp ace_mode: jsp + codemirror_mode: htmlembedded language_id: 182 JavaScript: type: programming tm_scope: source.js ace_mode: javascript + codemirror_mode: javascript color: "#f1e05a" aliases: - js @@ -1903,10 +1990,12 @@ Julia: - ".jl" color: "#a270ba" ace_mode: julia + codemirror_mode: julia language_id: 184 Jupyter Notebook: type: markup ace_mode: json + codemirror_mode: javascript tm_scope: source.json color: "#DA5B0B" extensions: @@ -1936,6 +2025,7 @@ KiCad: Kit: type: markup ace_mode: html + codemirror_mode: html extensions: - ".kit" tm_scope: text.html.basic @@ -1949,6 +2039,7 @@ Kotlin: - ".kts" tm_scope: source.Kotlin ace_mode: text + codemirror_mode: kotlin language_id: 189 LFE: type: programming @@ -1958,6 +2049,7 @@ LFE: group: Erlang tm_scope: source.lisp ace_mode: lisp + codemirror_mode: commonlisp language_id: 190 LLVM: type: programming @@ -1990,6 +2082,7 @@ LabVIEW: - ".lvproj" tm_scope: text.xml ace_mode: xml + codemirror_mode: xml language_id: 194 Lasso: type: programming @@ -2013,6 +2106,7 @@ Latte: - ".latte" tm_scope: text.html.smarty ace_mode: smarty + codemirror_mode: smarty language_id: 196 Lean: type: programming @@ -2028,6 +2122,7 @@ Less: - ".less" tm_scope: source.css.less ace_mode: less + codemirror_mode: css color: "#A1D9A1" language_id: 198 Lex: @@ -2111,6 +2206,7 @@ Literate Haskell: - ".lhs" tm_scope: text.tex.latex.haskell ace_mode: text + codemirror_mode: haskell-literate language_id: 207 LiveScript: type: programming @@ -2124,6 +2220,7 @@ LiveScript: filenames: - Slakefile ace_mode: livescript + codemirror_mode: livescript language_id: 208 Logos: type: programming @@ -2144,6 +2241,7 @@ Logtalk: LookML: type: programming ace_mode: yaml + codemirror_mode: yaml color: "#652B81" extensions: - ".lookml" @@ -2159,6 +2257,7 @@ LoomScript: Lua: type: programming ace_mode: lua + codemirror_mode: lua color: "#000080" extensions: - ".lua" @@ -2177,8 +2276,8 @@ M: extensions: - ".mumps" - ".m" - tm_scope: source.lisp - ace_mode: lisp + ace_mode: text + codemirror_mode: mumps language_id: 214 M4: type: programming @@ -2215,6 +2314,7 @@ MTML: - ".mtml" tm_scope: text.html.basic ace_mode: html + codemirror_mode: html language_id: 218 MUF: type: programming @@ -2224,6 +2324,7 @@ MUF: - ".m" tm_scope: none ace_mode: forth + codemirror_mode: forth language_id: 219 Makefile: type: programming @@ -2252,6 +2353,7 @@ Makefile: interpreters: - make ace_mode: makefile + codemirror_mode: cmake language_id: 220 Mako: type: programming @@ -2264,6 +2366,7 @@ Mako: Markdown: type: prose ace_mode: markdown + codemirror_mode: markdown wrap: true extensions: - ".md" @@ -2297,6 +2400,7 @@ Mathematica: aliases: - mma ace_mode: text + codemirror_mode: mathematica language_id: 224 Matlab: type: programming @@ -2307,6 +2411,7 @@ Matlab: - ".matlab" - ".m" ace_mode: matlab + codemirror_mode: octave language_id: 225 Maven POM: type: data @@ -2314,6 +2419,7 @@ Maven POM: filenames: - pom.xml ace_mode: xml + codemirror_mode: xml language_id: 226 Max: type: programming @@ -2330,6 +2436,7 @@ Max: - ".pat" tm_scope: source.json ace_mode: json + codemirror_mode: javascript language_id: 227 MediaWiki: type: prose @@ -2358,6 +2465,7 @@ Metal: - ".metal" tm_scope: source.c++ ace_mode: c_cpp + codemirror_mode: clike language_id: 230 MiniD: type: programming @@ -2378,6 +2486,7 @@ Mirah: - ".mirah" tm_scope: source.ruby ace_mode: ruby + codemirror_mode: ruby language_id: 232 Modelica: type: programming @@ -2385,6 +2494,7 @@ Modelica: - ".mo" tm_scope: source.modelica ace_mode: text + codemirror_mode: modelica language_id: 233 Modula-2: type: programming @@ -2454,6 +2564,7 @@ NSIS: - ".nsi" - ".nsh" ace_mode: text + codemirror_mode: nsis language_id: 242 Nemerle: type: programming @@ -2487,6 +2598,7 @@ NetLogo: - ".nlogo" tm_scope: source.lisp ace_mode: lisp + codemirror_mode: commonlisp language_id: 246 NewLisp: type: programming @@ -2500,6 +2612,7 @@ NewLisp: - newlisp tm_scope: source.lisp ace_mode: lisp + codemirror_mode: commonlisp language_id: 247 Nginx: type: markup @@ -2512,6 +2625,7 @@ Nginx: aliases: - nginx configuration file ace_mode: text + codemirror_mode: nginx color: "#9469E9" language_id: 248 Nimrod: @@ -2559,6 +2673,7 @@ Nu: - Nukefile tm_scope: source.nu ace_mode: scheme + codemirror_mode: scheme interpreters: - nush language_id: 253 @@ -2571,11 +2686,13 @@ NumPy: - ".numsc" tm_scope: none ace_mode: text + codemirror_mode: python color: "#9C8AF9" language_id: 254 OCaml: type: programming ace_mode: ocaml + codemirror_mode: mllike color: "#3be133" extensions: - ".ml" @@ -2597,6 +2714,7 @@ ObjDump: - ".objdump" tm_scope: objdump.x86asm ace_mode: assembly_x86 + codemirror_mode: gas language_id: 256 Objective-C: type: programming @@ -2610,6 +2728,7 @@ Objective-C: - ".m" - ".h" ace_mode: objectivec + codemirror_mode: clike language_id: 257 Objective-C++: type: programming @@ -2622,6 +2741,7 @@ Objective-C++: extensions: - ".mm" ace_mode: objectivec + codemirror_mode: clike language_id: 258 Objective-J: type: programming @@ -2666,6 +2786,7 @@ OpenCL: - ".opencl" tm_scope: source.c ace_mode: c_cpp + codemirror_mode: clike language_id: 263 OpenEdge ABL: type: programming @@ -2688,6 +2809,7 @@ OpenRC runscript: - openrc-run tm_scope: source.shell ace_mode: sh + codemirror_mode: shell language_id: 265 OpenSCAD: type: programming @@ -2728,6 +2850,7 @@ Oz: - ".oz" tm_scope: source.oz ace_mode: text + codemirror_mode: oz language_id: 270 PAWN: type: programming @@ -2742,6 +2865,7 @@ PHP: type: programming tm_scope: text.html.php ace_mode: php + codemirror_mode: php color: "#4F5D95" extensions: - ".php" @@ -2764,6 +2888,7 @@ PHP: PLSQL: type: programming ace_mode: sql + codemirror_mode: sql tm_scope: none color: "#dad8d8" extensions: @@ -2778,6 +2903,7 @@ PLSQL: PLpgSQL: type: programming ace_mode: pgsql + codemirror_mode: sql tm_scope: source.sql extensions: - ".sql" @@ -2854,11 +2980,13 @@ Pascal: interpreters: - instantfpc ace_mode: pascal + codemirror_mode: pascal language_id: 281 Perl: type: programming tm_scope: source.perl ace_mode: perl + codemirror_mode: perl color: "#0298c3" extensions: - ".pl" @@ -2896,6 +3024,7 @@ Perl6: - perl6 tm_scope: source.perl6fe ace_mode: perl + codemirror_mode: perl language_id: 283 Pickle: type: data @@ -2935,6 +3064,7 @@ Pike: Pod: type: prose ace_mode: perl + codemirror_mode: perl wrap: true extensions: - ".pod" @@ -2980,6 +3110,7 @@ PowerBuilder: PowerShell: type: programming ace_mode: powershell + codemirror_mode: powershell aliases: - posh extensions: @@ -3025,6 +3156,7 @@ Protocol Buffer: - ".proto" tm_scope: source.protobuf ace_mode: protobuf + codemirror_mode: protobuf language_id: 297 Public Key: type: data @@ -3042,6 +3174,7 @@ Puppet: filenames: - Modulefile ace_mode: text + codemirror_mode: puppet tm_scope: source.puppet language_id: 299 Pure Data: @@ -3068,10 +3201,12 @@ PureScript: - ".purs" tm_scope: source.purescript ace_mode: haskell + codemirror_mode: haskell language_id: 302 Python: type: programming ace_mode: python + codemirror_mode: python color: "#3572A5" extensions: - ".py" @@ -3146,10 +3281,12 @@ R: interpreters: - Rscript ace_mode: r + codemirror_mode: r language_id: 307 RAML: type: markup ace_mode: yaml + codemirror_mode: yaml tm_scope: source.yaml color: "#77d9fb" extensions: @@ -3195,11 +3332,13 @@ RHTML: aliases: - html+ruby ace_mode: rhtml + codemirror_mode: htmlembedded language_id: 312 RMarkdown: type: prose wrap: true ace_mode: markdown + codemirror_mode: markdown extensions: - ".rmd" tm_scope: source.gfm @@ -3212,6 +3351,7 @@ RPM Spec: aliases: - specfile ace_mode: text + codemirror_mode: rpm language_id: 314 RUNOFF: type: markup @@ -3314,6 +3454,7 @@ RobotFramework: Rouge: type: programming ace_mode: clojure + codemirror_mode: clojure color: "#cc0088" extensions: - ".rg" @@ -3322,6 +3463,7 @@ Rouge: Ruby: type: programming ace_mode: ruby + codemirror_mode: ruby color: "#701516" aliases: - jruby @@ -3383,6 +3525,7 @@ Rust: - ".rs" - ".rs.in" ace_mode: rust + codemirror_mode: rust language_id: 327 SAS: type: programming @@ -3391,12 +3534,14 @@ SAS: - ".sas" tm_scope: source.sas ace_mode: text + codemirror_mode: sas language_id: 328 SCSS: type: markup tm_scope: source.scss group: CSS ace_mode: scss + codemirror_mode: css extensions: - ".scss" color: "#CF649A" @@ -3424,6 +3569,7 @@ SPARQL: type: data tm_scope: source.sparql ace_mode: text + codemirror_mode: sparql extensions: - ".sparql" - ".rq" @@ -3441,6 +3587,7 @@ SQL: type: data tm_scope: source.sql ace_mode: sql + codemirror_mode: sql extensions: - ".sql" - ".cql" @@ -3454,6 +3601,7 @@ SQL: SQLPL: type: programming ace_mode: sql + codemirror_mode: sql tm_scope: source.sql extensions: - ".sql" @@ -3464,6 +3612,7 @@ SRecode Template: color: "#348a34" tm_scope: source.lisp ace_mode: lisp + codemirror_mode: commonlisp extensions: - ".srt" language_id: 335 @@ -3481,6 +3630,7 @@ SVG: - ".svg" tm_scope: text.xml ace_mode: xml + codemirror_mode: xml language_id: 337 Sage: type: programming @@ -3490,6 +3640,7 @@ Sage: - ".sagews" tm_scope: source.python ace_mode: python + codemirror_mode: python language_id: 338 SaltStack: type: programming @@ -3501,6 +3652,7 @@ SaltStack: - ".sls" tm_scope: source.yaml.salt ace_mode: yaml + codemirror_mode: yaml language_id: 339 Sass: type: markup @@ -3509,11 +3661,13 @@ Sass: extensions: - ".sass" ace_mode: sass + codemirror_mode: sass color: "#CF649A" language_id: 340 Scala: type: programming ace_mode: scala + codemirror_mode: clike color: "#c22d40" extensions: - ".scala" @@ -3547,6 +3701,7 @@ Scheme: - gosh - r6rs ace_mode: scheme + codemirror_mode: scheme language_id: 343 Scilab: type: programming @@ -3598,6 +3753,7 @@ Shell: - sh - zsh ace_mode: sh + codemirror_mode: shell language_id: 346 ShellSession: type: programming @@ -3608,6 +3764,7 @@ ShellSession: - console tm_scope: text.shell-session ace_mode: sh + codemirror_mode: shell language_id: 347 Shen: type: programming @@ -3633,6 +3790,7 @@ Slim: - ".slim" tm_scope: text.slim ace_mode: text + codemirror_mode: slim language_id: 350 Smali: type: programming @@ -3650,12 +3808,14 @@ Smalltalk: aliases: - squeak ace_mode: text + codemirror_mode: smalltalk language_id: 352 Smarty: type: programming extensions: - ".tpl" ace_mode: smarty + codemirror_mode: smarty tm_scope: text.html.smarty language_id: 353 SourcePawn: @@ -3677,6 +3837,7 @@ Squirrel: - ".nut" tm_scope: source.c++ ace_mode: c_cpp + codemirror_mode: clike language_id: 355 Stan: type: programming @@ -3698,6 +3859,7 @@ Standard ML: - ".sml" tm_scope: source.ml ace_mode: text + codemirror_mode: mllike language_id: 357 Stata: type: programming @@ -3718,6 +3880,7 @@ Stylus: - ".styl" tm_scope: source.stylus ace_mode: stylus + codemirror_mode: stylus language_id: 359 SubRip Text: type: data @@ -3744,6 +3907,7 @@ Swift: extensions: - ".swift" ace_mode: text + codemirror_mode: swift language_id: 362 SystemVerilog: type: programming @@ -3753,6 +3917,7 @@ SystemVerilog: - ".svh" - ".vh" ace_mode: verilog + codemirror_mode: verilog language_id: 363 TLA: type: programming @@ -3767,6 +3932,7 @@ TOML: - ".toml" tm_scope: source.toml ace_mode: toml + codemirror_mode: toml language_id: 365 TXL: type: programming @@ -3786,6 +3952,7 @@ Tcl: - tclsh - wish ace_mode: tcl + codemirror_mode: tcl language_id: 367 Tcsh: type: programming @@ -3795,11 +3962,13 @@ Tcsh: - ".csh" tm_scope: source.shell ace_mode: sh + codemirror_mode: shell language_id: 368 TeX: type: markup color: "#3D6117" ace_mode: tex + codemirror_mode: stex wrap: true aliases: - latex @@ -3833,6 +4002,7 @@ Terra: - ".t" color: "#00004c" ace_mode: lua + codemirror_mode: lua interpreters: - lua language_id: 371 @@ -3865,6 +4035,7 @@ Text: Textile: type: prose ace_mode: textile + codemirror_mode: textile wrap: true extensions: - ".textile" @@ -3892,6 +4063,7 @@ Turtle: - ".ttl" tm_scope: source.turtle ace_mode: text + codemirror_mode: turtle language_id: 376 Twig: type: markup @@ -3900,6 +4072,7 @@ Twig: - ".twig" tm_scope: text.html.twig ace_mode: twig + codemirror_mode: twig language_id: 377 TypeScript: type: programming @@ -3911,11 +4084,13 @@ TypeScript: - ".tsx" tm_scope: source.ts ace_mode: typescript + codemirror_mode: javascript language_id: 378 Unified Parallel C: type: programming group: C ace_mode: c_cpp + codemirror_mode: clike color: "#4e3617" extensions: - ".upc" @@ -3924,6 +4099,7 @@ Unified Parallel C: Unity3D Asset: type: data ace_mode: yaml + codemirror_mode: yaml extensions: - ".anim" - ".asset" @@ -3938,6 +4114,7 @@ Uno: extensions: - ".uno" ace_mode: csharp + codemirror_mode: clike tm_scope: source.cs language_id: 381 UnrealScript: @@ -3947,6 +4124,7 @@ UnrealScript: - ".uc" tm_scope: source.java ace_mode: java + codemirror_mode: clike language_id: 382 UrWeb: type: programming @@ -3980,6 +4158,7 @@ VHDL: - ".vht" - ".vhw" ace_mode: vhdl + codemirror_mode: vhdl language_id: 385 Vala: type: programming @@ -3996,6 +4175,7 @@ Verilog: - ".v" - ".veo" ace_mode: verilog + codemirror_mode: verilog language_id: 387 VimL: type: programming @@ -4032,6 +4212,7 @@ Visual Basic: - vb.net - vbnet ace_mode: text + codemirror_mode: vb language_id: 389 Volt: type: programming @@ -4040,6 +4221,7 @@ Volt: - ".volt" tm_scope: source.d ace_mode: d + codemirror_mode: d language_id: 390 Vue: type: markup @@ -4048,6 +4230,7 @@ Vue: - ".vue" tm_scope: text.html.vue ace_mode: html + codemirror_mode: vue language_id: 391 Wavefront Material: type: data @@ -4077,6 +4260,7 @@ WebIDL: - ".webidl" tm_scope: source.webidl ace_mode: text + codemirror_mode: webidl language_id: 395 World of Warcraft Addon Data: type: data @@ -4102,10 +4286,12 @@ XC: - ".xc" tm_scope: source.xc ace_mode: c_cpp + codemirror_mode: clike language_id: 398 XML: type: data ace_mode: xml + codemirror_mode: xml aliases: - rss - xsd @@ -4214,6 +4400,7 @@ XPages: - ".xsp.metadata" tm_scope: none ace_mode: xml + codemirror_mode: xml language_id: 400 XProc: type: programming @@ -4222,6 +4409,7 @@ XProc: - ".xproc" tm_scope: text.xml ace_mode: xml + codemirror_mode: xml language_id: 401 XQuery: type: programming @@ -4233,6 +4421,7 @@ XQuery: - ".xqm" - ".xqy" ace_mode: xquery + codemirror_mode: xquery tm_scope: source.xq language_id: 402 XS: @@ -4241,6 +4430,7 @@ XS: - ".xs" tm_scope: source.c ace_mode: c_cpp + codemirror_mode: clike language_id: 403 XSLT: type: programming @@ -4251,6 +4441,7 @@ XSLT: - ".xsl" tm_scope: text.xml.xsl ace_mode: xml + codemirror_mode: xml color: "#EB8CEB" language_id: 404 Xojo: @@ -4287,6 +4478,7 @@ YAML: filenames: - ".clang-format" ace_mode: yaml + codemirror_mode: yaml language_id: 407 YANG: type: data @@ -4343,6 +4535,7 @@ eC: edn: type: data ace_mode: clojure + codemirror_mode: clojure extensions: - ".edn" tm_scope: source.clojure @@ -4390,6 +4583,7 @@ reStructuredText: - ".rest.txt" - ".rst.txt" ace_mode: text + codemirror_mode: rst language_id: 419 wisp: type: programming From 30298a9ef84964dd81446cc24e682e8302ee70cd Mon Sep 17 00:00:00 2001 From: Arfon Smith Date: Wed, 21 Sep 2016 09:27:28 -0700 Subject: [PATCH 10/45] Whitelist troublesome licenses --- test/test_grammars.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test_grammars.rb b/test/test_grammars.rb index 0a7260b8..69ec0627 100644 --- a/test/test_grammars.rb +++ b/test/test_grammars.rb @@ -5,7 +5,9 @@ class TestGrammars < Minitest::Test # List of projects that are allowed without licenses PROJECT_WHITELIST = [ - # Dual MIT and GPL license + "vendor/grammars/factor", + "vendor/grammars/go-tmbundle", + "vendor/grammars/jflex.tmbundle", "vendor/grammars/language-csharp", "vendor/grammars/sublimeassembly" ].freeze From 1d7ba18b158086e645aa6db6715da639b6d671da Mon Sep 17 00:00:00 2001 From: Arfon Smith Date: Wed, 21 Sep 2016 20:12:27 -0700 Subject: [PATCH 11/45] M scope --- lib/linguist/languages.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 541fd71f..468f424a 100755 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -17,7 +17,7 @@ # search_term - Deprecated: Some languages may be indexed under a # different alias. Avoid defining new exceptions. # language_id - Integer used as a language-name-independent indexed field so that we can rename -# languages in Linguist without reindexing all the code on GitHub. Must not be +# languages in Linguist without reindexing all the code on GitHub. Must not be # changed for existing languages without the explicit permission of GitHub staff. # color - CSS hex color to represent the language. # tm_scope - The TextMate scope that represents this programming @@ -2279,6 +2279,7 @@ M: ace_mode: text codemirror_mode: mumps language_id: 214 + tm_scope: none M4: type: programming extensions: From d6d7d38eb8349d4b57b78fef740c8f07d280dbe1 Mon Sep 17 00:00:00 2001 From: Todd Berman Date: Wed, 21 Sep 2016 20:52:49 -0700 Subject: [PATCH 12/45] Fix w/ a test --- lib/linguist/language.rb | 1 + test/test_language.rb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib/linguist/language.rb b/lib/linguist/language.rb index 7f4fd903..85eade29 100644 --- a/lib/linguist/language.rb +++ b/lib/linguist/language.rb @@ -585,6 +585,7 @@ module Linguist :aliases => options['aliases'], :tm_scope => options['tm_scope'], :ace_mode => options['ace_mode'], + :codemirror_mode => options['codemirror_mode'], :wrap => options['wrap'], :group_name => options['group'], :searchable => options.fetch('searchable', true), diff --git a/test/test_language.rb b/test/test_language.rb index 5c5aa02d..fec4e29b 100644 --- a/test/test_language.rb +++ b/test/test_language.rb @@ -349,6 +349,10 @@ class TestLanguage < Minitest::Test assert Language.ace_modes.include?(Language['FORTRAN']) end + def test_codemirror_mode + assert_equal 'clike', Language['C++'].codemirror_mode + end + def test_wrap assert_equal false, Language['C'].wrap assert_equal true, Language['Markdown'].wrap From 8e19aea39e70fb213ee490dfd701af70c950f44d Mon Sep 17 00:00:00 2001 From: Arfon Smith Date: Wed, 21 Sep 2016 20:58:12 -0700 Subject: [PATCH 13/45] Removing stray Sublime-VimL grammar reference --- vendor/grammars/Sublime-VimL | 1 - 1 file changed, 1 deletion(-) delete mode 160000 vendor/grammars/Sublime-VimL diff --git a/vendor/grammars/Sublime-VimL b/vendor/grammars/Sublime-VimL deleted file mode 160000 index b453aff6..00000000 --- a/vendor/grammars/Sublime-VimL +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b453aff6f783769b6b895986da605a2db0db7379 From ecd4ae3bda486a9527f87519e4f2530e12e09786 Mon Sep 17 00:00:00 2001 From: Arfon Smith Date: Wed, 21 Sep 2016 21:04:26 -0700 Subject: [PATCH 14/45] Bumping to v4.8.13 --- lib/linguist/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linguist/version.rb b/lib/linguist/version.rb index 1fbf952c..000a9aae 100644 --- a/lib/linguist/version.rb +++ b/lib/linguist/version.rb @@ -1,3 +1,3 @@ module Linguist - VERSION = "4.8.12" + VERSION = "4.8.13" end From a7a123a8db9e5df923ba63bc9aa2fdc1f7205a96 Mon Sep 17 00:00:00 2001 From: Lars Brinkhoff Date: Wed, 14 Sep 2016 15:48:46 +0200 Subject: [PATCH 15/45] Add heuristic for .inc files: the #declare keyword is unique to POV-Ray. Also added #local, #macro, and #while. --- lib/linguist/heuristics.rb | 2 ++ test/test_heuristics.rb | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/linguist/heuristics.rb b/lib/linguist/heuristics.rb index 1d5196f4..2c99b476 100644 --- a/lib/linguist/heuristics.rb +++ b/lib/linguist/heuristics.rb @@ -202,6 +202,8 @@ module Linguist disambiguate ".inc" do |data| if /^<\?(?:php)?/.match(data) Language["PHP"] + elsif /^\s*#(declare|local|macro|while)\s/.match(data) + Language["POV-Ray SDL"] end end diff --git a/test/test_heuristics.rb b/test/test_heuristics.rb index e37da44b..62e5a050 100644 --- a/test/test_heuristics.rb +++ b/test/test_heuristics.rb @@ -122,9 +122,12 @@ class TestHeuristcs < Minitest::Test }) end + # Candidate languages = ["Assembly", "C++", "HTML", "PAWN", "PHP", + # "POV-Ray SDL", "Pascal", "SQL", "SourcePawn"] def test_inc_by_heuristics assert_heuristics({ - "PHP" => all_fixtures("PHP", "*.inc") + "PHP" => all_fixtures("PHP", "*.inc"), + "POV-Ray SDL" => all_fixtures("POV-Ray SDL", "*.inc") }) end From b4035a38045f7f5484f33e6ca438608a2a558e23 Mon Sep 17 00:00:00 2001 From: Arfon Smith Date: Thu, 22 Sep 2016 20:33:39 -0700 Subject: [PATCH 16/45] Update grammars --- vendor/grammars/Docker.tmbundle | 2 +- vendor/grammars/atom-language-clean | 2 +- vendor/grammars/cython | 2 +- vendor/grammars/d.tmbundle | 2 +- vendor/grammars/elixir-tmbundle | 2 +- vendor/grammars/language-asn1 | 2 +- vendor/grammars/language-blade | 2 +- vendor/grammars/language-coffee-script | 2 +- vendor/grammars/language-csharp | 2 +- vendor/grammars/language-emacs-lisp | 2 +- vendor/grammars/language-haskell | 2 +- vendor/grammars/language-javascript | 2 +- vendor/grammars/language-less | 2 +- vendor/grammars/language-renpy | 2 +- vendor/grammars/language-roff | 2 +- vendor/grammars/language-viml | 2 +- vendor/grammars/make.tmbundle | 2 +- vendor/grammars/mediawiki.tmbundle | 2 +- vendor/grammars/sublime-rust | 2 +- vendor/grammars/vue-syntax-highlight | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/vendor/grammars/Docker.tmbundle b/vendor/grammars/Docker.tmbundle index 2d7d56af..c6230cb6 160000 --- a/vendor/grammars/Docker.tmbundle +++ b/vendor/grammars/Docker.tmbundle @@ -1 +1 @@ -Subproject commit 2d7d56af17fdf425fdebb34019b8cbd71110250a +Subproject commit c6230cb62c44eecea0123b54b86047517af25de1 diff --git a/vendor/grammars/atom-language-clean b/vendor/grammars/atom-language-clean index a9b83780..7dafe70d 160000 --- a/vendor/grammars/atom-language-clean +++ b/vendor/grammars/atom-language-clean @@ -1 +1 @@ -Subproject commit a9b837801d887ea072bdb52b16b5e45fe88365a8 +Subproject commit 7dafe70dddd5bb87aa2d3a3c522bb1561b908bbb diff --git a/vendor/grammars/cython b/vendor/grammars/cython index e9f4d3a1..a816e2c0 160000 --- a/vendor/grammars/cython +++ b/vendor/grammars/cython @@ -1 +1 @@ -Subproject commit e9f4d3a1e44a14df8f245f98591f62df34fbabd8 +Subproject commit a816e2c05d8a6f4bcf937b635c942e63afda2040 diff --git a/vendor/grammars/d.tmbundle b/vendor/grammars/d.tmbundle index 080e5343..039c92d9 160000 --- a/vendor/grammars/d.tmbundle +++ b/vendor/grammars/d.tmbundle @@ -1 +1 @@ -Subproject commit 080e5343d8979d2b9c0502e80ac82d906bb7996f +Subproject commit 039c92d9f2f583f8c51bbeb39094c9e208614001 diff --git a/vendor/grammars/elixir-tmbundle b/vendor/grammars/elixir-tmbundle index 6d0417e8..d632e68d 160000 --- a/vendor/grammars/elixir-tmbundle +++ b/vendor/grammars/elixir-tmbundle @@ -1 +1 @@ -Subproject commit 6d0417e8eb7e182810755214d0a8cd6421146c01 +Subproject commit d632e68d09f179cb9fefdb5cfb16db44f39b216a diff --git a/vendor/grammars/language-asn1 b/vendor/grammars/language-asn1 index d45daeb8..bc3811c7 160000 --- a/vendor/grammars/language-asn1 +++ b/vendor/grammars/language-asn1 @@ -1 +1 @@ -Subproject commit d45daeb849f02a79d67585f629bdc83a06cc52e5 +Subproject commit bc3811c7706476e48f5085660b72b18ad028314f diff --git a/vendor/grammars/language-blade b/vendor/grammars/language-blade index fcbe2c20..a5cdd44e 160000 --- a/vendor/grammars/language-blade +++ b/vendor/grammars/language-blade @@ -1 +1 @@ -Subproject commit fcbe2c202295ba1b3f3d2156b64a82999f51374d +Subproject commit a5cdd44eb03cbbba43e634079dec851f06efcc25 diff --git a/vendor/grammars/language-coffee-script b/vendor/grammars/language-coffee-script index 8f001efe..b4137735 160000 --- a/vendor/grammars/language-coffee-script +++ b/vendor/grammars/language-coffee-script @@ -1 +1 @@ -Subproject commit 8f001efe73422d0f7a0c16121588c34e0bd5fe8c +Subproject commit b4137735740818665b0aa55bef843640aa820ca9 diff --git a/vendor/grammars/language-csharp b/vendor/grammars/language-csharp index c97c4bf7..db446854 160000 --- a/vendor/grammars/language-csharp +++ b/vendor/grammars/language-csharp @@ -1 +1 @@ -Subproject commit c97c4bf74d74502c0b78901b12aab09186dc0eba +Subproject commit db4468545a8a1a5e76518e0ae2f6697dc21bf686 diff --git a/vendor/grammars/language-emacs-lisp b/vendor/grammars/language-emacs-lisp index 76ec86a3..77da7424 160000 --- a/vendor/grammars/language-emacs-lisp +++ b/vendor/grammars/language-emacs-lisp @@ -1 +1 @@ -Subproject commit 76ec86a3eb1bc819a4f19de7295a19602a935c09 +Subproject commit 77da74248435f559fe89724b6bb28d663201a2f0 diff --git a/vendor/grammars/language-haskell b/vendor/grammars/language-haskell index 296a7e94..a53aca38 160000 --- a/vendor/grammars/language-haskell +++ b/vendor/grammars/language-haskell @@ -1 +1 @@ -Subproject commit 296a7e94df6b3c89c5247510b7ba4eb71f14c55f +Subproject commit a53aca3856a1b7729a13e2311628bf323d3b7ff0 diff --git a/vendor/grammars/language-javascript b/vendor/grammars/language-javascript index b3d2bb64..101a00ad 160000 --- a/vendor/grammars/language-javascript +++ b/vendor/grammars/language-javascript @@ -1 +1 @@ -Subproject commit b3d2bb649a2a2b2f1e8bf391bcd50c603ac1e127 +Subproject commit 101a00adb2925e7e397bd6374b4aa04e4d17479d diff --git a/vendor/grammars/language-less b/vendor/grammars/language-less index d4f5db5f..f34bb335 160000 --- a/vendor/grammars/language-less +++ b/vendor/grammars/language-less @@ -1 +1 @@ -Subproject commit d4f5db5fba671244c1f2085752d1ea9ce34f8bad +Subproject commit f34bb335c73c300b465c31f18fb540002395e050 diff --git a/vendor/grammars/language-renpy b/vendor/grammars/language-renpy index a3b9bbed..82a4b913 160000 --- a/vendor/grammars/language-renpy +++ b/vendor/grammars/language-renpy @@ -1 +1 @@ -Subproject commit a3b9bbed668137ab8db5dbafea4d5611957e68ee +Subproject commit 82a4b9130679d6602b9b3908fe938f9c50a04476 diff --git a/vendor/grammars/language-roff b/vendor/grammars/language-roff index f37fb6b7..743e1621 160000 --- a/vendor/grammars/language-roff +++ b/vendor/grammars/language-roff @@ -1 +1 @@ -Subproject commit f37fb6b7c45837de47cdb0bcb9e7a5a257b1ea24 +Subproject commit 743e1621c6a2ff2dd65b36c4a86ed85b97eed930 diff --git a/vendor/grammars/language-viml b/vendor/grammars/language-viml index ccdaff45..5030fb8b 160000 --- a/vendor/grammars/language-viml +++ b/vendor/grammars/language-viml @@ -1 +1 @@ -Subproject commit ccdaff4535b5720e9a89460afcc7b8dc65f46d27 +Subproject commit 5030fb8b0234fc5b03de7f20c9284a2208a5f449 diff --git a/vendor/grammars/make.tmbundle b/vendor/grammars/make.tmbundle index 1a1827da..01069d2b 160000 --- a/vendor/grammars/make.tmbundle +++ b/vendor/grammars/make.tmbundle @@ -1 +1 @@ -Subproject commit 1a1827da81e20fdce56e2658451340c070ca44b7 +Subproject commit 01069d2b38514f5d5d1519737f4be937566e195e diff --git a/vendor/grammars/mediawiki.tmbundle b/vendor/grammars/mediawiki.tmbundle index f8dead50..bdd6eeb5 160000 --- a/vendor/grammars/mediawiki.tmbundle +++ b/vendor/grammars/mediawiki.tmbundle @@ -1 +1 @@ -Subproject commit f8dead507a1aed539376b9fcfde877a855842e8e +Subproject commit bdd6eeb5ee28c6fcc70cb76c7951c7da8f54e642 diff --git a/vendor/grammars/sublime-rust b/vendor/grammars/sublime-rust index d3c63dec..bb8d73c7 160000 --- a/vendor/grammars/sublime-rust +++ b/vendor/grammars/sublime-rust @@ -1 +1 @@ -Subproject commit d3c63dec579be852b1d8006dc58a9a6f2a9e6cdc +Subproject commit bb8d73c7a23fab9e6cce5c6340a51f0089b40a91 diff --git a/vendor/grammars/vue-syntax-highlight b/vendor/grammars/vue-syntax-highlight index 909afa53..f95b61a4 160000 --- a/vendor/grammars/vue-syntax-highlight +++ b/vendor/grammars/vue-syntax-highlight @@ -1 +1 @@ -Subproject commit 909afa5384d6dcd01f7d883fe2b8b6067f970a26 +Subproject commit f95b61a40dbae2d415a5a9fed90d46a59a3df0cb From a1901fceff5780fb7f872743302aab4329556ec8 Mon Sep 17 00:00:00 2001 From: Arfon Smith Date: Thu, 22 Sep 2016 21:03:33 -0700 Subject: [PATCH 17/45] Bump version to v4.8.14 --- lib/linguist/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linguist/version.rb b/lib/linguist/version.rb index 000a9aae..920b08ea 100644 --- a/lib/linguist/version.rb +++ b/lib/linguist/version.rb @@ -1,3 +1,3 @@ module Linguist - VERSION = "4.8.13" + VERSION = "4.8.14" end From 88c74fa9c2016c3af79333be301196458ffd8714 Mon Sep 17 00:00:00 2001 From: Todd Berman Date: Fri, 23 Sep 2016 13:40:19 -0700 Subject: [PATCH 18/45] Convert from mode names to mimetypes for better usage. --- lib/linguist/language.rb | 6 +- lib/linguist/languages.yml | 386 ++++++++++++++++++------------------- test/test_language.rb | 2 +- 3 files changed, 196 insertions(+), 198 deletions(-) diff --git a/lib/linguist/language.rb b/lib/linguist/language.rb index 85eade29..49adbbd8 100644 --- a/lib/linguist/language.rb +++ b/lib/linguist/language.rb @@ -398,13 +398,13 @@ module Linguist # Returns a String name or nil attr_reader :ace_mode - # Public: Get Codemirror mode + # Public: Get Codemirror mode (as expressed by a mimetype) # # Examples # # # => "nil" - # # => "javascript" - # # => "clike" + # # => "text/x-javascript" + # # => "text/x-csrc" # # Returns a String name or nil attr_reader :codemirror_mode diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 4bb5fbef..5762f715 100755 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -59,7 +59,7 @@ AGS Script: - ".ash" tm_scope: source.c++ ace_mode: c_cpp - codemirror_mode: clike + codemirror_mode: text/x-c++src language_id: 2 AMPL: type: programming @@ -97,7 +97,7 @@ APL: - dyalog tm_scope: source.apl ace_mode: text - codemirror_mode: apl + codemirror_mode: text/apl language_id: 6 ASN.1: type: data @@ -107,7 +107,7 @@ ASN.1: - ".asn1" tm_scope: source.asn ace_mode: text - codemirror_mode: asn.1 + codemirror_mode: text/x-ttcn-asn language_id: 7 ASP: type: programming @@ -126,7 +126,7 @@ ASP: - ".aspx" - ".axd" ace_mode: text - codemirror_mode: htmlembedded + codemirror_mode: application/x-aspx language_id: 8 ATS: type: programming @@ -189,7 +189,7 @@ Alpine Abuild: - APKBUILD tm_scope: source.shell ace_mode: sh - codemirror_mode: shell + codemirror_mode: text/x-sh language_id: 14 Ant Build System: type: data @@ -198,7 +198,7 @@ Ant Build System: - ant.xml - build.xml ace_mode: xml - codemirror_mode: xml + codemirror_mode: application/xml language_id: 15 ApacheConf: type: markup @@ -217,7 +217,7 @@ Apex: - ".cls" tm_scope: source.java ace_mode: java - codemirror_mode: clike + codemirror_mode: text/x-java language_id: 17 Apollo Guidance Computer: type: programming @@ -227,7 +227,7 @@ Apollo Guidance Computer: - ".agc" tm_scope: source.agc ace_mode: assembly_x86 - codemirror_mode: gas + codemirror_mode: text/x-gas language_id: 18 AppleScript: type: programming @@ -256,7 +256,7 @@ Arduino: - ".ino" tm_scope: source.c++ ace_mode: c_cpp - codemirror_mode: clike + codemirror_mode: text/x-c++src language_id: 21 AsciiDoc: type: prose @@ -289,7 +289,7 @@ Assembly: - ".nasm" tm_scope: source.assembly ace_mode: assembly_x86 - codemirror_mode: gas + codemirror_mode: text/x-gas language_id: 24 Augeas: type: programming @@ -427,7 +427,7 @@ Brainfuck: - ".bf" tm_scope: source.bf ace_mode: text - codemirror_mode: brainfuck + codemirror_mode: text/x-brainfuck language_id: 38 Brightscript: type: programming @@ -454,12 +454,12 @@ C: interpreters: - tcc ace_mode: c_cpp - codemirror_mode: clike + codemirror_mode: text/x-csrc language_id: 41 C#: type: programming ace_mode: csharp - codemirror_mode: clike + codemirror_mode: text/x-csharp tm_scope: source.cs search_term: csharp color: "#178600" @@ -474,7 +474,7 @@ C#: C++: type: programming ace_mode: c_cpp - codemirror_mode: clike + codemirror_mode: text/x-c++src search_term: cpp color: "#f34b7d" aliases: @@ -502,7 +502,7 @@ C-ObjDump: - ".c-objdump" tm_scope: objdump.x86asm ace_mode: assembly_x86 - codemirror_mode: gas + codemirror_mode: text/x-gas language_id: 44 C2hs Haskell: type: programming @@ -513,7 +513,7 @@ C2hs Haskell: - ".chs" tm_scope: source.haskell ace_mode: haskell - codemirror_mode: haskell + codemirror_mode: text/x-haskell language_id: 45 CLIPS: type: programming @@ -530,7 +530,7 @@ CMake: filenames: - CMakeLists.txt ace_mode: text - codemirror_mode: cmake + codemirror_mode: text/x-cmake language_id: 47 COBOL: type: programming @@ -541,7 +541,7 @@ COBOL: - ".cobol" - ".cpy" ace_mode: cobol - codemirror_mode: cobol + codemirror_mode: text/x-cobol language_id: 48 COLLADA: type: data @@ -549,13 +549,13 @@ COLLADA: - ".dae" tm_scope: text.xml ace_mode: xml - codemirror_mode: xml + codemirror_mode: text/x-xml language_id: 49 CSS: type: markup tm_scope: source.css ace_mode: css - codemirror_mode: css + codemirror_mode: text/css color: "#563d7c" extensions: - ".css" @@ -611,7 +611,7 @@ ChucK: - ".ck" tm_scope: source.java ace_mode: java - codemirror_mode: clike + codemirror_mode: text/x-java language_id: 57 Cirru: type: programming @@ -648,7 +648,7 @@ Click: Clojure: type: programming ace_mode: clojure - codemirror_mode: clojure + codemirror_mode: text/x-clojure color: "#db5855" extensions: - ".clj" @@ -667,7 +667,7 @@ CoffeeScript: type: programming tm_scope: source.coffee ace_mode: coffee - codemirror_mode: coffeescript + codemirror_mode: text/x-coffeescript color: "#244776" aliases: - coffee @@ -733,7 +733,7 @@ Common Lisp: - clisp - ecl ace_mode: lisp - codemirror_mode: commonlisp + codemirror_mode: text/x-common-lisp language_id: 66 Component Pascal: type: programming @@ -746,7 +746,7 @@ Component Pascal: - delphi - objectpascal ace_mode: pascal - codemirror_mode: pascal + codemirror_mode: text/x-pascal language_id: 67 Cool: type: programming @@ -774,7 +774,7 @@ Cpp-ObjDump: aliases: - c++-objdump ace_mode: assembly_x86 - codemirror_mode: gas + codemirror_mode: text/x-gas language_id: 70 Creole: type: prose @@ -790,7 +790,7 @@ Crystal: extensions: - ".cr" ace_mode: ruby - codemirror_mode: crystal + codemirror_mode: text/x-crystal tm_scope: source.crystal interpreters: - crystal @@ -840,7 +840,7 @@ Cuda: - ".cuh" tm_scope: source.cuda-c++ ace_mode: c_cpp - codemirror_mode: clike + codemirror_mode: text/x-c++src color: "#3A4E3A" language_id: 77 Cycript: @@ -849,7 +849,7 @@ Cycript: - ".cy" tm_scope: source.js ace_mode: javascript - codemirror_mode: javascript + codemirror_mode: text/javascript language_id: 78 Cython: type: programming @@ -861,7 +861,7 @@ Cython: aliases: - pyrex ace_mode: text - codemirror_mode: python + codemirror_mode: text/x-cython language_id: 79 D: type: programming @@ -870,7 +870,7 @@ D: - ".d" - ".di" ace_mode: d - codemirror_mode: d + codemirror_mode: text/x-d language_id: 80 D-ObjDump: type: data @@ -878,7 +878,7 @@ D-ObjDump: - ".d-objdump" tm_scope: objdump.x86asm ace_mode: assembly_x86 - codemirror_mode: gas + codemirror_mode: text/x-gas language_id: 81 DIGITAL Command Language: type: programming @@ -917,7 +917,7 @@ DTrace: - dtrace tm_scope: source.c ace_mode: c_cpp - codemirror_mode: clike + codemirror_mode: text/x-csrc language_id: 85 Darcs Patch: type: data @@ -938,7 +938,7 @@ Dart: interpreters: - dart ace_mode: dart - codemirror_mode: dart + codemirror_mode: text/x-dart language_id: 87 Diff: type: data @@ -949,7 +949,7 @@ Diff: - udiff tm_scope: source.diff ace_mode: diff - codemirror_mode: diff + codemirror_mode: text/x-diff language_id: 88 Dockerfile: type: data @@ -959,7 +959,7 @@ Dockerfile: filenames: - Dockerfile ace_mode: dockerfile - codemirror_mode: dockerfile + codemirror_mode: text/x-dockerfile language_id: 89 Dogescript: type: programming @@ -978,7 +978,7 @@ Dylan: - ".intr" - ".lid" ace_mode: text - codemirror_mode: dylan + codemirror_mode: text/x-dylan language_id: 91 E: type: programming @@ -998,7 +998,7 @@ ECL: - ".eclxml" tm_scope: none ace_mode: text - codemirror_mode: ecl + codemirror_mode: text/x-ecl language_id: 93 ECLiPSe: type: programming @@ -1024,7 +1024,7 @@ EQ: - ".eq" tm_scope: source.cs ace_mode: csharp - codemirror_mode: clike + codemirror_mode: text/x-csharp language_id: 96 Eagle: type: markup @@ -1034,7 +1034,7 @@ Eagle: - ".brd" tm_scope: text.xml ace_mode: xml - codemirror_mode: xml + codemirror_mode: text/xml language_id: 97 Ecere Projects: type: data @@ -1043,7 +1043,7 @@ Ecere Projects: - ".epj" tm_scope: source.json ace_mode: json - codemirror_mode: json + codemirror_mode: application/json language_id: 98 Eiffel: type: programming @@ -1051,7 +1051,7 @@ Eiffel: extensions: - ".e" ace_mode: eiffel - codemirror_mode: eiffel + codemirror_mode: text/x-eiffel language_id: 99 Elixir: type: programming @@ -1072,7 +1072,7 @@ Elm: - ".elm" tm_scope: source.elm ace_mode: elm - codemirror_mode: elm + codemirror_mode: text/x-elm language_id: 101 Emacs Lisp: type: programming @@ -1096,7 +1096,7 @@ Emacs Lisp: - ".emacs" - ".emacs.desktop" ace_mode: lisp - codemirror_mode: commonlisp + codemirror_mode: text/x-common-lisp language_id: 102 EmberScript: type: programming @@ -1106,7 +1106,7 @@ EmberScript: - ".emberscript" tm_scope: source.coffee ace_mode: coffee - codemirror_mode: coffeescript + codemirror_mode: text/x-coffeescript language_id: 103 Erlang: type: programming @@ -1124,7 +1124,7 @@ Erlang: - rebar.config.lock - rebar.lock ace_mode: erlang - codemirror_mode: erlang + codemirror_mode: text/x-erlang interpreters: - escript language_id: 104 @@ -1140,7 +1140,7 @@ F#: - ".fsx" tm_scope: source.fsharp ace_mode: text - codemirror_mode: mllike + codemirror_mode: text/x-fsharp language_id: 105 FLUX: type: programming @@ -1165,7 +1165,7 @@ FORTRAN: - ".fpp" tm_scope: source.fortran.modern ace_mode: text - codemirror_mode: fortran + codemirror_mode: text/x-fortran language_id: 107 Factor: type: programming @@ -1176,7 +1176,7 @@ Factor: - ".factor-boot-rc" - ".factor-rc" ace_mode: text - codemirror_mode: factor + codemirror_mode: text/x-factor language_id: 108 Fancy: type: programming @@ -1232,7 +1232,7 @@ Forth: - ".frt" - ".fs" ace_mode: forth - codemirror_mode: forth + codemirror_mode: text/x-forth language_id: 114 FreeMarker: type: programming @@ -1287,7 +1287,7 @@ GAS: - ".ms" tm_scope: source.assembly ace_mode: assembly_x86 - codemirror_mode: gas + codemirror_mode: text/x-gas language_id: 120 GCC Machine Description: type: programming @@ -1295,7 +1295,7 @@ GCC Machine Description: - ".md" tm_scope: source.lisp ace_mode: lisp - codemirror_mode: commonlisp + codemirror_mode: text/x-common-lisp language_id: 121 GDB: type: programming @@ -1340,7 +1340,7 @@ Game Maker Language: - ".gml" tm_scope: source.c++ ace_mode: c_cpp - codemirror_mode: clike + codemirror_mode: text/x-c++src language_id: 125 Genshi: type: programming @@ -1351,7 +1351,7 @@ Genshi: - xml+genshi - xml+kid ace_mode: xml - codemirror_mode: xml + codemirror_mode: text/xml language_id: 126 Gentoo Ebuild: type: programming @@ -1360,7 +1360,7 @@ Gentoo Ebuild: - ".ebuild" tm_scope: source.shell ace_mode: sh - codemirror_mode: shell + codemirror_mode: text/x-sh language_id: 127 Gentoo Eclass: type: programming @@ -1369,7 +1369,7 @@ Gentoo Eclass: - ".eclass" tm_scope: source.shell ace_mode: sh - codemirror_mode: shell + codemirror_mode: text/x-sh language_id: 128 Gettext Catalog: type: prose @@ -1390,7 +1390,7 @@ Glyph: - ".glf" tm_scope: source.tcl ace_mode: tcl - codemirror_mode: tcl + codemirror_mode: text/x-tcl language_id: 130 Gnuplot: type: programming @@ -1411,7 +1411,7 @@ Go: extensions: - ".go" ace_mode: golang - codemirror_mode: go + codemirror_mode: text/x-go language_id: 132 Golo: type: programming @@ -1457,7 +1457,7 @@ Grammatical Framework: color: "#79aa7a" tm_scope: source.haskell ace_mode: haskell - codemirror_mode: haskell + codemirror_mode: text/x-haskell language_id: 137 Graph Modeling Language: type: data @@ -1517,12 +1517,12 @@ Groff: - nroff - troff ace_mode: text - codemirror_mode: troff + codemirror_mode: text/troff language_id: 141 Groovy: type: programming ace_mode: groovy - codemirror_mode: groovy + codemirror_mode: text/x-groovy color: "#e69f56" extensions: - ".groovy" @@ -1544,7 +1544,7 @@ Groovy Server Pages: - ".gsp" tm_scope: text.html.jsp ace_mode: jsp - codemirror_mode: htmlembedded + codemirror_mode: application/x-jsp language_id: 143 HCL: type: programming @@ -1552,7 +1552,7 @@ HCL: - ".hcl" - ".tf" ace_mode: ruby - codemirror_mode: ruby + codemirror_mode: text/x-ruby tm_scope: source.ruby language_id: 144 HLSL: @@ -1569,7 +1569,7 @@ HTML: type: markup tm_scope: text.html.basic ace_mode: html - codemirror_mode: html + codemirror_mode: text/html color: "#e44b23" aliases: - xhtml @@ -1595,7 +1595,7 @@ HTML+Django: - html+jinja - htmldjango ace_mode: django - codemirror_mode: django + codemirror_mode: text/x-django language_id: 147 HTML+ECR: type: markup @@ -1606,7 +1606,7 @@ HTML+ECR: extensions: - ".ecr" ace_mode: text - codemirror_mode: htmlembedded + codemirror_mode: text/html language_id: 148 HTML+EEX: type: markup @@ -1617,7 +1617,7 @@ HTML+EEX: extensions: - ".eex" ace_mode: text - codemirror_mode: htmlembedded + codemirror_mode: text/html language_id: 149 HTML+ERB: type: markup @@ -1629,7 +1629,7 @@ HTML+ERB: - ".erb" - ".erb.deface" ace_mode: text - codemirror_mode: htmlembedded + codemirror_mode: application/x-erb language_id: 150 HTML+PHP: type: markup @@ -1638,7 +1638,7 @@ HTML+PHP: extensions: - ".phtml" ace_mode: php - codemirror_mode: php + codemirror_mode: application/x-httpd-php language_id: 151 HTTP: type: data @@ -1646,12 +1646,12 @@ HTTP: - ".http" tm_scope: source.httpspec ace_mode: text - codemirror_mode: http + codemirror_mode: message/http language_id: 152 Hack: type: programming ace_mode: php - codemirror_mode: php + codemirror_mode: application/x-httpd-php extensions: - ".hh" - ".php" @@ -1665,7 +1665,7 @@ Haml: - ".haml" - ".haml.deface" ace_mode: haml - codemirror_mode: haml + codemirror_mode: text/x-haml color: "#ECE2A9" language_id: 154 Handlebars: @@ -1680,7 +1680,6 @@ Handlebars: - ".hbs" tm_scope: text.html.handlebars ace_mode: handlebars - codemirror_mode: handlebars language_id: 155 Harbour: type: programming @@ -1699,12 +1698,12 @@ Haskell: interpreters: - runhaskell ace_mode: haskell - codemirror_mode: haskell + codemirror_mode: text/x-haskell language_id: 157 Haxe: type: programming ace_mode: haxe - codemirror_mode: haxe + codemirror_mode: text/x-haxe color: "#df7900" extensions: - ".hx" @@ -1735,7 +1734,7 @@ IDL: - ".pro" - ".dlm" ace_mode: text - codemirror_mode: idl + codemirror_mode: text/x-idl language_id: 161 IGOR Pro: type: programming @@ -1759,7 +1758,7 @@ INI: aliases: - dosini ace_mode: ini - codemirror_mode: properties + codemirror_mode: text/x-properties language_id: 163 IRC log: type: data @@ -1859,7 +1858,7 @@ JSON: tm_scope: source.json group: JavaScript ace_mode: json - codemirror_mode: javascript + codemirror_mode: application/json searchable: false extensions: - ".json" @@ -1878,13 +1877,13 @@ JSON5: - ".json5" tm_scope: source.js ace_mode: javascript - codemirror_mode: javascript + codemirror_mode: application/json language_id: 175 JSONLD: type: data group: JavaScript ace_mode: javascript - codemirror_mode: javascript + codemirror_mode: application/ld+json extensions: - ".jsonld" tm_scope: source.js @@ -1893,7 +1892,7 @@ JSONiq: color: "#40d47e" type: programming ace_mode: jsoniq - codemirror_mode: javascript + codemirror_mode: application/json extensions: - ".jq" tm_scope: source.jq @@ -1904,7 +1903,7 @@ JSX: extensions: - ".jsx" tm_scope: source.js.jsx - ace_mode: javascript + ace_mode: text/jsx language_id: 178 Jade: group: HTML @@ -1914,7 +1913,7 @@ Jade: - ".pug" tm_scope: text.jade ace_mode: jade - codemirror_mode: pug + codemirror_mode: text/x-pug language_id: 179 Jasmin: type: programming @@ -1926,7 +1925,7 @@ Jasmin: Java: type: programming ace_mode: java - codemirror_mode: clike + codemirror_mode: text/x-java color: "#b07219" extensions: - ".java" @@ -1941,13 +1940,13 @@ Java Server Pages: - ".jsp" tm_scope: text.html.jsp ace_mode: jsp - codemirror_mode: htmlembedded + codemirror_mode: application/x-jsp language_id: 182 JavaScript: type: programming tm_scope: source.js ace_mode: javascript - codemirror_mode: javascript + codemirror_mode: text/javascript color: "#f1e05a" aliases: - js @@ -1996,12 +1995,12 @@ Julia: - ".jl" color: "#a270ba" ace_mode: julia - codemirror_mode: julia + codemirror_mode: text/x-julia language_id: 184 Jupyter Notebook: type: markup ace_mode: json - codemirror_mode: javascript + codemirror_mode: application/json tm_scope: source.json color: "#DA5B0B" extensions: @@ -2031,7 +2030,7 @@ KiCad: Kit: type: markup ace_mode: html - codemirror_mode: html + codemirror_mode: text/html extensions: - ".kit" tm_scope: text.html.basic @@ -2045,7 +2044,7 @@ Kotlin: - ".kts" tm_scope: source.Kotlin ace_mode: text - codemirror_mode: kotlin + codemirror_mode: text/x-kotlin language_id: 189 LFE: type: programming @@ -2055,7 +2054,7 @@ LFE: group: Erlang tm_scope: source.lisp ace_mode: lisp - codemirror_mode: commonlisp + codemirror_mode: text/x-common-lisp language_id: 190 LLVM: type: programming @@ -2088,7 +2087,7 @@ LabVIEW: - ".lvproj" tm_scope: text.xml ace_mode: xml - codemirror_mode: xml + codemirror_mode: text/xml language_id: 194 Lasso: type: programming @@ -2112,7 +2111,7 @@ Latte: - ".latte" tm_scope: text.html.smarty ace_mode: smarty - codemirror_mode: smarty + codemirror_mode: text/x-smarty language_id: 196 Lean: type: programming @@ -2128,7 +2127,7 @@ Less: - ".less" tm_scope: source.css.less ace_mode: less - codemirror_mode: css + codemirror_mode: text/css color: "#A1D9A1" language_id: 198 Lex: @@ -2212,7 +2211,7 @@ Literate Haskell: - ".lhs" tm_scope: text.tex.latex.haskell ace_mode: text - codemirror_mode: haskell-literate + codemirror_mode: text/x-literate-haskell language_id: 207 LiveScript: type: programming @@ -2226,7 +2225,7 @@ LiveScript: filenames: - Slakefile ace_mode: livescript - codemirror_mode: livescript + codemirror_mode: text/x-livescript language_id: 208 Logos: type: programming @@ -2247,7 +2246,7 @@ Logtalk: LookML: type: programming ace_mode: yaml - codemirror_mode: yaml + codemirror_mode: text/x-yaml color: "#652B81" extensions: - ".lookml" @@ -2263,7 +2262,7 @@ LoomScript: Lua: type: programming ace_mode: lua - codemirror_mode: lua + codemirror_mode: text/x-lua color: "#000080" extensions: - ".lua" @@ -2283,7 +2282,7 @@ M: - ".mumps" - ".m" ace_mode: text - codemirror_mode: mumps + codemirror_mode: text/x-mumps language_id: 214 tm_scope: none M4: @@ -2321,7 +2320,7 @@ MTML: - ".mtml" tm_scope: text.html.basic ace_mode: html - codemirror_mode: html + codemirror_mode: text/html language_id: 218 MUF: type: programming @@ -2331,7 +2330,7 @@ MUF: - ".m" tm_scope: none ace_mode: forth - codemirror_mode: forth + codemirror_mode: text/x-forth language_id: 219 Makefile: type: programming @@ -2360,7 +2359,7 @@ Makefile: interpreters: - make ace_mode: makefile - codemirror_mode: cmake + codemirror_mode: text/x-cmake language_id: 220 Mako: type: programming @@ -2373,7 +2372,7 @@ Mako: Markdown: type: prose ace_mode: markdown - codemirror_mode: markdown + codemirror_mode: text/x-gfm wrap: true extensions: - ".md" @@ -2407,7 +2406,7 @@ Mathematica: aliases: - mma ace_mode: text - codemirror_mode: mathematica + codemirror_mode: text/x-mathematica language_id: 224 Matlab: type: programming @@ -2418,7 +2417,7 @@ Matlab: - ".matlab" - ".m" ace_mode: matlab - codemirror_mode: octave + codemirror_mode: text/x-octave language_id: 225 Maven POM: type: data @@ -2426,7 +2425,7 @@ Maven POM: filenames: - pom.xml ace_mode: xml - codemirror_mode: xml + codemirror_mode: text/xml language_id: 226 Max: type: programming @@ -2443,7 +2442,7 @@ Max: - ".pat" tm_scope: source.json ace_mode: json - codemirror_mode: javascript + codemirror_mode: application/json language_id: 227 MediaWiki: type: prose @@ -2472,7 +2471,7 @@ Metal: - ".metal" tm_scope: source.c++ ace_mode: c_cpp - codemirror_mode: clike + codemirror_mode: text/x-c++src language_id: 230 MiniD: type: programming @@ -2493,7 +2492,7 @@ Mirah: - ".mirah" tm_scope: source.ruby ace_mode: ruby - codemirror_mode: ruby + codemirror_mode: text/x-ruby language_id: 232 Modelica: type: programming @@ -2501,7 +2500,7 @@ Modelica: - ".mo" tm_scope: source.modelica ace_mode: text - codemirror_mode: modelica + codemirror_mode: text/x-modelica language_id: 233 Modula-2: type: programming @@ -2571,7 +2570,7 @@ NSIS: - ".nsi" - ".nsh" ace_mode: text - codemirror_mode: nsis + codemirror_mode: text/x-nsis language_id: 242 Nemerle: type: programming @@ -2605,7 +2604,7 @@ NetLogo: - ".nlogo" tm_scope: source.lisp ace_mode: lisp - codemirror_mode: commonlisp + codemirror_mode: text/x-common-lisp language_id: 246 NewLisp: type: programming @@ -2619,7 +2618,7 @@ NewLisp: - newlisp tm_scope: source.lisp ace_mode: lisp - codemirror_mode: commonlisp + codemirror_mode: text/x-common-lisp language_id: 247 Nginx: type: markup @@ -2632,7 +2631,7 @@ Nginx: aliases: - nginx configuration file ace_mode: text - codemirror_mode: nginx + codemirror_mode: text/x-nginx-conf color: "#9469E9" language_id: 248 Nimrod: @@ -2680,7 +2679,7 @@ Nu: - Nukefile tm_scope: source.nu ace_mode: scheme - codemirror_mode: scheme + codemirror_mode: text/x-scheme interpreters: - nush language_id: 253 @@ -2693,13 +2692,13 @@ NumPy: - ".numsc" tm_scope: none ace_mode: text - codemirror_mode: python + codemirror_mode: text/x-python color: "#9C8AF9" language_id: 254 OCaml: type: programming ace_mode: ocaml - codemirror_mode: mllike + codemirror_mode: text/x-ocaml color: "#3be133" extensions: - ".ml" @@ -2721,7 +2720,7 @@ ObjDump: - ".objdump" tm_scope: objdump.x86asm ace_mode: assembly_x86 - codemirror_mode: gas + codemirror_mode: text/x-gas language_id: 256 Objective-C: type: programming @@ -2735,7 +2734,7 @@ Objective-C: - ".m" - ".h" ace_mode: objectivec - codemirror_mode: clike + codemirror_mode: text/x-objectivec language_id: 257 Objective-C++: type: programming @@ -2748,7 +2747,7 @@ Objective-C++: extensions: - ".mm" ace_mode: objectivec - codemirror_mode: clike + codemirror_mode: text/x-objectivec language_id: 258 Objective-J: type: programming @@ -2793,7 +2792,7 @@ OpenCL: - ".opencl" tm_scope: source.c ace_mode: c_cpp - codemirror_mode: clike + codemirror_mode: text/x-csrc language_id: 263 OpenEdge ABL: type: programming @@ -2816,7 +2815,7 @@ OpenRC runscript: - openrc-run tm_scope: source.shell ace_mode: sh - codemirror_mode: shell + codemirror_mode: text/x-sh language_id: 265 OpenSCAD: type: programming @@ -2857,7 +2856,7 @@ Oz: - ".oz" tm_scope: source.oz ace_mode: text - codemirror_mode: oz + codemirror_mode: text/x-oz language_id: 270 PAWN: type: programming @@ -2872,7 +2871,7 @@ PHP: type: programming tm_scope: text.html.php ace_mode: php - codemirror_mode: php + codemirror_mode: application/x-httpd-php color: "#4F5D95" extensions: - ".php" @@ -2895,7 +2894,7 @@ PHP: PLSQL: type: programming ace_mode: sql - codemirror_mode: sql + codemirror_mode: text/x-plsql tm_scope: none color: "#dad8d8" extensions: @@ -2910,7 +2909,7 @@ PLSQL: PLpgSQL: type: programming ace_mode: pgsql - codemirror_mode: sql + codemirror_mode: text/x-sql tm_scope: source.sql extensions: - ".sql" @@ -2987,13 +2986,13 @@ Pascal: interpreters: - instantfpc ace_mode: pascal - codemirror_mode: pascal + codemirror_mode: text/x-pascal language_id: 281 Perl: type: programming tm_scope: source.perl ace_mode: perl - codemirror_mode: perl + codemirror_mode: text/x-perl color: "#0298c3" extensions: - ".pl" @@ -3031,7 +3030,7 @@ Perl6: - perl6 tm_scope: source.perl6fe ace_mode: perl - codemirror_mode: perl + codemirror_mode: text/x-perl language_id: 283 Pickle: type: data @@ -3071,7 +3070,7 @@ Pike: Pod: type: prose ace_mode: perl - codemirror_mode: perl + codemirror_mode: text/x-perl wrap: true extensions: - ".pod" @@ -3117,7 +3116,7 @@ PowerBuilder: PowerShell: type: programming ace_mode: powershell - codemirror_mode: powershell + codemirror_mode: text/x-powershell aliases: - posh extensions: @@ -3163,7 +3162,7 @@ Protocol Buffer: - ".proto" tm_scope: source.protobuf ace_mode: protobuf - codemirror_mode: protobuf + codemirror_mode: text/x-protobuf language_id: 297 Public Key: type: data @@ -3181,7 +3180,7 @@ Puppet: filenames: - Modulefile ace_mode: text - codemirror_mode: puppet + codemirror_mode: text/x-puppet tm_scope: source.puppet language_id: 299 Pure Data: @@ -3208,12 +3207,12 @@ PureScript: - ".purs" tm_scope: source.purescript ace_mode: haskell - codemirror_mode: haskell + codemirror_mode: text/x-haskell language_id: 302 Python: type: programming ace_mode: python - codemirror_mode: python + codemirror_mode: text/x-python color: "#3572A5" extensions: - ".py" @@ -3288,12 +3287,12 @@ R: interpreters: - Rscript ace_mode: r - codemirror_mode: r + codemirror_mode: text/x-rsrc language_id: 307 RAML: type: markup ace_mode: yaml - codemirror_mode: yaml + codemirror_mode: text/x-yaml tm_scope: source.yaml color: "#77d9fb" extensions: @@ -3339,13 +3338,13 @@ RHTML: aliases: - html+ruby ace_mode: rhtml - codemirror_mode: htmlembedded + codemirror_mode: application/x-erb language_id: 312 RMarkdown: type: prose wrap: true ace_mode: markdown - codemirror_mode: markdown + codemirror_mode: text/x-gfm extensions: - ".rmd" tm_scope: source.gfm @@ -3358,7 +3357,7 @@ RPM Spec: aliases: - specfile ace_mode: text - codemirror_mode: rpm + codemirror_mode: text/x-rpm-spec language_id: 314 RUNOFF: type: markup @@ -3461,7 +3460,7 @@ RobotFramework: Rouge: type: programming ace_mode: clojure - codemirror_mode: clojure + codemirror_mode: text/x-clojure color: "#cc0088" extensions: - ".rg" @@ -3470,7 +3469,7 @@ Rouge: Ruby: type: programming ace_mode: ruby - codemirror_mode: ruby + codemirror_mode: text/x-ruby color: "#701516" aliases: - jruby @@ -3532,7 +3531,7 @@ Rust: - ".rs" - ".rs.in" ace_mode: rust - codemirror_mode: rust + codemirror_mode: text/x-rustsrc language_id: 327 SAS: type: programming @@ -3541,14 +3540,14 @@ SAS: - ".sas" tm_scope: source.sas ace_mode: text - codemirror_mode: sas + codemirror_mode: text/x-sas language_id: 328 SCSS: type: markup tm_scope: source.scss group: CSS ace_mode: scss - codemirror_mode: css + codemirror_mode: text/x-scss extensions: - ".scss" color: "#CF649A" @@ -3576,7 +3575,7 @@ SPARQL: type: data tm_scope: source.sparql ace_mode: text - codemirror_mode: sparql + codemirror_mode: application/sparql-query extensions: - ".sparql" - ".rq" @@ -3594,7 +3593,7 @@ SQL: type: data tm_scope: source.sql ace_mode: sql - codemirror_mode: sql + codemirror_mode: text/x-sql extensions: - ".sql" - ".cql" @@ -3608,7 +3607,7 @@ SQL: SQLPL: type: programming ace_mode: sql - codemirror_mode: sql + codemirror_mode: text/x-sql tm_scope: source.sql extensions: - ".sql" @@ -3619,7 +3618,7 @@ SRecode Template: color: "#348a34" tm_scope: source.lisp ace_mode: lisp - codemirror_mode: commonlisp + codemirror_mode: text/x-common-lisp extensions: - ".srt" language_id: 335 @@ -3637,7 +3636,7 @@ SVG: - ".svg" tm_scope: text.xml ace_mode: xml - codemirror_mode: xml + codemirror_mode: text/xml language_id: 337 Sage: type: programming @@ -3647,7 +3646,7 @@ Sage: - ".sagews" tm_scope: source.python ace_mode: python - codemirror_mode: python + codemirror_mode: text/x-python language_id: 338 SaltStack: type: programming @@ -3659,7 +3658,7 @@ SaltStack: - ".sls" tm_scope: source.yaml.salt ace_mode: yaml - codemirror_mode: yaml + codemirror_mode: text/x-yaml language_id: 339 Sass: type: markup @@ -3668,13 +3667,13 @@ Sass: extensions: - ".sass" ace_mode: sass - codemirror_mode: sass + codemirror_mode: text/x-sass color: "#CF649A" language_id: 340 Scala: type: programming ace_mode: scala - codemirror_mode: clike + codemirror_mode: text/x-scala color: "#c22d40" extensions: - ".scala" @@ -3708,7 +3707,7 @@ Scheme: - gosh - r6rs ace_mode: scheme - codemirror_mode: scheme + codemirror_mode: text/x-scheme language_id: 343 Scilab: type: programming @@ -3760,7 +3759,7 @@ Shell: - sh - zsh ace_mode: sh - codemirror_mode: shell + codemirror_mode: text/x-sh language_id: 346 ShellSession: type: programming @@ -3771,7 +3770,7 @@ ShellSession: - console tm_scope: text.shell-session ace_mode: sh - codemirror_mode: shell + codemirror_mode: text/x-sh language_id: 347 Shen: type: programming @@ -3797,7 +3796,7 @@ Slim: - ".slim" tm_scope: text.slim ace_mode: text - codemirror_mode: slim + codemirror_mode: text/x-slim language_id: 350 Smali: type: programming @@ -3815,14 +3814,14 @@ Smalltalk: aliases: - squeak ace_mode: text - codemirror_mode: smalltalk + codemirror_mode: text/x-stsrc language_id: 352 Smarty: type: programming extensions: - ".tpl" ace_mode: smarty - codemirror_mode: smarty + codemirror_mode: text/x-smarty tm_scope: text.html.smarty language_id: 353 SourcePawn: @@ -3844,7 +3843,7 @@ Squirrel: - ".nut" tm_scope: source.c++ ace_mode: c_cpp - codemirror_mode: clike + codemirror_mode: text/x-c++src language_id: 355 Stan: type: programming @@ -3866,7 +3865,7 @@ Standard ML: - ".sml" tm_scope: source.ml ace_mode: text - codemirror_mode: mllike + codemirror_mode: text/x-ocaml language_id: 357 Stata: type: programming @@ -3887,7 +3886,6 @@ Stylus: - ".styl" tm_scope: source.stylus ace_mode: stylus - codemirror_mode: stylus language_id: 359 SubRip Text: type: data @@ -3914,7 +3912,7 @@ Swift: extensions: - ".swift" ace_mode: text - codemirror_mode: swift + codemirror_mode: text/x-swift language_id: 362 SystemVerilog: type: programming @@ -3924,7 +3922,7 @@ SystemVerilog: - ".svh" - ".vh" ace_mode: verilog - codemirror_mode: verilog + codemirror_mode: text/x-systemverilog language_id: 363 TLA: type: programming @@ -3939,7 +3937,7 @@ TOML: - ".toml" tm_scope: source.toml ace_mode: toml - codemirror_mode: toml + codemirror_mode: text/x-toml language_id: 365 TXL: type: programming @@ -3959,7 +3957,7 @@ Tcl: - tclsh - wish ace_mode: tcl - codemirror_mode: tcl + codemirror_mode: text/x-tcl language_id: 367 Tcsh: type: programming @@ -3969,13 +3967,13 @@ Tcsh: - ".csh" tm_scope: source.shell ace_mode: sh - codemirror_mode: shell + codemirror_mode: text/x-sh language_id: 368 TeX: type: markup color: "#3D6117" ace_mode: tex - codemirror_mode: stex + codemirror_mode: text/x-stex wrap: true aliases: - latex @@ -4009,7 +4007,7 @@ Terra: - ".t" color: "#00004c" ace_mode: lua - codemirror_mode: lua + codemirror_mode: text/x-lua interpreters: - lua language_id: 371 @@ -4042,7 +4040,7 @@ Text: Textile: type: prose ace_mode: textile - codemirror_mode: textile + codemirror_mode: text/x-textile wrap: true extensions: - ".textile" @@ -4070,7 +4068,7 @@ Turtle: - ".ttl" tm_scope: source.turtle ace_mode: text - codemirror_mode: turtle + codemirror_mode: text/turtle language_id: 376 Twig: type: markup @@ -4079,7 +4077,7 @@ Twig: - ".twig" tm_scope: text.html.twig ace_mode: twig - codemirror_mode: twig + codemirror_mode: text/x-twig language_id: 377 TypeScript: type: programming @@ -4091,13 +4089,13 @@ TypeScript: - ".tsx" tm_scope: source.ts ace_mode: typescript - codemirror_mode: javascript + codemirror_mode: text/x-typescript language_id: 378 Unified Parallel C: type: programming group: C ace_mode: c_cpp - codemirror_mode: clike + codemirror_mode: text/x-csrc color: "#4e3617" extensions: - ".upc" @@ -4106,7 +4104,7 @@ Unified Parallel C: Unity3D Asset: type: data ace_mode: yaml - codemirror_mode: yaml + codemirror_mode: text/x-yaml extensions: - ".anim" - ".asset" @@ -4121,7 +4119,7 @@ Uno: extensions: - ".uno" ace_mode: csharp - codemirror_mode: clike + codemirror_mode: text/x-csharp tm_scope: source.cs language_id: 381 UnrealScript: @@ -4131,7 +4129,7 @@ UnrealScript: - ".uc" tm_scope: source.java ace_mode: java - codemirror_mode: clike + codemirror_mode: text/x-java language_id: 382 UrWeb: type: programming @@ -4165,7 +4163,7 @@ VHDL: - ".vht" - ".vhw" ace_mode: vhdl - codemirror_mode: vhdl + codemirror_mode: text/x-vhdl language_id: 385 Vala: type: programming @@ -4182,7 +4180,7 @@ Verilog: - ".v" - ".veo" ace_mode: verilog - codemirror_mode: verilog + codemirror_mode: text/x-verilog language_id: 387 VimL: type: programming @@ -4220,7 +4218,7 @@ Visual Basic: - vb.net - vbnet ace_mode: text - codemirror_mode: vb + codemirror_mode: text/x-vb language_id: 389 Volt: type: programming @@ -4229,7 +4227,7 @@ Volt: - ".volt" tm_scope: source.d ace_mode: d - codemirror_mode: d + codemirror_mode: text/x-d language_id: 390 Vue: type: markup @@ -4238,7 +4236,6 @@ Vue: - ".vue" tm_scope: text.html.vue ace_mode: html - codemirror_mode: vue language_id: 391 Wavefront Material: type: data @@ -4268,7 +4265,7 @@ WebIDL: - ".webidl" tm_scope: source.webidl ace_mode: text - codemirror_mode: webidl + codemirror_mode: text/x-webidl language_id: 395 World of Warcraft Addon Data: type: data @@ -4294,12 +4291,12 @@ XC: - ".xc" tm_scope: source.xc ace_mode: c_cpp - codemirror_mode: clike + codemirror_mode: text/x-csrc language_id: 398 XML: type: data ace_mode: xml - codemirror_mode: xml + codemirror_mode: text/xml aliases: - rss - xsd @@ -4408,7 +4405,7 @@ XPages: - ".xsp.metadata" tm_scope: none ace_mode: xml - codemirror_mode: xml + codemirror_mode: text/xml language_id: 400 XProc: type: programming @@ -4417,7 +4414,7 @@ XProc: - ".xproc" tm_scope: text.xml ace_mode: xml - codemirror_mode: xml + codemirror_mode: text/xml language_id: 401 XQuery: type: programming @@ -4429,7 +4426,7 @@ XQuery: - ".xqm" - ".xqy" ace_mode: xquery - codemirror_mode: xquery + codemirror_mode: application/xquery tm_scope: source.xq language_id: 402 XS: @@ -4438,7 +4435,7 @@ XS: - ".xs" tm_scope: source.c ace_mode: c_cpp - codemirror_mode: clike + codemirror_mode: text/x-csrc language_id: 403 XSLT: type: programming @@ -4449,7 +4446,7 @@ XSLT: - ".xsl" tm_scope: text.xml.xsl ace_mode: xml - codemirror_mode: xml + codemirror_mode: text/xml color: "#EB8CEB" language_id: 404 Xojo: @@ -4486,7 +4483,7 @@ YAML: filenames: - ".clang-format" ace_mode: yaml - codemirror_mode: yaml + codemirror_mode: text/x-yaml language_id: 407 YANG: type: data @@ -4543,7 +4540,7 @@ eC: edn: type: data ace_mode: clojure - codemirror_mode: clojure + codemirror_mode: text/x-clojure extensions: - ".edn" tm_scope: source.clojure @@ -4591,11 +4588,12 @@ reStructuredText: - ".rest.txt" - ".rst.txt" ace_mode: text - codemirror_mode: rst + codemirror_mode: text/x-rst language_id: 419 wisp: type: programming ace_mode: clojure + codemirror_mode: text/x-clojure color: "#7582D1" extensions: - ".wisp" diff --git a/test/test_language.rb b/test/test_language.rb index fec4e29b..4409ae4e 100644 --- a/test/test_language.rb +++ b/test/test_language.rb @@ -350,7 +350,7 @@ class TestLanguage < Minitest::Test end def test_codemirror_mode - assert_equal 'clike', Language['C++'].codemirror_mode + assert_equal 'text/x-c++src', Language['C++'].codemirror_mode end def test_wrap From c525e3fbefadef76dde6efc5435427a1abcd355d Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Fri, 23 Sep 2016 13:48:24 -0700 Subject: [PATCH 19/45] Ignore default external warnings --- test/test_blob.rb | 22 +++++++++++++++++----- test/test_file_blob.rb | 22 +++++++++++++++++----- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/test/test_blob.rb b/test/test_blob.rb index 3322cc41..a781e466 100644 --- a/test/test_blob.rb +++ b/test/test_blob.rb @@ -3,15 +3,27 @@ require_relative "./helper" class TestBlob < Minitest::Test include Linguist + def silence_warnings + original_verbosity = $VERBOSE + $VERBOSE = nil + yield + ensure + $VERBOSE = original_verbosity + end + def setup - # git blobs are normally loaded as ASCII-8BIT since they may contain data - # with arbitrary encoding not known ahead of time - @original_external = Encoding.default_external - Encoding.default_external = Encoding.find("ASCII-8BIT") + silence_warnings do + # git blobs are normally loaded as ASCII-8BIT since they may contain data + # with arbitrary encoding not known ahead of time + @original_external = Encoding.default_external + Encoding.default_external = Encoding.find("ASCII-8BIT") + end end def teardown - Encoding.default_external = @original_external + silence_warnings do + Encoding.default_external = @original_external + end end def script_blob(name) diff --git a/test/test_file_blob.rb b/test/test_file_blob.rb index 82f3059c..383b170e 100644 --- a/test/test_file_blob.rb +++ b/test/test_file_blob.rb @@ -3,15 +3,27 @@ require_relative "./helper" class TestFileBlob < Minitest::Test include Linguist + def silence_warnings + original_verbosity = $VERBOSE + $VERBOSE = nil + yield + ensure + $VERBOSE = original_verbosity + end + def setup - # git blobs are normally loaded as ASCII-8BIT since they may contain data - # with arbitrary encoding not known ahead of time - @original_external = Encoding.default_external - Encoding.default_external = Encoding.find("ASCII-8BIT") + silence_warnings do + # git blobs are normally loaded as ASCII-8BIT since they may contain data + # with arbitrary encoding not known ahead of time + @original_external = Encoding.default_external + Encoding.default_external = Encoding.find("ASCII-8BIT") + end end def teardown - Encoding.default_external = @original_external + silence_warnings do + Encoding.default_external = @original_external + end end def script_blob(name) From 152b5ade5ead83462099c3fef2332bebcd55964c Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Fri, 23 Sep 2016 13:50:01 -0700 Subject: [PATCH 20/45] Fix shadowed path warning --- test/test_grammars.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_grammars.rb b/test/test_grammars.rb index bc193b3c..3b03ca81 100644 --- a/test/test_grammars.rb +++ b/test/test_grammars.rb @@ -154,7 +154,7 @@ class TestGrammars < Minitest::Test # Neither Licensee nor our own regex was able to detect the license, let's check the readme files = Dir[File.join(ROOT, submodule, "*")] - if readme = files.find { |path| File.basename(path) =~ /\Areadme\b/i } + if readme = files.find { |file| File.basename(file) =~ /\Areadme\b/i } classify_license(readme) end end From 39ea9be5f8aa96e4dab10567feb26b799a35af0a Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Fri, 23 Sep 2016 13:53:38 -0700 Subject: [PATCH 21/45] Ignore ace mode warning while testing --- lib/linguist/language.rb | 3 ++- test/helper.rb | 8 ++++++++ test/test_blob.rb | 8 -------- test/test_language.rb | 6 ++++-- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/lib/linguist/language.rb b/lib/linguist/language.rb index 85eade29..e823d6cf 100644 --- a/lib/linguist/language.rb +++ b/lib/linguist/language.rb @@ -267,6 +267,7 @@ module Linguist # Returns an Array of Languages. def self.ace_modes warn "This method will be deprecated in a future 5.x release. Every language now has an `ace_mode` set." + warn caller @ace_modes ||= all.select(&:ace_mode).sort_by { |lang| lang.name.downcase } end @@ -306,7 +307,7 @@ module Linguist # Set legacy search term @search_term = attributes[:search_term] || default_alias_name - # Set the language_id + # Set the language_id @language_id = attributes[:language_id] # Set extensions or default to []. diff --git a/test/helper.rb b/test/helper.rb index deb7ef5b..5f7eeb87 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -35,3 +35,11 @@ def sample_blob_memory(name) content = File.read(filepath) Linguist::Blob.new(name, content) end + +def silence_warnings + original_verbosity = $VERBOSE + $VERBOSE = nil + yield +ensure + $VERBOSE = original_verbosity +end diff --git a/test/test_blob.rb b/test/test_blob.rb index a781e466..65b88ba4 100644 --- a/test/test_blob.rb +++ b/test/test_blob.rb @@ -3,14 +3,6 @@ require_relative "./helper" class TestBlob < Minitest::Test include Linguist - def silence_warnings - original_verbosity = $VERBOSE - $VERBOSE = nil - yield - ensure - $VERBOSE = original_verbosity - end - def setup silence_warnings do # git blobs are normally loaded as ASCII-8BIT since they may contain data diff --git a/test/test_language.rb b/test/test_language.rb index fec4e29b..1456fb84 100644 --- a/test/test_language.rb +++ b/test/test_language.rb @@ -345,8 +345,10 @@ class TestLanguage < Minitest::Test end def test_ace_modes - assert Language.ace_modes.include?(Language['Ruby']) - assert Language.ace_modes.include?(Language['FORTRAN']) + silence_warnings do + assert Language.ace_modes.include?(Language['Ruby']) + assert Language.ace_modes.include?(Language['FORTRAN']) + end end def test_codemirror_mode From fdb962518f9a3ecfce32377e1e59c07523eb5253 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Fri, 23 Sep 2016 13:54:55 -0700 Subject: [PATCH 22/45] Consistent CodeMirror casing --- lib/linguist/language.rb | 2 +- lib/linguist/languages.yml | 2 +- lib/linguist/vendor.yml | 2 +- test/test_file_blob.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/linguist/language.rb b/lib/linguist/language.rb index c84ad08f..310fd798 100644 --- a/lib/linguist/language.rb +++ b/lib/linguist/language.rb @@ -399,7 +399,7 @@ module Linguist # Returns a String name or nil attr_reader :ace_mode - # Public: Get Codemirror mode (as expressed by a mimetype) + # Public: Get CodeMirror mode (as expressed by a mimetype) # # Examples # diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 5762f715..735ba2f0 100755 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -6,7 +6,7 @@ # ace_mode - A String name of the Ace Mode used for highlighting whenever # a file is edited. This must match one of the filenames in http://git.io/3XO_Cg. # Use "text" if a mode does not exist. -# codemirror_mode - A String name of the Codemirror Mode used for highlighting whenever a file is edited. +# codemirror_mode - A String name of the CodeMirror Mode used for highlighting whenever a file is edited. # This must match a mode from https://git.io/vi9Fx # wrap - Boolean wrap to enable line wrapping (default: false) # extensions - An Array of associated extensions (the first one is diff --git a/lib/linguist/vendor.yml b/lib/linguist/vendor.yml index 6b8c7364..e500f85d 100644 --- a/lib/linguist/vendor.yml +++ b/lib/linguist/vendor.yml @@ -165,7 +165,7 @@ # Chart.js - (^|/)Chart\.js$ -# Codemirror +# CodeMirror - (^|/)[Cc]ode[Mm]irror/(\d+\.\d+/)?(lib|mode|theme|addon|keymap|demo) # SyntaxHighlighter - http://alexgorbatchev.com/ diff --git a/test/test_file_blob.rb b/test/test_file_blob.rb index 383b170e..84cee723 100644 --- a/test/test_file_blob.rb +++ b/test/test_file_blob.rb @@ -317,7 +317,7 @@ class TestFileBlob < Minitest::Test assert sample_blob("some/vendored/path/Chart.js").vendored? assert !sample_blob("some/vendored/path/chart.js").vendored? - # Codemirror deps + # CodeMirror deps assert sample_blob("codemirror/mode/blah.js").vendored? assert sample_blob("codemirror/5.0/mode/blah.js").vendored? From daefff86ff188cf3ae87e17051558d8f79535367 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Fri, 23 Sep 2016 13:57:50 -0700 Subject: [PATCH 23/45] Fix JSX mode --- lib/linguist/languages.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 735ba2f0..e9ff1c5f 100755 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -1903,7 +1903,8 @@ JSX: extensions: - ".jsx" tm_scope: source.js.jsx - ace_mode: text/jsx + ace_mode: jsx + codemirror_mode: text/jsx language_id: 178 Jade: group: HTML From 0108ef438661994c929cc378a6d113d1ccb3d369 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Fri, 23 Sep 2016 14:35:02 -0700 Subject: [PATCH 24/45] Restore old mode --- lib/linguist/language.rb | 17 +- lib/linguist/languages.yml | 581 +++++++++++++++++++++++++------------ test/test_language.rb | 12 +- 3 files changed, 414 insertions(+), 196 deletions(-) diff --git a/lib/linguist/language.rb b/lib/linguist/language.rb index 310fd798..ea88b87f 100644 --- a/lib/linguist/language.rb +++ b/lib/linguist/language.rb @@ -302,6 +302,7 @@ module Linguist @ace_mode = attributes[:ace_mode] @codemirror_mode = attributes[:codemirror_mode] + @codemirror_mime_mode = attributes[:codemirror_mime_mode] @wrap = attributes[:wrap] || false # Set legacy search term @@ -399,7 +400,18 @@ module Linguist # Returns a String name or nil attr_reader :ace_mode - # Public: Get CodeMirror mode (as expressed by a mimetype) + # Public: Get CodeMirror mode + # + # Examples + # + # # => "nil" + # # => "javascript" + # # => "clike" + # + # Returns a String name or nil + attr_reader :codemirror_mode + + # Public: Get CodeMirror MIME type mode # # Examples # @@ -408,7 +420,7 @@ module Linguist # # => "text/x-csrc" # # Returns a String name or nil - attr_reader :codemirror_mode + attr_reader :codemirror_mime_mode # Public: Should language lines be wrapped # @@ -587,6 +599,7 @@ module Linguist :tm_scope => options['tm_scope'], :ace_mode => options['ace_mode'], :codemirror_mode => options['codemirror_mode'], + :codemirror_mime_mode => options['codemirror_mime_mode'], :wrap => options['wrap'], :group_name => options['group'], :searchable => options.fetch('searchable', true), diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index e9ff1c5f..36b61047 100755 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -59,7 +59,8 @@ AGS Script: - ".ash" tm_scope: source.c++ ace_mode: c_cpp - codemirror_mode: text/x-c++src + codemirror_mode: clike + codemirror_mime_mode: text/x-c++src language_id: 2 AMPL: type: programming @@ -97,7 +98,8 @@ APL: - dyalog tm_scope: source.apl ace_mode: text - codemirror_mode: text/apl + codemirror_mode: apl + codemirror_mime_mode: text/apl language_id: 6 ASN.1: type: data @@ -107,7 +109,8 @@ ASN.1: - ".asn1" tm_scope: source.asn ace_mode: text - codemirror_mode: text/x-ttcn-asn + codemirror_mode: asn.1 + codemirror_mime_mode: text/x-ttcn-asn language_id: 7 ASP: type: programming @@ -126,7 +129,8 @@ ASP: - ".aspx" - ".axd" ace_mode: text - codemirror_mode: application/x-aspx + codemirror_mode: htmlembedded + codemirror_mime_mode: application/x-aspx language_id: 8 ATS: type: programming @@ -189,7 +193,8 @@ Alpine Abuild: - APKBUILD tm_scope: source.shell ace_mode: sh - codemirror_mode: text/x-sh + codemirror_mode: shell + codemirror_mime_mode: text/x-sh language_id: 14 Ant Build System: type: data @@ -198,7 +203,8 @@ Ant Build System: - ant.xml - build.xml ace_mode: xml - codemirror_mode: application/xml + codemirror_mode: xml + codemirror_mime_mode: application/xml language_id: 15 ApacheConf: type: markup @@ -217,7 +223,8 @@ Apex: - ".cls" tm_scope: source.java ace_mode: java - codemirror_mode: text/x-java + codemirror_mode: clike + codemirror_mime_mode: text/x-java language_id: 17 Apollo Guidance Computer: type: programming @@ -227,7 +234,8 @@ Apollo Guidance Computer: - ".agc" tm_scope: source.agc ace_mode: assembly_x86 - codemirror_mode: text/x-gas + codemirror_mode: gas + codemirror_mime_mode: text/x-gas language_id: 18 AppleScript: type: programming @@ -256,7 +264,8 @@ Arduino: - ".ino" tm_scope: source.c++ ace_mode: c_cpp - codemirror_mode: text/x-c++src + codemirror_mode: clike + codemirror_mime_mode: text/x-c++src language_id: 21 AsciiDoc: type: prose @@ -289,7 +298,8 @@ Assembly: - ".nasm" tm_scope: source.assembly ace_mode: assembly_x86 - codemirror_mode: text/x-gas + codemirror_mode: gas + codemirror_mime_mode: text/x-gas language_id: 24 Augeas: type: programming @@ -427,7 +437,8 @@ Brainfuck: - ".bf" tm_scope: source.bf ace_mode: text - codemirror_mode: text/x-brainfuck + codemirror_mode: brainfuck + codemirror_mime_mode: text/x-brainfuck language_id: 38 Brightscript: type: programming @@ -454,12 +465,14 @@ C: interpreters: - tcc ace_mode: c_cpp - codemirror_mode: text/x-csrc + codemirror_mode: clike + codemirror_mime_mode: text/x-csrc language_id: 41 C#: type: programming ace_mode: csharp - codemirror_mode: text/x-csharp + codemirror_mode: clike + codemirror_mime_mode: text/x-csharp tm_scope: source.cs search_term: csharp color: "#178600" @@ -474,7 +487,8 @@ C#: C++: type: programming ace_mode: c_cpp - codemirror_mode: text/x-c++src + codemirror_mode: clike + codemirror_mime_mode: text/x-c++src search_term: cpp color: "#f34b7d" aliases: @@ -502,7 +516,8 @@ C-ObjDump: - ".c-objdump" tm_scope: objdump.x86asm ace_mode: assembly_x86 - codemirror_mode: text/x-gas + codemirror_mode: gas + codemirror_mime_mode: text/x-gas language_id: 44 C2hs Haskell: type: programming @@ -513,7 +528,8 @@ C2hs Haskell: - ".chs" tm_scope: source.haskell ace_mode: haskell - codemirror_mode: text/x-haskell + codemirror_mode: haskell + codemirror_mime_mode: text/x-haskell language_id: 45 CLIPS: type: programming @@ -530,7 +546,8 @@ CMake: filenames: - CMakeLists.txt ace_mode: text - codemirror_mode: text/x-cmake + codemirror_mode: cmake + codemirror_mime_mode: text/x-cmake language_id: 47 COBOL: type: programming @@ -541,7 +558,8 @@ COBOL: - ".cobol" - ".cpy" ace_mode: cobol - codemirror_mode: text/x-cobol + codemirror_mode: cobol + codemirror_mime_mode: text/x-cobol language_id: 48 COLLADA: type: data @@ -549,13 +567,15 @@ COLLADA: - ".dae" tm_scope: text.xml ace_mode: xml - codemirror_mode: text/x-xml + codemirror_mode: xml + codemirror_mime_mode: text/x-xml language_id: 49 CSS: type: markup tm_scope: source.css ace_mode: css - codemirror_mode: text/css + codemirror_mode: css + codemirror_mime_mode: text/css color: "#563d7c" extensions: - ".css" @@ -611,7 +631,8 @@ ChucK: - ".ck" tm_scope: source.java ace_mode: java - codemirror_mode: text/x-java + codemirror_mode: clike + codemirror_mime_mode: text/x-java language_id: 57 Cirru: type: programming @@ -648,7 +669,8 @@ Click: Clojure: type: programming ace_mode: clojure - codemirror_mode: text/x-clojure + codemirror_mode: clojure + codemirror_mime_mode: text/x-clojure color: "#db5855" extensions: - ".clj" @@ -667,7 +689,8 @@ CoffeeScript: type: programming tm_scope: source.coffee ace_mode: coffee - codemirror_mode: text/x-coffeescript + codemirror_mode: coffeescript + codemirror_mime_mode: text/x-coffeescript color: "#244776" aliases: - coffee @@ -733,7 +756,8 @@ Common Lisp: - clisp - ecl ace_mode: lisp - codemirror_mode: text/x-common-lisp + codemirror_mode: commonlisp + codemirror_mime_mode: text/x-common-lisp language_id: 66 Component Pascal: type: programming @@ -746,7 +770,8 @@ Component Pascal: - delphi - objectpascal ace_mode: pascal - codemirror_mode: text/x-pascal + codemirror_mode: pascal + codemirror_mime_mode: text/x-pascal language_id: 67 Cool: type: programming @@ -774,7 +799,8 @@ Cpp-ObjDump: aliases: - c++-objdump ace_mode: assembly_x86 - codemirror_mode: text/x-gas + codemirror_mode: gas + codemirror_mime_mode: text/x-gas language_id: 70 Creole: type: prose @@ -790,7 +816,8 @@ Crystal: extensions: - ".cr" ace_mode: ruby - codemirror_mode: text/x-crystal + codemirror_mode: crystal + codemirror_mime_mode: text/x-crystal tm_scope: source.crystal interpreters: - crystal @@ -840,7 +867,8 @@ Cuda: - ".cuh" tm_scope: source.cuda-c++ ace_mode: c_cpp - codemirror_mode: text/x-c++src + codemirror_mode: clike + codemirror_mime_mode: text/x-c++src color: "#3A4E3A" language_id: 77 Cycript: @@ -849,7 +877,8 @@ Cycript: - ".cy" tm_scope: source.js ace_mode: javascript - codemirror_mode: text/javascript + codemirror_mode: javascript + codemirror_mime_mode: text/javascript language_id: 78 Cython: type: programming @@ -861,7 +890,8 @@ Cython: aliases: - pyrex ace_mode: text - codemirror_mode: text/x-cython + codemirror_mode: python + codemirror_mime_mode: text/x-cython language_id: 79 D: type: programming @@ -870,7 +900,8 @@ D: - ".d" - ".di" ace_mode: d - codemirror_mode: text/x-d + codemirror_mode: d + codemirror_mime_mode: text/x-d language_id: 80 D-ObjDump: type: data @@ -878,7 +909,8 @@ D-ObjDump: - ".d-objdump" tm_scope: objdump.x86asm ace_mode: assembly_x86 - codemirror_mode: text/x-gas + codemirror_mode: gas + codemirror_mime_mode: text/x-gas language_id: 81 DIGITAL Command Language: type: programming @@ -917,7 +949,8 @@ DTrace: - dtrace tm_scope: source.c ace_mode: c_cpp - codemirror_mode: text/x-csrc + codemirror_mode: clike + codemirror_mime_mode: text/x-csrc language_id: 85 Darcs Patch: type: data @@ -938,7 +971,8 @@ Dart: interpreters: - dart ace_mode: dart - codemirror_mode: text/x-dart + codemirror_mode: dart + codemirror_mime_mode: text/x-dart language_id: 87 Diff: type: data @@ -949,7 +983,8 @@ Diff: - udiff tm_scope: source.diff ace_mode: diff - codemirror_mode: text/x-diff + codemirror_mode: diff + codemirror_mime_mode: text/x-diff language_id: 88 Dockerfile: type: data @@ -959,7 +994,8 @@ Dockerfile: filenames: - Dockerfile ace_mode: dockerfile - codemirror_mode: text/x-dockerfile + codemirror_mode: dockerfile + codemirror_mime_mode: text/x-dockerfile language_id: 89 Dogescript: type: programming @@ -978,7 +1014,8 @@ Dylan: - ".intr" - ".lid" ace_mode: text - codemirror_mode: text/x-dylan + codemirror_mode: dylan + codemirror_mime_mode: text/x-dylan language_id: 91 E: type: programming @@ -998,7 +1035,8 @@ ECL: - ".eclxml" tm_scope: none ace_mode: text - codemirror_mode: text/x-ecl + codemirror_mode: ecl + codemirror_mime_mode: text/x-ecl language_id: 93 ECLiPSe: type: programming @@ -1024,7 +1062,8 @@ EQ: - ".eq" tm_scope: source.cs ace_mode: csharp - codemirror_mode: text/x-csharp + codemirror_mode: clike + codemirror_mime_mode: text/x-csharp language_id: 96 Eagle: type: markup @@ -1034,7 +1073,8 @@ Eagle: - ".brd" tm_scope: text.xml ace_mode: xml - codemirror_mode: text/xml + codemirror_mode: xml + codemirror_mime_mode: text/xml language_id: 97 Ecere Projects: type: data @@ -1043,7 +1083,8 @@ Ecere Projects: - ".epj" tm_scope: source.json ace_mode: json - codemirror_mode: application/json + codemirror_mode: json + codemirror_mime_mode: application/json language_id: 98 Eiffel: type: programming @@ -1051,7 +1092,8 @@ Eiffel: extensions: - ".e" ace_mode: eiffel - codemirror_mode: text/x-eiffel + codemirror_mode: eiffel + codemirror_mime_mode: text/x-eiffel language_id: 99 Elixir: type: programming @@ -1072,7 +1114,8 @@ Elm: - ".elm" tm_scope: source.elm ace_mode: elm - codemirror_mode: text/x-elm + codemirror_mode: elm + codemirror_mime_mode: text/x-elm language_id: 101 Emacs Lisp: type: programming @@ -1096,7 +1139,8 @@ Emacs Lisp: - ".emacs" - ".emacs.desktop" ace_mode: lisp - codemirror_mode: text/x-common-lisp + codemirror_mode: commonlisp + codemirror_mime_mode: text/x-common-lisp language_id: 102 EmberScript: type: programming @@ -1106,7 +1150,8 @@ EmberScript: - ".emberscript" tm_scope: source.coffee ace_mode: coffee - codemirror_mode: text/x-coffeescript + codemirror_mode: coffeescript + codemirror_mime_mode: text/x-coffeescript language_id: 103 Erlang: type: programming @@ -1124,7 +1169,8 @@ Erlang: - rebar.config.lock - rebar.lock ace_mode: erlang - codemirror_mode: text/x-erlang + codemirror_mode: erlang + codemirror_mime_mode: text/x-erlang interpreters: - escript language_id: 104 @@ -1140,7 +1186,8 @@ F#: - ".fsx" tm_scope: source.fsharp ace_mode: text - codemirror_mode: text/x-fsharp + codemirror_mode: mllike + codemirror_mime_mode: text/x-fsharp language_id: 105 FLUX: type: programming @@ -1165,7 +1212,8 @@ FORTRAN: - ".fpp" tm_scope: source.fortran.modern ace_mode: text - codemirror_mode: text/x-fortran + codemirror_mode: fortran + codemirror_mime_mode: text/x-fortran language_id: 107 Factor: type: programming @@ -1176,7 +1224,8 @@ Factor: - ".factor-boot-rc" - ".factor-rc" ace_mode: text - codemirror_mode: text/x-factor + codemirror_mode: factor + codemirror_mime_mode: text/x-factor language_id: 108 Fancy: type: programming @@ -1232,7 +1281,8 @@ Forth: - ".frt" - ".fs" ace_mode: forth - codemirror_mode: text/x-forth + codemirror_mode: forth + codemirror_mime_mode: text/x-forth language_id: 114 FreeMarker: type: programming @@ -1287,7 +1337,8 @@ GAS: - ".ms" tm_scope: source.assembly ace_mode: assembly_x86 - codemirror_mode: text/x-gas + codemirror_mode: gas + codemirror_mime_mode: text/x-gas language_id: 120 GCC Machine Description: type: programming @@ -1295,7 +1346,8 @@ GCC Machine Description: - ".md" tm_scope: source.lisp ace_mode: lisp - codemirror_mode: text/x-common-lisp + codemirror_mode: commonlisp + codemirror_mime_mode: text/x-common-lisp language_id: 121 GDB: type: programming @@ -1340,7 +1392,8 @@ Game Maker Language: - ".gml" tm_scope: source.c++ ace_mode: c_cpp - codemirror_mode: text/x-c++src + codemirror_mode: clike + codemirror_mime_mode: text/x-c++src language_id: 125 Genshi: type: programming @@ -1351,7 +1404,8 @@ Genshi: - xml+genshi - xml+kid ace_mode: xml - codemirror_mode: text/xml + codemirror_mode: xml + codemirror_mime_mode: text/xml language_id: 126 Gentoo Ebuild: type: programming @@ -1360,7 +1414,8 @@ Gentoo Ebuild: - ".ebuild" tm_scope: source.shell ace_mode: sh - codemirror_mode: text/x-sh + codemirror_mode: shell + codemirror_mime_mode: text/x-sh language_id: 127 Gentoo Eclass: type: programming @@ -1369,7 +1424,8 @@ Gentoo Eclass: - ".eclass" tm_scope: source.shell ace_mode: sh - codemirror_mode: text/x-sh + codemirror_mode: shell + codemirror_mime_mode: text/x-sh language_id: 128 Gettext Catalog: type: prose @@ -1390,7 +1446,8 @@ Glyph: - ".glf" tm_scope: source.tcl ace_mode: tcl - codemirror_mode: text/x-tcl + codemirror_mode: tcl + codemirror_mime_mode: text/x-tcl language_id: 130 Gnuplot: type: programming @@ -1411,7 +1468,8 @@ Go: extensions: - ".go" ace_mode: golang - codemirror_mode: text/x-go + codemirror_mode: go + codemirror_mime_mode: text/x-go language_id: 132 Golo: type: programming @@ -1457,7 +1515,8 @@ Grammatical Framework: color: "#79aa7a" tm_scope: source.haskell ace_mode: haskell - codemirror_mode: text/x-haskell + codemirror_mode: haskell + codemirror_mime_mode: text/x-haskell language_id: 137 Graph Modeling Language: type: data @@ -1517,12 +1576,14 @@ Groff: - nroff - troff ace_mode: text - codemirror_mode: text/troff + codemirror_mode: troff + codemirror_mime_mode: text/troff language_id: 141 Groovy: type: programming ace_mode: groovy - codemirror_mode: text/x-groovy + codemirror_mode: groovy + codemirror_mime_mode: text/x-groovy color: "#e69f56" extensions: - ".groovy" @@ -1544,7 +1605,8 @@ Groovy Server Pages: - ".gsp" tm_scope: text.html.jsp ace_mode: jsp - codemirror_mode: application/x-jsp + codemirror_mode: htmlembedded + codemirror_mime_mode: application/x-jsp language_id: 143 HCL: type: programming @@ -1552,7 +1614,8 @@ HCL: - ".hcl" - ".tf" ace_mode: ruby - codemirror_mode: text/x-ruby + codemirror_mode: ruby + codemirror_mime_mode: text/x-ruby tm_scope: source.ruby language_id: 144 HLSL: @@ -1569,7 +1632,8 @@ HTML: type: markup tm_scope: text.html.basic ace_mode: html - codemirror_mode: text/html + codemirror_mode: html + codemirror_mime_mode: text/html color: "#e44b23" aliases: - xhtml @@ -1595,7 +1659,8 @@ HTML+Django: - html+jinja - htmldjango ace_mode: django - codemirror_mode: text/x-django + codemirror_mode: django + codemirror_mime_mode: text/x-django language_id: 147 HTML+ECR: type: markup @@ -1606,7 +1671,8 @@ HTML+ECR: extensions: - ".ecr" ace_mode: text - codemirror_mode: text/html + codemirror_mode: htmlembedded + codemirror_mime_mode: text/html language_id: 148 HTML+EEX: type: markup @@ -1617,7 +1683,8 @@ HTML+EEX: extensions: - ".eex" ace_mode: text - codemirror_mode: text/html + codemirror_mode: htmlembedded + codemirror_mime_mode: text/html language_id: 149 HTML+ERB: type: markup @@ -1629,7 +1696,8 @@ HTML+ERB: - ".erb" - ".erb.deface" ace_mode: text - codemirror_mode: application/x-erb + codemirror_mode: htmlembedded + codemirror_mime_mode: application/x-erb language_id: 150 HTML+PHP: type: markup @@ -1638,7 +1706,8 @@ HTML+PHP: extensions: - ".phtml" ace_mode: php - codemirror_mode: application/x-httpd-php + codemirror_mode: php + codemirror_mime_mode: application/x-httpd-php language_id: 151 HTTP: type: data @@ -1646,12 +1715,14 @@ HTTP: - ".http" tm_scope: source.httpspec ace_mode: text - codemirror_mode: message/http + codemirror_mode: http + codemirror_mime_mode: message/http language_id: 152 Hack: type: programming ace_mode: php - codemirror_mode: application/x-httpd-php + codemirror_mode: php + codemirror_mime_mode: application/x-httpd-php extensions: - ".hh" - ".php" @@ -1665,7 +1736,8 @@ Haml: - ".haml" - ".haml.deface" ace_mode: haml - codemirror_mode: text/x-haml + codemirror_mode: haml + codemirror_mime_mode: text/x-haml color: "#ECE2A9" language_id: 154 Handlebars: @@ -1680,6 +1752,7 @@ Handlebars: - ".hbs" tm_scope: text.html.handlebars ace_mode: handlebars + codemirror_mode: handlebars language_id: 155 Harbour: type: programming @@ -1698,12 +1771,14 @@ Haskell: interpreters: - runhaskell ace_mode: haskell - codemirror_mode: text/x-haskell + codemirror_mode: haskell + codemirror_mime_mode: text/x-haskell language_id: 157 Haxe: type: programming ace_mode: haxe - codemirror_mode: text/x-haxe + codemirror_mode: haxe + codemirror_mime_mode: text/x-haxe color: "#df7900" extensions: - ".hx" @@ -1734,7 +1809,8 @@ IDL: - ".pro" - ".dlm" ace_mode: text - codemirror_mode: text/x-idl + codemirror_mode: idl + codemirror_mime_mode: text/x-idl language_id: 161 IGOR Pro: type: programming @@ -1758,7 +1834,8 @@ INI: aliases: - dosini ace_mode: ini - codemirror_mode: text/x-properties + codemirror_mode: properties + codemirror_mime_mode: text/x-properties language_id: 163 IRC log: type: data @@ -1858,7 +1935,8 @@ JSON: tm_scope: source.json group: JavaScript ace_mode: json - codemirror_mode: application/json + codemirror_mode: javascript + codemirror_mime_mode: application/json searchable: false extensions: - ".json" @@ -1877,13 +1955,15 @@ JSON5: - ".json5" tm_scope: source.js ace_mode: javascript - codemirror_mode: application/json + codemirror_mode: javascript + codemirror_mime_mode: application/json language_id: 175 JSONLD: type: data group: JavaScript ace_mode: javascript - codemirror_mode: application/ld+json + codemirror_mode: javascript + codemirror_mime_mode: application/ld+json extensions: - ".jsonld" tm_scope: source.js @@ -1892,7 +1972,8 @@ JSONiq: color: "#40d47e" type: programming ace_mode: jsoniq - codemirror_mode: application/json + codemirror_mode: javascript + codemirror_mime_mode: application/json extensions: - ".jq" tm_scope: source.jq @@ -1903,8 +1984,8 @@ JSX: extensions: - ".jsx" tm_scope: source.js.jsx - ace_mode: jsx - codemirror_mode: text/jsx + ace_mode: javascript + codemirror_mime_mode: text/jsx language_id: 178 Jade: group: HTML @@ -1914,7 +1995,8 @@ Jade: - ".pug" tm_scope: text.jade ace_mode: jade - codemirror_mode: text/x-pug + codemirror_mode: pug + codemirror_mime_mode: text/x-pug language_id: 179 Jasmin: type: programming @@ -1926,7 +2008,8 @@ Jasmin: Java: type: programming ace_mode: java - codemirror_mode: text/x-java + codemirror_mode: clike + codemirror_mime_mode: text/x-java color: "#b07219" extensions: - ".java" @@ -1941,13 +2024,15 @@ Java Server Pages: - ".jsp" tm_scope: text.html.jsp ace_mode: jsp - codemirror_mode: application/x-jsp + codemirror_mode: htmlembedded + codemirror_mime_mode: application/x-jsp language_id: 182 JavaScript: type: programming tm_scope: source.js ace_mode: javascript - codemirror_mode: text/javascript + codemirror_mode: javascript + codemirror_mime_mode: text/javascript color: "#f1e05a" aliases: - js @@ -1996,12 +2081,14 @@ Julia: - ".jl" color: "#a270ba" ace_mode: julia - codemirror_mode: text/x-julia + codemirror_mode: julia + codemirror_mime_mode: text/x-julia language_id: 184 Jupyter Notebook: type: markup ace_mode: json - codemirror_mode: application/json + codemirror_mode: javascript + codemirror_mime_mode: application/json tm_scope: source.json color: "#DA5B0B" extensions: @@ -2031,7 +2118,8 @@ KiCad: Kit: type: markup ace_mode: html - codemirror_mode: text/html + codemirror_mode: html + codemirror_mime_mode: text/html extensions: - ".kit" tm_scope: text.html.basic @@ -2045,7 +2133,8 @@ Kotlin: - ".kts" tm_scope: source.Kotlin ace_mode: text - codemirror_mode: text/x-kotlin + codemirror_mode: kotlin + codemirror_mime_mode: text/x-kotlin language_id: 189 LFE: type: programming @@ -2055,7 +2144,8 @@ LFE: group: Erlang tm_scope: source.lisp ace_mode: lisp - codemirror_mode: text/x-common-lisp + codemirror_mode: commonlisp + codemirror_mime_mode: text/x-common-lisp language_id: 190 LLVM: type: programming @@ -2088,7 +2178,8 @@ LabVIEW: - ".lvproj" tm_scope: text.xml ace_mode: xml - codemirror_mode: text/xml + codemirror_mode: xml + codemirror_mime_mode: text/xml language_id: 194 Lasso: type: programming @@ -2112,7 +2203,8 @@ Latte: - ".latte" tm_scope: text.html.smarty ace_mode: smarty - codemirror_mode: text/x-smarty + codemirror_mode: smarty + codemirror_mime_mode: text/x-smarty language_id: 196 Lean: type: programming @@ -2128,7 +2220,8 @@ Less: - ".less" tm_scope: source.css.less ace_mode: less - codemirror_mode: text/css + codemirror_mode: css + codemirror_mime_mode: text/css color: "#A1D9A1" language_id: 198 Lex: @@ -2212,7 +2305,8 @@ Literate Haskell: - ".lhs" tm_scope: text.tex.latex.haskell ace_mode: text - codemirror_mode: text/x-literate-haskell + codemirror_mode: haskell-literate + codemirror_mime_mode: text/x-literate-haskell language_id: 207 LiveScript: type: programming @@ -2226,7 +2320,8 @@ LiveScript: filenames: - Slakefile ace_mode: livescript - codemirror_mode: text/x-livescript + codemirror_mode: livescript + codemirror_mime_mode: text/x-livescript language_id: 208 Logos: type: programming @@ -2247,7 +2342,8 @@ Logtalk: LookML: type: programming ace_mode: yaml - codemirror_mode: text/x-yaml + codemirror_mode: yaml + codemirror_mime_mode: text/x-yaml color: "#652B81" extensions: - ".lookml" @@ -2263,7 +2359,8 @@ LoomScript: Lua: type: programming ace_mode: lua - codemirror_mode: text/x-lua + codemirror_mode: lua + codemirror_mime_mode: text/x-lua color: "#000080" extensions: - ".lua" @@ -2283,7 +2380,8 @@ M: - ".mumps" - ".m" ace_mode: text - codemirror_mode: text/x-mumps + codemirror_mode: mumps + codemirror_mime_mode: text/x-mumps language_id: 214 tm_scope: none M4: @@ -2321,7 +2419,8 @@ MTML: - ".mtml" tm_scope: text.html.basic ace_mode: html - codemirror_mode: text/html + codemirror_mode: html + codemirror_mime_mode: text/html language_id: 218 MUF: type: programming @@ -2331,7 +2430,8 @@ MUF: - ".m" tm_scope: none ace_mode: forth - codemirror_mode: text/x-forth + codemirror_mode: forth + codemirror_mime_mode: text/x-forth language_id: 219 Makefile: type: programming @@ -2360,7 +2460,8 @@ Makefile: interpreters: - make ace_mode: makefile - codemirror_mode: text/x-cmake + codemirror_mode: cmake + codemirror_mime_mode: text/x-cmake language_id: 220 Mako: type: programming @@ -2373,7 +2474,8 @@ Mako: Markdown: type: prose ace_mode: markdown - codemirror_mode: text/x-gfm + codemirror_mode: markdown + codemirror_mime_mode: text/x-gfm wrap: true extensions: - ".md" @@ -2407,7 +2509,8 @@ Mathematica: aliases: - mma ace_mode: text - codemirror_mode: text/x-mathematica + codemirror_mode: mathematica + codemirror_mime_mode: text/x-mathematica language_id: 224 Matlab: type: programming @@ -2418,7 +2521,8 @@ Matlab: - ".matlab" - ".m" ace_mode: matlab - codemirror_mode: text/x-octave + codemirror_mode: octave + codemirror_mime_mode: text/x-octave language_id: 225 Maven POM: type: data @@ -2426,7 +2530,8 @@ Maven POM: filenames: - pom.xml ace_mode: xml - codemirror_mode: text/xml + codemirror_mode: xml + codemirror_mime_mode: text/xml language_id: 226 Max: type: programming @@ -2443,7 +2548,8 @@ Max: - ".pat" tm_scope: source.json ace_mode: json - codemirror_mode: application/json + codemirror_mode: javascript + codemirror_mime_mode: application/json language_id: 227 MediaWiki: type: prose @@ -2472,7 +2578,8 @@ Metal: - ".metal" tm_scope: source.c++ ace_mode: c_cpp - codemirror_mode: text/x-c++src + codemirror_mode: clike + codemirror_mime_mode: text/x-c++src language_id: 230 MiniD: type: programming @@ -2493,7 +2600,8 @@ Mirah: - ".mirah" tm_scope: source.ruby ace_mode: ruby - codemirror_mode: text/x-ruby + codemirror_mode: ruby + codemirror_mime_mode: text/x-ruby language_id: 232 Modelica: type: programming @@ -2501,7 +2609,8 @@ Modelica: - ".mo" tm_scope: source.modelica ace_mode: text - codemirror_mode: text/x-modelica + codemirror_mode: modelica + codemirror_mime_mode: text/x-modelica language_id: 233 Modula-2: type: programming @@ -2571,7 +2680,8 @@ NSIS: - ".nsi" - ".nsh" ace_mode: text - codemirror_mode: text/x-nsis + codemirror_mode: nsis + codemirror_mime_mode: text/x-nsis language_id: 242 Nemerle: type: programming @@ -2605,7 +2715,8 @@ NetLogo: - ".nlogo" tm_scope: source.lisp ace_mode: lisp - codemirror_mode: text/x-common-lisp + codemirror_mode: commonlisp + codemirror_mime_mode: text/x-common-lisp language_id: 246 NewLisp: type: programming @@ -2619,7 +2730,8 @@ NewLisp: - newlisp tm_scope: source.lisp ace_mode: lisp - codemirror_mode: text/x-common-lisp + codemirror_mode: commonlisp + codemirror_mime_mode: text/x-common-lisp language_id: 247 Nginx: type: markup @@ -2632,7 +2744,8 @@ Nginx: aliases: - nginx configuration file ace_mode: text - codemirror_mode: text/x-nginx-conf + codemirror_mode: nginx + codemirror_mime_mode: text/x-nginx-conf color: "#9469E9" language_id: 248 Nimrod: @@ -2680,7 +2793,8 @@ Nu: - Nukefile tm_scope: source.nu ace_mode: scheme - codemirror_mode: text/x-scheme + codemirror_mode: scheme + codemirror_mime_mode: text/x-scheme interpreters: - nush language_id: 253 @@ -2693,13 +2807,15 @@ NumPy: - ".numsc" tm_scope: none ace_mode: text - codemirror_mode: text/x-python + codemirror_mode: python + codemirror_mime_mode: text/x-python color: "#9C8AF9" language_id: 254 OCaml: type: programming ace_mode: ocaml - codemirror_mode: text/x-ocaml + codemirror_mode: mllike + codemirror_mime_mode: text/x-ocaml color: "#3be133" extensions: - ".ml" @@ -2721,7 +2837,8 @@ ObjDump: - ".objdump" tm_scope: objdump.x86asm ace_mode: assembly_x86 - codemirror_mode: text/x-gas + codemirror_mode: gas + codemirror_mime_mode: text/x-gas language_id: 256 Objective-C: type: programming @@ -2735,7 +2852,8 @@ Objective-C: - ".m" - ".h" ace_mode: objectivec - codemirror_mode: text/x-objectivec + codemirror_mode: clike + codemirror_mime_mode: text/x-objectivec language_id: 257 Objective-C++: type: programming @@ -2748,7 +2866,8 @@ Objective-C++: extensions: - ".mm" ace_mode: objectivec - codemirror_mode: text/x-objectivec + codemirror_mode: clike + codemirror_mime_mode: text/x-objectivec language_id: 258 Objective-J: type: programming @@ -2793,7 +2912,8 @@ OpenCL: - ".opencl" tm_scope: source.c ace_mode: c_cpp - codemirror_mode: text/x-csrc + codemirror_mode: clike + codemirror_mime_mode: text/x-csrc language_id: 263 OpenEdge ABL: type: programming @@ -2816,7 +2936,8 @@ OpenRC runscript: - openrc-run tm_scope: source.shell ace_mode: sh - codemirror_mode: text/x-sh + codemirror_mode: shell + codemirror_mime_mode: text/x-sh language_id: 265 OpenSCAD: type: programming @@ -2857,7 +2978,8 @@ Oz: - ".oz" tm_scope: source.oz ace_mode: text - codemirror_mode: text/x-oz + codemirror_mode: oz + codemirror_mime_mode: text/x-oz language_id: 270 PAWN: type: programming @@ -2872,7 +2994,8 @@ PHP: type: programming tm_scope: text.html.php ace_mode: php - codemirror_mode: application/x-httpd-php + codemirror_mode: php + codemirror_mime_mode: application/x-httpd-php color: "#4F5D95" extensions: - ".php" @@ -2895,7 +3018,8 @@ PHP: PLSQL: type: programming ace_mode: sql - codemirror_mode: text/x-plsql + codemirror_mode: sql + codemirror_mime_mode: text/x-plsql tm_scope: none color: "#dad8d8" extensions: @@ -2910,7 +3034,8 @@ PLSQL: PLpgSQL: type: programming ace_mode: pgsql - codemirror_mode: text/x-sql + codemirror_mode: sql + codemirror_mime_mode: text/x-sql tm_scope: source.sql extensions: - ".sql" @@ -2987,13 +3112,15 @@ Pascal: interpreters: - instantfpc ace_mode: pascal - codemirror_mode: text/x-pascal + codemirror_mode: pascal + codemirror_mime_mode: text/x-pascal language_id: 281 Perl: type: programming tm_scope: source.perl ace_mode: perl - codemirror_mode: text/x-perl + codemirror_mode: perl + codemirror_mime_mode: text/x-perl color: "#0298c3" extensions: - ".pl" @@ -3031,7 +3158,8 @@ Perl6: - perl6 tm_scope: source.perl6fe ace_mode: perl - codemirror_mode: text/x-perl + codemirror_mode: perl + codemirror_mime_mode: text/x-perl language_id: 283 Pickle: type: data @@ -3071,7 +3199,8 @@ Pike: Pod: type: prose ace_mode: perl - codemirror_mode: text/x-perl + codemirror_mode: perl + codemirror_mime_mode: text/x-perl wrap: true extensions: - ".pod" @@ -3117,7 +3246,8 @@ PowerBuilder: PowerShell: type: programming ace_mode: powershell - codemirror_mode: text/x-powershell + codemirror_mode: powershell + codemirror_mime_mode: text/x-powershell aliases: - posh extensions: @@ -3163,7 +3293,8 @@ Protocol Buffer: - ".proto" tm_scope: source.protobuf ace_mode: protobuf - codemirror_mode: text/x-protobuf + codemirror_mode: protobuf + codemirror_mime_mode: text/x-protobuf language_id: 297 Public Key: type: data @@ -3181,7 +3312,8 @@ Puppet: filenames: - Modulefile ace_mode: text - codemirror_mode: text/x-puppet + codemirror_mode: puppet + codemirror_mime_mode: text/x-puppet tm_scope: source.puppet language_id: 299 Pure Data: @@ -3208,12 +3340,14 @@ PureScript: - ".purs" tm_scope: source.purescript ace_mode: haskell - codemirror_mode: text/x-haskell + codemirror_mode: haskell + codemirror_mime_mode: text/x-haskell language_id: 302 Python: type: programming ace_mode: python - codemirror_mode: text/x-python + codemirror_mode: python + codemirror_mime_mode: text/x-python color: "#3572A5" extensions: - ".py" @@ -3288,12 +3422,14 @@ R: interpreters: - Rscript ace_mode: r - codemirror_mode: text/x-rsrc + codemirror_mode: r + codemirror_mime_mode: text/x-rsrc language_id: 307 RAML: type: markup ace_mode: yaml - codemirror_mode: text/x-yaml + codemirror_mode: yaml + codemirror_mime_mode: text/x-yaml tm_scope: source.yaml color: "#77d9fb" extensions: @@ -3339,13 +3475,15 @@ RHTML: aliases: - html+ruby ace_mode: rhtml - codemirror_mode: application/x-erb + codemirror_mode: htmlembedded + codemirror_mime_mode: application/x-erb language_id: 312 RMarkdown: type: prose wrap: true ace_mode: markdown - codemirror_mode: text/x-gfm + codemirror_mode: markdown + codemirror_mime_mode: text/x-gfm extensions: - ".rmd" tm_scope: source.gfm @@ -3358,7 +3496,8 @@ RPM Spec: aliases: - specfile ace_mode: text - codemirror_mode: text/x-rpm-spec + codemirror_mode: rpm + codemirror_mime_mode: text/x-rpm-spec language_id: 314 RUNOFF: type: markup @@ -3461,7 +3600,8 @@ RobotFramework: Rouge: type: programming ace_mode: clojure - codemirror_mode: text/x-clojure + codemirror_mode: clojure + codemirror_mime_mode: text/x-clojure color: "#cc0088" extensions: - ".rg" @@ -3470,7 +3610,8 @@ Rouge: Ruby: type: programming ace_mode: ruby - codemirror_mode: text/x-ruby + codemirror_mode: ruby + codemirror_mime_mode: text/x-ruby color: "#701516" aliases: - jruby @@ -3532,7 +3673,8 @@ Rust: - ".rs" - ".rs.in" ace_mode: rust - codemirror_mode: text/x-rustsrc + codemirror_mode: rust + codemirror_mime_mode: text/x-rustsrc language_id: 327 SAS: type: programming @@ -3541,14 +3683,16 @@ SAS: - ".sas" tm_scope: source.sas ace_mode: text - codemirror_mode: text/x-sas + codemirror_mode: sas + codemirror_mime_mode: text/x-sas language_id: 328 SCSS: type: markup tm_scope: source.scss group: CSS ace_mode: scss - codemirror_mode: text/x-scss + codemirror_mode: css + codemirror_mime_mode: text/x-scss extensions: - ".scss" color: "#CF649A" @@ -3576,7 +3720,8 @@ SPARQL: type: data tm_scope: source.sparql ace_mode: text - codemirror_mode: application/sparql-query + codemirror_mode: sparql + codemirror_mime_mode: application/sparql-query extensions: - ".sparql" - ".rq" @@ -3594,7 +3739,8 @@ SQL: type: data tm_scope: source.sql ace_mode: sql - codemirror_mode: text/x-sql + codemirror_mode: sql + codemirror_mime_mode: text/x-sql extensions: - ".sql" - ".cql" @@ -3608,7 +3754,8 @@ SQL: SQLPL: type: programming ace_mode: sql - codemirror_mode: text/x-sql + codemirror_mode: sql + codemirror_mime_mode: text/x-sql tm_scope: source.sql extensions: - ".sql" @@ -3619,7 +3766,8 @@ SRecode Template: color: "#348a34" tm_scope: source.lisp ace_mode: lisp - codemirror_mode: text/x-common-lisp + codemirror_mode: commonlisp + codemirror_mime_mode: text/x-common-lisp extensions: - ".srt" language_id: 335 @@ -3637,7 +3785,8 @@ SVG: - ".svg" tm_scope: text.xml ace_mode: xml - codemirror_mode: text/xml + codemirror_mode: xml + codemirror_mime_mode: text/xml language_id: 337 Sage: type: programming @@ -3647,7 +3796,8 @@ Sage: - ".sagews" tm_scope: source.python ace_mode: python - codemirror_mode: text/x-python + codemirror_mode: python + codemirror_mime_mode: text/x-python language_id: 338 SaltStack: type: programming @@ -3659,7 +3809,8 @@ SaltStack: - ".sls" tm_scope: source.yaml.salt ace_mode: yaml - codemirror_mode: text/x-yaml + codemirror_mode: yaml + codemirror_mime_mode: text/x-yaml language_id: 339 Sass: type: markup @@ -3668,13 +3819,15 @@ Sass: extensions: - ".sass" ace_mode: sass - codemirror_mode: text/x-sass + codemirror_mode: sass + codemirror_mime_mode: text/x-sass color: "#CF649A" language_id: 340 Scala: type: programming ace_mode: scala - codemirror_mode: text/x-scala + codemirror_mode: clike + codemirror_mime_mode: text/x-scala color: "#c22d40" extensions: - ".scala" @@ -3708,7 +3861,8 @@ Scheme: - gosh - r6rs ace_mode: scheme - codemirror_mode: text/x-scheme + codemirror_mode: scheme + codemirror_mime_mode: text/x-scheme language_id: 343 Scilab: type: programming @@ -3760,7 +3914,8 @@ Shell: - sh - zsh ace_mode: sh - codemirror_mode: text/x-sh + codemirror_mode: shell + codemirror_mime_mode: text/x-sh language_id: 346 ShellSession: type: programming @@ -3771,7 +3926,8 @@ ShellSession: - console tm_scope: text.shell-session ace_mode: sh - codemirror_mode: text/x-sh + codemirror_mode: shell + codemirror_mime_mode: text/x-sh language_id: 347 Shen: type: programming @@ -3797,7 +3953,8 @@ Slim: - ".slim" tm_scope: text.slim ace_mode: text - codemirror_mode: text/x-slim + codemirror_mode: slim + codemirror_mime_mode: text/x-slim language_id: 350 Smali: type: programming @@ -3815,14 +3972,16 @@ Smalltalk: aliases: - squeak ace_mode: text - codemirror_mode: text/x-stsrc + codemirror_mode: smalltalk + codemirror_mime_mode: text/x-stsrc language_id: 352 Smarty: type: programming extensions: - ".tpl" ace_mode: smarty - codemirror_mode: text/x-smarty + codemirror_mode: smarty + codemirror_mime_mode: text/x-smarty tm_scope: text.html.smarty language_id: 353 SourcePawn: @@ -3844,7 +4003,8 @@ Squirrel: - ".nut" tm_scope: source.c++ ace_mode: c_cpp - codemirror_mode: text/x-c++src + codemirror_mode: clike + codemirror_mime_mode: text/x-c++src language_id: 355 Stan: type: programming @@ -3866,7 +4026,8 @@ Standard ML: - ".sml" tm_scope: source.ml ace_mode: text - codemirror_mode: text/x-ocaml + codemirror_mode: mllike + codemirror_mime_mode: text/x-ocaml language_id: 357 Stata: type: programming @@ -3887,6 +4048,7 @@ Stylus: - ".styl" tm_scope: source.stylus ace_mode: stylus + codemirror_mode: stylus language_id: 359 SubRip Text: type: data @@ -3913,7 +4075,8 @@ Swift: extensions: - ".swift" ace_mode: text - codemirror_mode: text/x-swift + codemirror_mode: swift + codemirror_mime_mode: text/x-swift language_id: 362 SystemVerilog: type: programming @@ -3923,7 +4086,8 @@ SystemVerilog: - ".svh" - ".vh" ace_mode: verilog - codemirror_mode: text/x-systemverilog + codemirror_mode: verilog + codemirror_mime_mode: text/x-systemverilog language_id: 363 TLA: type: programming @@ -3938,7 +4102,8 @@ TOML: - ".toml" tm_scope: source.toml ace_mode: toml - codemirror_mode: text/x-toml + codemirror_mode: toml + codemirror_mime_mode: text/x-toml language_id: 365 TXL: type: programming @@ -3958,7 +4123,8 @@ Tcl: - tclsh - wish ace_mode: tcl - codemirror_mode: text/x-tcl + codemirror_mode: tcl + codemirror_mime_mode: text/x-tcl language_id: 367 Tcsh: type: programming @@ -3968,13 +4134,15 @@ Tcsh: - ".csh" tm_scope: source.shell ace_mode: sh - codemirror_mode: text/x-sh + codemirror_mode: shell + codemirror_mime_mode: text/x-sh language_id: 368 TeX: type: markup color: "#3D6117" ace_mode: tex - codemirror_mode: text/x-stex + codemirror_mode: stex + codemirror_mime_mode: text/x-stex wrap: true aliases: - latex @@ -4008,7 +4176,8 @@ Terra: - ".t" color: "#00004c" ace_mode: lua - codemirror_mode: text/x-lua + codemirror_mode: lua + codemirror_mime_mode: text/x-lua interpreters: - lua language_id: 371 @@ -4041,7 +4210,8 @@ Text: Textile: type: prose ace_mode: textile - codemirror_mode: text/x-textile + codemirror_mode: textile + codemirror_mime_mode: text/x-textile wrap: true extensions: - ".textile" @@ -4069,7 +4239,8 @@ Turtle: - ".ttl" tm_scope: source.turtle ace_mode: text - codemirror_mode: text/turtle + codemirror_mode: turtle + codemirror_mime_mode: text/turtle language_id: 376 Twig: type: markup @@ -4078,7 +4249,8 @@ Twig: - ".twig" tm_scope: text.html.twig ace_mode: twig - codemirror_mode: text/x-twig + codemirror_mode: twig + codemirror_mime_mode: text/x-twig language_id: 377 TypeScript: type: programming @@ -4090,13 +4262,16 @@ TypeScript: - ".tsx" tm_scope: source.ts ace_mode: typescript - codemirror_mode: text/x-typescript + codemirror_mode: javascript + codemirror_mode: typescript + codemirror_mime_mode: text/x-typescript language_id: 378 Unified Parallel C: type: programming group: C ace_mode: c_cpp - codemirror_mode: text/x-csrc + codemirror_mode: clike + codemirror_mime_mode: text/x-csrc color: "#4e3617" extensions: - ".upc" @@ -4105,7 +4280,8 @@ Unified Parallel C: Unity3D Asset: type: data ace_mode: yaml - codemirror_mode: text/x-yaml + codemirror_mode: yaml + codemirror_mime_mode: text/x-yaml extensions: - ".anim" - ".asset" @@ -4120,7 +4296,8 @@ Uno: extensions: - ".uno" ace_mode: csharp - codemirror_mode: text/x-csharp + codemirror_mode: clike + codemirror_mime_mode: text/x-csharp tm_scope: source.cs language_id: 381 UnrealScript: @@ -4130,7 +4307,8 @@ UnrealScript: - ".uc" tm_scope: source.java ace_mode: java - codemirror_mode: text/x-java + codemirror_mode: clike + codemirror_mime_mode: text/x-java language_id: 382 UrWeb: type: programming @@ -4164,7 +4342,8 @@ VHDL: - ".vht" - ".vhw" ace_mode: vhdl - codemirror_mode: text/x-vhdl + codemirror_mode: vhdl + codemirror_mime_mode: text/x-vhdl language_id: 385 Vala: type: programming @@ -4181,7 +4360,8 @@ Verilog: - ".v" - ".veo" ace_mode: verilog - codemirror_mode: text/x-verilog + codemirror_mode: verilog + codemirror_mime_mode: text/x-verilog language_id: 387 VimL: type: programming @@ -4219,7 +4399,8 @@ Visual Basic: - vb.net - vbnet ace_mode: text - codemirror_mode: text/x-vb + codemirror_mode: vb + codemirror_mime_mode: text/x-vb language_id: 389 Volt: type: programming @@ -4228,7 +4409,8 @@ Volt: - ".volt" tm_scope: source.d ace_mode: d - codemirror_mode: text/x-d + codemirror_mode: d + codemirror_mime_mode: text/x-d language_id: 390 Vue: type: markup @@ -4237,6 +4419,7 @@ Vue: - ".vue" tm_scope: text.html.vue ace_mode: html + codemirror_mode: vue language_id: 391 Wavefront Material: type: data @@ -4266,7 +4449,8 @@ WebIDL: - ".webidl" tm_scope: source.webidl ace_mode: text - codemirror_mode: text/x-webidl + codemirror_mode: webidl + codemirror_mime_mode: text/x-webidl language_id: 395 World of Warcraft Addon Data: type: data @@ -4292,12 +4476,14 @@ XC: - ".xc" tm_scope: source.xc ace_mode: c_cpp - codemirror_mode: text/x-csrc + codemirror_mode: clike + codemirror_mime_mode: text/x-csrc language_id: 398 XML: type: data ace_mode: xml - codemirror_mode: text/xml + codemirror_mode: xml + codemirror_mime_mode: text/xml aliases: - rss - xsd @@ -4406,7 +4592,8 @@ XPages: - ".xsp.metadata" tm_scope: none ace_mode: xml - codemirror_mode: text/xml + codemirror_mode: xml + codemirror_mime_mode: text/xml language_id: 400 XProc: type: programming @@ -4415,7 +4602,8 @@ XProc: - ".xproc" tm_scope: text.xml ace_mode: xml - codemirror_mode: text/xml + codemirror_mode: xml + codemirror_mime_mode: text/xml language_id: 401 XQuery: type: programming @@ -4427,7 +4615,8 @@ XQuery: - ".xqm" - ".xqy" ace_mode: xquery - codemirror_mode: application/xquery + codemirror_mode: xquery + codemirror_mime_mode: application/xquery tm_scope: source.xq language_id: 402 XS: @@ -4436,7 +4625,8 @@ XS: - ".xs" tm_scope: source.c ace_mode: c_cpp - codemirror_mode: text/x-csrc + codemirror_mode: clike + codemirror_mime_mode: text/x-csrc language_id: 403 XSLT: type: programming @@ -4447,7 +4637,8 @@ XSLT: - ".xsl" tm_scope: text.xml.xsl ace_mode: xml - codemirror_mode: text/xml + codemirror_mode: xml + codemirror_mime_mode: text/xml color: "#EB8CEB" language_id: 404 Xojo: @@ -4484,7 +4675,8 @@ YAML: filenames: - ".clang-format" ace_mode: yaml - codemirror_mode: text/x-yaml + codemirror_mode: yaml + codemirror_mime_mode: text/x-yaml language_id: 407 YANG: type: data @@ -4541,7 +4733,8 @@ eC: edn: type: data ace_mode: clojure - codemirror_mode: text/x-clojure + codemirror_mode: clojure + codemirror_mime_mode: text/x-clojure extensions: - ".edn" tm_scope: source.clojure @@ -4589,12 +4782,14 @@ reStructuredText: - ".rest.txt" - ".rst.txt" ace_mode: text - codemirror_mode: text/x-rst + codemirror_mode: rst + codemirror_mime_mode: text/x-rst language_id: 419 wisp: type: programming ace_mode: clojure - codemirror_mode: text/x-clojure + codemirror_mode: clojure + codemirror_mime_mode: text/x-clojure color: "#7582D1" extensions: - ".wisp" diff --git a/test/test_language.rb b/test/test_language.rb index 04c13683..eda2db2a 100644 --- a/test/test_language.rb +++ b/test/test_language.rb @@ -352,7 +352,17 @@ class TestLanguage < Minitest::Test end def test_codemirror_mode - assert_equal 'text/x-c++src', Language['C++'].codemirror_mode + assert_equal 'ruby', Language['Ruby'].codemirror_mode + assert_equal 'javascript', Language['JavaScript'].codemirror_mode + assert_equal 'clike', Language['C'].codemirror_mode + assert_equal 'clike', Language['C++'].codemirror_mode + end + + def test_codemirror_mime_mode + assert_equal 'text/x-ruby', Language['Ruby'].codemirror_mime_mode + assert_equal 'text/javascript', Language['JavaScript'].codemirror_mime_mode + assert_equal 'text/x-csrc', Language['C'].codemirror_mime_mode + assert_equal 'text/x-c++src', Language['C++'].codemirror_mime_mode end def test_wrap From 0406a5b326dab3f3356ae64d86a7cc0641f9b04f Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Fri, 23 Sep 2016 14:39:15 -0700 Subject: [PATCH 25/45] Fix typescript indent --- lib/linguist/languages.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 36b61047..9562efb3 100755 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -4262,8 +4262,7 @@ TypeScript: - ".tsx" tm_scope: source.ts ace_mode: typescript - codemirror_mode: javascript - codemirror_mode: typescript + codemirror_mode: typescript codemirror_mime_mode: text/x-typescript language_id: 378 Unified Parallel C: From 855f1a1f865675ae4f984f1cfbb28a775732f3be Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Fri, 23 Sep 2016 14:47:49 -0700 Subject: [PATCH 26/45] Validate CodeMirror modes --- .gitmodules | 3 +++ lib/linguist/language.rb | 3 +++ lib/linguist/languages.yml | 12 ++++++------ test/test_language.rb | 8 ++++++++ vendor/CodeMirror | 1 + 5 files changed, 21 insertions(+), 6 deletions(-) create mode 160000 vendor/CodeMirror diff --git a/.gitmodules b/.gitmodules index cbf7a602..832b6423 100644 --- a/.gitmodules +++ b/.gitmodules @@ -791,3 +791,6 @@ [submodule "vendor/grammars/language-babel"] path = vendor/grammars/language-babel url = https://github.com/github-linguist/language-babel +[submodule "vendor/CodeMirror"] + path = vendor/CodeMirror + url = https://github.com/codemirror/CodeMirror diff --git a/lib/linguist/language.rb b/lib/linguist/language.rb index ea88b87f..e4d3cf71 100644 --- a/lib/linguist/language.rb +++ b/lib/linguist/language.rb @@ -402,6 +402,9 @@ module Linguist # Public: Get CodeMirror mode # + # Maps to a directory in the `mode/` source code. + # https://github.com/codemirror/CodeMirror/tree/master/mode + # # Examples # # # => "nil" diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 9562efb3..2b816a92 100755 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -1083,7 +1083,7 @@ Ecere Projects: - ".epj" tm_scope: source.json ace_mode: json - codemirror_mode: json + codemirror_mode: javascript codemirror_mime_mode: application/json language_id: 98 Eiffel: @@ -1632,7 +1632,7 @@ HTML: type: markup tm_scope: text.html.basic ace_mode: html - codemirror_mode: html + codemirror_mode: htmlembedded codemirror_mime_mode: text/html color: "#e44b23" aliases: @@ -2118,7 +2118,7 @@ KiCad: Kit: type: markup ace_mode: html - codemirror_mode: html + codemirror_mode: htmlembedded codemirror_mime_mode: text/html extensions: - ".kit" @@ -2133,7 +2133,7 @@ Kotlin: - ".kts" tm_scope: source.Kotlin ace_mode: text - codemirror_mode: kotlin + codemirror_mode: clike codemirror_mime_mode: text/x-kotlin language_id: 189 LFE: @@ -2419,7 +2419,7 @@ MTML: - ".mtml" tm_scope: text.html.basic ace_mode: html - codemirror_mode: html + codemirror_mode: htmlembedded codemirror_mime_mode: text/html language_id: 218 MUF: @@ -4262,7 +4262,7 @@ TypeScript: - ".tsx" tm_scope: source.ts ace_mode: typescript - codemirror_mode: typescript + codemirror_mode: javascript codemirror_mime_mode: text/x-typescript language_id: 378 Unified Parallel C: diff --git a/test/test_language.rb b/test/test_language.rb index eda2db2a..0d711d36 100644 --- a/test/test_language.rb +++ b/test/test_language.rb @@ -452,6 +452,14 @@ class TestLanguage < Minitest::Test assert missing.empty?, message end + def test_valid_codemirror_mode + Language.all.each do |language| + if mode = language.codemirror_mode + assert File.exist?(File.expand_path("../../vendor/CodeMirror/mode/#{mode}", __FILE__)), "#{mode} isn't a valid CodeMirror mode" + end + end + end + def test_all_popular_languages_exist popular = YAML.load(File.read(File.expand_path("../../lib/linguist/popular.yml", __FILE__))) diff --git a/vendor/CodeMirror b/vendor/CodeMirror new file mode 160000 index 00000000..562e8eff --- /dev/null +++ b/vendor/CodeMirror @@ -0,0 +1 @@ +Subproject commit 562e8eff5b0916d3b63fc59eda9540f8f455c6ed From 3abe081560ca924caaa425bd38212feb3e7daeb9 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Fri, 23 Sep 2016 16:30:38 -0700 Subject: [PATCH 27/45] Validate codemirror modes --- lib/linguist/languages.yml | 42 +++++++++++--------------------------- test/test_language.rb | 26 +++++++++++++++++++++++ 2 files changed, 38 insertions(+), 30 deletions(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 2b816a92..9bb32f8a 100755 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -234,8 +234,6 @@ Apollo Guidance Computer: - ".agc" tm_scope: source.agc ace_mode: assembly_x86 - codemirror_mode: gas - codemirror_mime_mode: text/x-gas language_id: 18 AppleScript: type: programming @@ -298,8 +296,6 @@ Assembly: - ".nasm" tm_scope: source.assembly ace_mode: assembly_x86 - codemirror_mode: gas - codemirror_mime_mode: text/x-gas language_id: 24 Augeas: type: programming @@ -516,8 +512,6 @@ C-ObjDump: - ".c-objdump" tm_scope: objdump.x86asm ace_mode: assembly_x86 - codemirror_mode: gas - codemirror_mime_mode: text/x-gas language_id: 44 C2hs Haskell: type: programming @@ -568,7 +562,7 @@ COLLADA: tm_scope: text.xml ace_mode: xml codemirror_mode: xml - codemirror_mime_mode: text/x-xml + codemirror_mime_mode: text/xml language_id: 49 CSS: type: markup @@ -799,8 +793,6 @@ Cpp-ObjDump: aliases: - c++-objdump ace_mode: assembly_x86 - codemirror_mode: gas - codemirror_mime_mode: text/x-gas language_id: 70 Creole: type: prose @@ -909,8 +901,6 @@ D-ObjDump: - ".d-objdump" tm_scope: objdump.x86asm ace_mode: assembly_x86 - codemirror_mode: gas - codemirror_mime_mode: text/x-gas language_id: 81 DIGITAL Command Language: type: programming @@ -972,7 +962,7 @@ Dart: - dart ace_mode: dart codemirror_mode: dart - codemirror_mime_mode: text/x-dart + codemirror_mime_mode: application/dart language_id: 87 Diff: type: data @@ -1337,8 +1327,6 @@ GAS: - ".ms" tm_scope: source.assembly ace_mode: assembly_x86 - codemirror_mode: gas - codemirror_mime_mode: text/x-gas language_id: 120 GCC Machine Description: type: programming @@ -1632,7 +1620,7 @@ HTML: type: markup tm_scope: text.html.basic ace_mode: html - codemirror_mode: htmlembedded + codemirror_mode: htmlmixed codemirror_mime_mode: text/html color: "#e44b23" aliases: @@ -1671,7 +1659,7 @@ HTML+ECR: extensions: - ".ecr" ace_mode: text - codemirror_mode: htmlembedded + codemirror_mode: htmlmixed codemirror_mime_mode: text/html language_id: 148 HTML+EEX: @@ -1683,7 +1671,7 @@ HTML+EEX: extensions: - ".eex" ace_mode: text - codemirror_mode: htmlembedded + codemirror_mode: htmlmixed codemirror_mime_mode: text/html language_id: 149 HTML+ERB: @@ -1752,7 +1740,6 @@ Handlebars: - ".hbs" tm_scope: text.html.handlebars ace_mode: handlebars - codemirror_mode: handlebars language_id: 155 Harbour: type: programming @@ -1962,8 +1949,6 @@ JSONLD: type: data group: JavaScript ace_mode: javascript - codemirror_mode: javascript - codemirror_mime_mode: application/ld+json extensions: - ".jsonld" tm_scope: source.js @@ -1985,6 +1970,7 @@ JSX: - ".jsx" tm_scope: source.js.jsx ace_mode: javascript + codemirror_mode: jsx codemirror_mime_mode: text/jsx language_id: 178 Jade: @@ -2118,7 +2104,7 @@ KiCad: Kit: type: markup ace_mode: html - codemirror_mode: htmlembedded + codemirror_mode: htmlmixed codemirror_mime_mode: text/html extensions: - ".kit" @@ -2419,7 +2405,7 @@ MTML: - ".mtml" tm_scope: text.html.basic ace_mode: html - codemirror_mode: htmlembedded + codemirror_mode: htmlmixed codemirror_mime_mode: text/html language_id: 218 MUF: @@ -2474,7 +2460,7 @@ Mako: Markdown: type: prose ace_mode: markdown - codemirror_mode: markdown + codemirror_mode: gfm codemirror_mime_mode: text/x-gfm wrap: true extensions: @@ -2837,8 +2823,6 @@ ObjDump: - ".objdump" tm_scope: objdump.x86asm ace_mode: assembly_x86 - codemirror_mode: gas - codemirror_mime_mode: text/x-gas language_id: 256 Objective-C: type: programming @@ -3247,7 +3231,7 @@ PowerShell: type: programming ace_mode: powershell codemirror_mode: powershell - codemirror_mime_mode: text/x-powershell + codemirror_mime_mode: application/x-powershell aliases: - posh extensions: @@ -3482,7 +3466,7 @@ RMarkdown: type: prose wrap: true ace_mode: markdown - codemirror_mode: markdown + codemirror_mode: gfm codemirror_mime_mode: text/x-gfm extensions: - ".rmd" @@ -4048,7 +4032,6 @@ Stylus: - ".styl" tm_scope: source.stylus ace_mode: stylus - codemirror_mode: stylus language_id: 359 SubRip Text: type: data @@ -4263,7 +4246,7 @@ TypeScript: tm_scope: source.ts ace_mode: typescript codemirror_mode: javascript - codemirror_mime_mode: text/x-typescript + codemirror_mime_mode: application/typescript language_id: 378 Unified Parallel C: type: programming @@ -4418,7 +4401,6 @@ Vue: - ".vue" tm_scope: text.html.vue ace_mode: html - codemirror_mode: vue language_id: 391 Wavefront Material: type: data diff --git a/test/test_language.rb b/test/test_language.rb index 0d711d36..48391e59 100644 --- a/test/test_language.rb +++ b/test/test_language.rb @@ -452,6 +452,15 @@ class TestLanguage < Minitest::Test assert missing.empty?, message end + def test_codemirror_modes_present + Language.all.each do |language| + if language.codemirror_mode || language.codemirror_mime_mode + assert language.codemirror_mode, "#{language.inspect} missing CodeMirror mode" + assert language.codemirror_mime_mode, "#{language.inspect} missing CodeMirror MIME mode" + end + end + end + def test_valid_codemirror_mode Language.all.each do |language| if mode = language.codemirror_mode @@ -460,6 +469,23 @@ class TestLanguage < Minitest::Test end end + def test_codemirror_mode_and_mime_defined_by_meta_mapping + meta = File.read(File.expand_path("../../vendor/CodeMirror/mode/meta.js", __FILE__)) + Language.all.each do |language| + next unless language.codemirror_mode && language.codemirror_mime_mode + assert meta.match(/^.+#{Regexp.escape(language.codemirror_mime_mode)}.+#{Regexp.escape(language.codemirror_mode)}.+$/), "#{language.inspect}: #{language.codemirror_mime_mode} not defined under #{language.codemirror_mode}" + end + end + + def test_codemirror_mime_declared_in_mode_file + Language.all.each do |language| + next unless language.codemirror_mode && language.codemirror_mime_mode + filename = File.expand_path("../../vendor/CodeMirror/mode/#{language.codemirror_mode}/#{language.codemirror_mode}.js", __FILE__) + assert File.exist?(filename), "#{filename} does not exist" + assert File.read(filename).match(language.codemirror_mime_mode), "#{language.inspect}: #{language.codemirror_mime_mode} not defined in #{filename}" + end + end + def test_all_popular_languages_exist popular = YAML.load(File.read(File.expand_path("../../lib/linguist/popular.yml", __FILE__))) From 67ed060d378f7e39992c0f520bbb4a408f2f5f81 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Fri, 23 Sep 2016 16:33:12 -0700 Subject: [PATCH 28/45] Assert CodeMirror modes and mime types are valid against source --- lib/linguist/language.rb | 6 +- lib/linguist/languages.yml | 368 ++++++++++++++++++------------------- test/test_grammars.rb | 2 +- test/test_language.rb | 22 +-- 4 files changed, 199 insertions(+), 199 deletions(-) diff --git a/lib/linguist/language.rb b/lib/linguist/language.rb index e4d3cf71..875ef956 100644 --- a/lib/linguist/language.rb +++ b/lib/linguist/language.rb @@ -302,7 +302,7 @@ module Linguist @ace_mode = attributes[:ace_mode] @codemirror_mode = attributes[:codemirror_mode] - @codemirror_mime_mode = attributes[:codemirror_mime_mode] + @codemirror_mime_type = attributes[:codemirror_mime_type] @wrap = attributes[:wrap] || false # Set legacy search term @@ -423,7 +423,7 @@ module Linguist # # => "text/x-csrc" # # Returns a String name or nil - attr_reader :codemirror_mime_mode + attr_reader :codemirror_mime_type # Public: Should language lines be wrapped # @@ -602,7 +602,7 @@ module Linguist :tm_scope => options['tm_scope'], :ace_mode => options['ace_mode'], :codemirror_mode => options['codemirror_mode'], - :codemirror_mime_mode => options['codemirror_mime_mode'], + :codemirror_mime_type => options['codemirror_mime_type'], :wrap => options['wrap'], :group_name => options['group'], :searchable => options.fetch('searchable', true), diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 9bb32f8a..269525ce 100755 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -60,7 +60,7 @@ AGS Script: tm_scope: source.c++ ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-c++src + codemirror_mime_type: text/x-c++src language_id: 2 AMPL: type: programming @@ -99,7 +99,7 @@ APL: tm_scope: source.apl ace_mode: text codemirror_mode: apl - codemirror_mime_mode: text/apl + codemirror_mime_type: text/apl language_id: 6 ASN.1: type: data @@ -110,7 +110,7 @@ ASN.1: tm_scope: source.asn ace_mode: text codemirror_mode: asn.1 - codemirror_mime_mode: text/x-ttcn-asn + codemirror_mime_type: text/x-ttcn-asn language_id: 7 ASP: type: programming @@ -130,7 +130,7 @@ ASP: - ".axd" ace_mode: text codemirror_mode: htmlembedded - codemirror_mime_mode: application/x-aspx + codemirror_mime_type: application/x-aspx language_id: 8 ATS: type: programming @@ -194,7 +194,7 @@ Alpine Abuild: tm_scope: source.shell ace_mode: sh codemirror_mode: shell - codemirror_mime_mode: text/x-sh + codemirror_mime_type: text/x-sh language_id: 14 Ant Build System: type: data @@ -204,7 +204,7 @@ Ant Build System: - build.xml ace_mode: xml codemirror_mode: xml - codemirror_mime_mode: application/xml + codemirror_mime_type: application/xml language_id: 15 ApacheConf: type: markup @@ -224,7 +224,7 @@ Apex: tm_scope: source.java ace_mode: java codemirror_mode: clike - codemirror_mime_mode: text/x-java + codemirror_mime_type: text/x-java language_id: 17 Apollo Guidance Computer: type: programming @@ -263,7 +263,7 @@ Arduino: tm_scope: source.c++ ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-c++src + codemirror_mime_type: text/x-c++src language_id: 21 AsciiDoc: type: prose @@ -434,7 +434,7 @@ Brainfuck: tm_scope: source.bf ace_mode: text codemirror_mode: brainfuck - codemirror_mime_mode: text/x-brainfuck + codemirror_mime_type: text/x-brainfuck language_id: 38 Brightscript: type: programming @@ -462,13 +462,13 @@ C: - tcc ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-csrc + codemirror_mime_type: text/x-csrc language_id: 41 C#: type: programming ace_mode: csharp codemirror_mode: clike - codemirror_mime_mode: text/x-csharp + codemirror_mime_type: text/x-csharp tm_scope: source.cs search_term: csharp color: "#178600" @@ -484,7 +484,7 @@ C++: type: programming ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-c++src + codemirror_mime_type: text/x-c++src search_term: cpp color: "#f34b7d" aliases: @@ -523,7 +523,7 @@ C2hs Haskell: tm_scope: source.haskell ace_mode: haskell codemirror_mode: haskell - codemirror_mime_mode: text/x-haskell + codemirror_mime_type: text/x-haskell language_id: 45 CLIPS: type: programming @@ -541,7 +541,7 @@ CMake: - CMakeLists.txt ace_mode: text codemirror_mode: cmake - codemirror_mime_mode: text/x-cmake + codemirror_mime_type: text/x-cmake language_id: 47 COBOL: type: programming @@ -553,7 +553,7 @@ COBOL: - ".cpy" ace_mode: cobol codemirror_mode: cobol - codemirror_mime_mode: text/x-cobol + codemirror_mime_type: text/x-cobol language_id: 48 COLLADA: type: data @@ -562,14 +562,14 @@ COLLADA: tm_scope: text.xml ace_mode: xml codemirror_mode: xml - codemirror_mime_mode: text/xml + codemirror_mime_type: text/xml language_id: 49 CSS: type: markup tm_scope: source.css ace_mode: css codemirror_mode: css - codemirror_mime_mode: text/css + codemirror_mime_type: text/css color: "#563d7c" extensions: - ".css" @@ -626,7 +626,7 @@ ChucK: tm_scope: source.java ace_mode: java codemirror_mode: clike - codemirror_mime_mode: text/x-java + codemirror_mime_type: text/x-java language_id: 57 Cirru: type: programming @@ -664,7 +664,7 @@ Clojure: type: programming ace_mode: clojure codemirror_mode: clojure - codemirror_mime_mode: text/x-clojure + codemirror_mime_type: text/x-clojure color: "#db5855" extensions: - ".clj" @@ -684,7 +684,7 @@ CoffeeScript: tm_scope: source.coffee ace_mode: coffee codemirror_mode: coffeescript - codemirror_mime_mode: text/x-coffeescript + codemirror_mime_type: text/x-coffeescript color: "#244776" aliases: - coffee @@ -751,7 +751,7 @@ Common Lisp: - ecl ace_mode: lisp codemirror_mode: commonlisp - codemirror_mime_mode: text/x-common-lisp + codemirror_mime_type: text/x-common-lisp language_id: 66 Component Pascal: type: programming @@ -765,7 +765,7 @@ Component Pascal: - objectpascal ace_mode: pascal codemirror_mode: pascal - codemirror_mime_mode: text/x-pascal + codemirror_mime_type: text/x-pascal language_id: 67 Cool: type: programming @@ -809,7 +809,7 @@ Crystal: - ".cr" ace_mode: ruby codemirror_mode: crystal - codemirror_mime_mode: text/x-crystal + codemirror_mime_type: text/x-crystal tm_scope: source.crystal interpreters: - crystal @@ -860,7 +860,7 @@ Cuda: tm_scope: source.cuda-c++ ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-c++src + codemirror_mime_type: text/x-c++src color: "#3A4E3A" language_id: 77 Cycript: @@ -870,7 +870,7 @@ Cycript: tm_scope: source.js ace_mode: javascript codemirror_mode: javascript - codemirror_mime_mode: text/javascript + codemirror_mime_type: text/javascript language_id: 78 Cython: type: programming @@ -883,7 +883,7 @@ Cython: - pyrex ace_mode: text codemirror_mode: python - codemirror_mime_mode: text/x-cython + codemirror_mime_type: text/x-cython language_id: 79 D: type: programming @@ -893,7 +893,7 @@ D: - ".di" ace_mode: d codemirror_mode: d - codemirror_mime_mode: text/x-d + codemirror_mime_type: text/x-d language_id: 80 D-ObjDump: type: data @@ -940,7 +940,7 @@ DTrace: tm_scope: source.c ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-csrc + codemirror_mime_type: text/x-csrc language_id: 85 Darcs Patch: type: data @@ -962,7 +962,7 @@ Dart: - dart ace_mode: dart codemirror_mode: dart - codemirror_mime_mode: application/dart + codemirror_mime_type: application/dart language_id: 87 Diff: type: data @@ -974,7 +974,7 @@ Diff: tm_scope: source.diff ace_mode: diff codemirror_mode: diff - codemirror_mime_mode: text/x-diff + codemirror_mime_type: text/x-diff language_id: 88 Dockerfile: type: data @@ -985,7 +985,7 @@ Dockerfile: - Dockerfile ace_mode: dockerfile codemirror_mode: dockerfile - codemirror_mime_mode: text/x-dockerfile + codemirror_mime_type: text/x-dockerfile language_id: 89 Dogescript: type: programming @@ -1005,7 +1005,7 @@ Dylan: - ".lid" ace_mode: text codemirror_mode: dylan - codemirror_mime_mode: text/x-dylan + codemirror_mime_type: text/x-dylan language_id: 91 E: type: programming @@ -1026,7 +1026,7 @@ ECL: tm_scope: none ace_mode: text codemirror_mode: ecl - codemirror_mime_mode: text/x-ecl + codemirror_mime_type: text/x-ecl language_id: 93 ECLiPSe: type: programming @@ -1053,7 +1053,7 @@ EQ: tm_scope: source.cs ace_mode: csharp codemirror_mode: clike - codemirror_mime_mode: text/x-csharp + codemirror_mime_type: text/x-csharp language_id: 96 Eagle: type: markup @@ -1064,7 +1064,7 @@ Eagle: tm_scope: text.xml ace_mode: xml codemirror_mode: xml - codemirror_mime_mode: text/xml + codemirror_mime_type: text/xml language_id: 97 Ecere Projects: type: data @@ -1074,7 +1074,7 @@ Ecere Projects: tm_scope: source.json ace_mode: json codemirror_mode: javascript - codemirror_mime_mode: application/json + codemirror_mime_type: application/json language_id: 98 Eiffel: type: programming @@ -1083,7 +1083,7 @@ Eiffel: - ".e" ace_mode: eiffel codemirror_mode: eiffel - codemirror_mime_mode: text/x-eiffel + codemirror_mime_type: text/x-eiffel language_id: 99 Elixir: type: programming @@ -1105,7 +1105,7 @@ Elm: tm_scope: source.elm ace_mode: elm codemirror_mode: elm - codemirror_mime_mode: text/x-elm + codemirror_mime_type: text/x-elm language_id: 101 Emacs Lisp: type: programming @@ -1130,7 +1130,7 @@ Emacs Lisp: - ".emacs.desktop" ace_mode: lisp codemirror_mode: commonlisp - codemirror_mime_mode: text/x-common-lisp + codemirror_mime_type: text/x-common-lisp language_id: 102 EmberScript: type: programming @@ -1141,7 +1141,7 @@ EmberScript: tm_scope: source.coffee ace_mode: coffee codemirror_mode: coffeescript - codemirror_mime_mode: text/x-coffeescript + codemirror_mime_type: text/x-coffeescript language_id: 103 Erlang: type: programming @@ -1160,7 +1160,7 @@ Erlang: - rebar.lock ace_mode: erlang codemirror_mode: erlang - codemirror_mime_mode: text/x-erlang + codemirror_mime_type: text/x-erlang interpreters: - escript language_id: 104 @@ -1177,7 +1177,7 @@ F#: tm_scope: source.fsharp ace_mode: text codemirror_mode: mllike - codemirror_mime_mode: text/x-fsharp + codemirror_mime_type: text/x-fsharp language_id: 105 FLUX: type: programming @@ -1203,7 +1203,7 @@ FORTRAN: tm_scope: source.fortran.modern ace_mode: text codemirror_mode: fortran - codemirror_mime_mode: text/x-fortran + codemirror_mime_type: text/x-fortran language_id: 107 Factor: type: programming @@ -1215,7 +1215,7 @@ Factor: - ".factor-rc" ace_mode: text codemirror_mode: factor - codemirror_mime_mode: text/x-factor + codemirror_mime_type: text/x-factor language_id: 108 Fancy: type: programming @@ -1272,7 +1272,7 @@ Forth: - ".fs" ace_mode: forth codemirror_mode: forth - codemirror_mime_mode: text/x-forth + codemirror_mime_type: text/x-forth language_id: 114 FreeMarker: type: programming @@ -1335,7 +1335,7 @@ GCC Machine Description: tm_scope: source.lisp ace_mode: lisp codemirror_mode: commonlisp - codemirror_mime_mode: text/x-common-lisp + codemirror_mime_type: text/x-common-lisp language_id: 121 GDB: type: programming @@ -1381,7 +1381,7 @@ Game Maker Language: tm_scope: source.c++ ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-c++src + codemirror_mime_type: text/x-c++src language_id: 125 Genshi: type: programming @@ -1393,7 +1393,7 @@ Genshi: - xml+kid ace_mode: xml codemirror_mode: xml - codemirror_mime_mode: text/xml + codemirror_mime_type: text/xml language_id: 126 Gentoo Ebuild: type: programming @@ -1403,7 +1403,7 @@ Gentoo Ebuild: tm_scope: source.shell ace_mode: sh codemirror_mode: shell - codemirror_mime_mode: text/x-sh + codemirror_mime_type: text/x-sh language_id: 127 Gentoo Eclass: type: programming @@ -1413,7 +1413,7 @@ Gentoo Eclass: tm_scope: source.shell ace_mode: sh codemirror_mode: shell - codemirror_mime_mode: text/x-sh + codemirror_mime_type: text/x-sh language_id: 128 Gettext Catalog: type: prose @@ -1435,7 +1435,7 @@ Glyph: tm_scope: source.tcl ace_mode: tcl codemirror_mode: tcl - codemirror_mime_mode: text/x-tcl + codemirror_mime_type: text/x-tcl language_id: 130 Gnuplot: type: programming @@ -1457,7 +1457,7 @@ Go: - ".go" ace_mode: golang codemirror_mode: go - codemirror_mime_mode: text/x-go + codemirror_mime_type: text/x-go language_id: 132 Golo: type: programming @@ -1504,7 +1504,7 @@ Grammatical Framework: tm_scope: source.haskell ace_mode: haskell codemirror_mode: haskell - codemirror_mime_mode: text/x-haskell + codemirror_mime_type: text/x-haskell language_id: 137 Graph Modeling Language: type: data @@ -1565,13 +1565,13 @@ Groff: - troff ace_mode: text codemirror_mode: troff - codemirror_mime_mode: text/troff + codemirror_mime_type: text/troff language_id: 141 Groovy: type: programming ace_mode: groovy codemirror_mode: groovy - codemirror_mime_mode: text/x-groovy + codemirror_mime_type: text/x-groovy color: "#e69f56" extensions: - ".groovy" @@ -1594,7 +1594,7 @@ Groovy Server Pages: tm_scope: text.html.jsp ace_mode: jsp codemirror_mode: htmlembedded - codemirror_mime_mode: application/x-jsp + codemirror_mime_type: application/x-jsp language_id: 143 HCL: type: programming @@ -1603,7 +1603,7 @@ HCL: - ".tf" ace_mode: ruby codemirror_mode: ruby - codemirror_mime_mode: text/x-ruby + codemirror_mime_type: text/x-ruby tm_scope: source.ruby language_id: 144 HLSL: @@ -1621,7 +1621,7 @@ HTML: tm_scope: text.html.basic ace_mode: html codemirror_mode: htmlmixed - codemirror_mime_mode: text/html + codemirror_mime_type: text/html color: "#e44b23" aliases: - xhtml @@ -1648,7 +1648,7 @@ HTML+Django: - htmldjango ace_mode: django codemirror_mode: django - codemirror_mime_mode: text/x-django + codemirror_mime_type: text/x-django language_id: 147 HTML+ECR: type: markup @@ -1660,7 +1660,7 @@ HTML+ECR: - ".ecr" ace_mode: text codemirror_mode: htmlmixed - codemirror_mime_mode: text/html + codemirror_mime_type: text/html language_id: 148 HTML+EEX: type: markup @@ -1672,7 +1672,7 @@ HTML+EEX: - ".eex" ace_mode: text codemirror_mode: htmlmixed - codemirror_mime_mode: text/html + codemirror_mime_type: text/html language_id: 149 HTML+ERB: type: markup @@ -1685,7 +1685,7 @@ HTML+ERB: - ".erb.deface" ace_mode: text codemirror_mode: htmlembedded - codemirror_mime_mode: application/x-erb + codemirror_mime_type: application/x-erb language_id: 150 HTML+PHP: type: markup @@ -1695,7 +1695,7 @@ HTML+PHP: - ".phtml" ace_mode: php codemirror_mode: php - codemirror_mime_mode: application/x-httpd-php + codemirror_mime_type: application/x-httpd-php language_id: 151 HTTP: type: data @@ -1704,13 +1704,13 @@ HTTP: tm_scope: source.httpspec ace_mode: text codemirror_mode: http - codemirror_mime_mode: message/http + codemirror_mime_type: message/http language_id: 152 Hack: type: programming ace_mode: php codemirror_mode: php - codemirror_mime_mode: application/x-httpd-php + codemirror_mime_type: application/x-httpd-php extensions: - ".hh" - ".php" @@ -1725,7 +1725,7 @@ Haml: - ".haml.deface" ace_mode: haml codemirror_mode: haml - codemirror_mime_mode: text/x-haml + codemirror_mime_type: text/x-haml color: "#ECE2A9" language_id: 154 Handlebars: @@ -1759,13 +1759,13 @@ Haskell: - runhaskell ace_mode: haskell codemirror_mode: haskell - codemirror_mime_mode: text/x-haskell + codemirror_mime_type: text/x-haskell language_id: 157 Haxe: type: programming ace_mode: haxe codemirror_mode: haxe - codemirror_mime_mode: text/x-haxe + codemirror_mime_type: text/x-haxe color: "#df7900" extensions: - ".hx" @@ -1797,7 +1797,7 @@ IDL: - ".dlm" ace_mode: text codemirror_mode: idl - codemirror_mime_mode: text/x-idl + codemirror_mime_type: text/x-idl language_id: 161 IGOR Pro: type: programming @@ -1822,7 +1822,7 @@ INI: - dosini ace_mode: ini codemirror_mode: properties - codemirror_mime_mode: text/x-properties + codemirror_mime_type: text/x-properties language_id: 163 IRC log: type: data @@ -1923,7 +1923,7 @@ JSON: group: JavaScript ace_mode: json codemirror_mode: javascript - codemirror_mime_mode: application/json + codemirror_mime_type: application/json searchable: false extensions: - ".json" @@ -1943,7 +1943,7 @@ JSON5: tm_scope: source.js ace_mode: javascript codemirror_mode: javascript - codemirror_mime_mode: application/json + codemirror_mime_type: application/json language_id: 175 JSONLD: type: data @@ -1958,7 +1958,7 @@ JSONiq: type: programming ace_mode: jsoniq codemirror_mode: javascript - codemirror_mime_mode: application/json + codemirror_mime_type: application/json extensions: - ".jq" tm_scope: source.jq @@ -1971,7 +1971,7 @@ JSX: tm_scope: source.js.jsx ace_mode: javascript codemirror_mode: jsx - codemirror_mime_mode: text/jsx + codemirror_mime_type: text/jsx language_id: 178 Jade: group: HTML @@ -1982,7 +1982,7 @@ Jade: tm_scope: text.jade ace_mode: jade codemirror_mode: pug - codemirror_mime_mode: text/x-pug + codemirror_mime_type: text/x-pug language_id: 179 Jasmin: type: programming @@ -1995,7 +1995,7 @@ Java: type: programming ace_mode: java codemirror_mode: clike - codemirror_mime_mode: text/x-java + codemirror_mime_type: text/x-java color: "#b07219" extensions: - ".java" @@ -2011,14 +2011,14 @@ Java Server Pages: tm_scope: text.html.jsp ace_mode: jsp codemirror_mode: htmlembedded - codemirror_mime_mode: application/x-jsp + codemirror_mime_type: application/x-jsp language_id: 182 JavaScript: type: programming tm_scope: source.js ace_mode: javascript codemirror_mode: javascript - codemirror_mime_mode: text/javascript + codemirror_mime_type: text/javascript color: "#f1e05a" aliases: - js @@ -2068,13 +2068,13 @@ Julia: color: "#a270ba" ace_mode: julia codemirror_mode: julia - codemirror_mime_mode: text/x-julia + codemirror_mime_type: text/x-julia language_id: 184 Jupyter Notebook: type: markup ace_mode: json codemirror_mode: javascript - codemirror_mime_mode: application/json + codemirror_mime_type: application/json tm_scope: source.json color: "#DA5B0B" extensions: @@ -2105,7 +2105,7 @@ Kit: type: markup ace_mode: html codemirror_mode: htmlmixed - codemirror_mime_mode: text/html + codemirror_mime_type: text/html extensions: - ".kit" tm_scope: text.html.basic @@ -2120,7 +2120,7 @@ Kotlin: tm_scope: source.Kotlin ace_mode: text codemirror_mode: clike - codemirror_mime_mode: text/x-kotlin + codemirror_mime_type: text/x-kotlin language_id: 189 LFE: type: programming @@ -2131,7 +2131,7 @@ LFE: tm_scope: source.lisp ace_mode: lisp codemirror_mode: commonlisp - codemirror_mime_mode: text/x-common-lisp + codemirror_mime_type: text/x-common-lisp language_id: 190 LLVM: type: programming @@ -2165,7 +2165,7 @@ LabVIEW: tm_scope: text.xml ace_mode: xml codemirror_mode: xml - codemirror_mime_mode: text/xml + codemirror_mime_type: text/xml language_id: 194 Lasso: type: programming @@ -2190,7 +2190,7 @@ Latte: tm_scope: text.html.smarty ace_mode: smarty codemirror_mode: smarty - codemirror_mime_mode: text/x-smarty + codemirror_mime_type: text/x-smarty language_id: 196 Lean: type: programming @@ -2207,7 +2207,7 @@ Less: tm_scope: source.css.less ace_mode: less codemirror_mode: css - codemirror_mime_mode: text/css + codemirror_mime_type: text/css color: "#A1D9A1" language_id: 198 Lex: @@ -2292,7 +2292,7 @@ Literate Haskell: tm_scope: text.tex.latex.haskell ace_mode: text codemirror_mode: haskell-literate - codemirror_mime_mode: text/x-literate-haskell + codemirror_mime_type: text/x-literate-haskell language_id: 207 LiveScript: type: programming @@ -2307,7 +2307,7 @@ LiveScript: - Slakefile ace_mode: livescript codemirror_mode: livescript - codemirror_mime_mode: text/x-livescript + codemirror_mime_type: text/x-livescript language_id: 208 Logos: type: programming @@ -2329,7 +2329,7 @@ LookML: type: programming ace_mode: yaml codemirror_mode: yaml - codemirror_mime_mode: text/x-yaml + codemirror_mime_type: text/x-yaml color: "#652B81" extensions: - ".lookml" @@ -2346,7 +2346,7 @@ Lua: type: programming ace_mode: lua codemirror_mode: lua - codemirror_mime_mode: text/x-lua + codemirror_mime_type: text/x-lua color: "#000080" extensions: - ".lua" @@ -2367,7 +2367,7 @@ M: - ".m" ace_mode: text codemirror_mode: mumps - codemirror_mime_mode: text/x-mumps + codemirror_mime_type: text/x-mumps language_id: 214 tm_scope: none M4: @@ -2406,7 +2406,7 @@ MTML: tm_scope: text.html.basic ace_mode: html codemirror_mode: htmlmixed - codemirror_mime_mode: text/html + codemirror_mime_type: text/html language_id: 218 MUF: type: programming @@ -2417,7 +2417,7 @@ MUF: tm_scope: none ace_mode: forth codemirror_mode: forth - codemirror_mime_mode: text/x-forth + codemirror_mime_type: text/x-forth language_id: 219 Makefile: type: programming @@ -2447,7 +2447,7 @@ Makefile: - make ace_mode: makefile codemirror_mode: cmake - codemirror_mime_mode: text/x-cmake + codemirror_mime_type: text/x-cmake language_id: 220 Mako: type: programming @@ -2461,7 +2461,7 @@ Markdown: type: prose ace_mode: markdown codemirror_mode: gfm - codemirror_mime_mode: text/x-gfm + codemirror_mime_type: text/x-gfm wrap: true extensions: - ".md" @@ -2496,7 +2496,7 @@ Mathematica: - mma ace_mode: text codemirror_mode: mathematica - codemirror_mime_mode: text/x-mathematica + codemirror_mime_type: text/x-mathematica language_id: 224 Matlab: type: programming @@ -2508,7 +2508,7 @@ Matlab: - ".m" ace_mode: matlab codemirror_mode: octave - codemirror_mime_mode: text/x-octave + codemirror_mime_type: text/x-octave language_id: 225 Maven POM: type: data @@ -2517,7 +2517,7 @@ Maven POM: - pom.xml ace_mode: xml codemirror_mode: xml - codemirror_mime_mode: text/xml + codemirror_mime_type: text/xml language_id: 226 Max: type: programming @@ -2535,7 +2535,7 @@ Max: tm_scope: source.json ace_mode: json codemirror_mode: javascript - codemirror_mime_mode: application/json + codemirror_mime_type: application/json language_id: 227 MediaWiki: type: prose @@ -2565,7 +2565,7 @@ Metal: tm_scope: source.c++ ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-c++src + codemirror_mime_type: text/x-c++src language_id: 230 MiniD: type: programming @@ -2587,7 +2587,7 @@ Mirah: tm_scope: source.ruby ace_mode: ruby codemirror_mode: ruby - codemirror_mime_mode: text/x-ruby + codemirror_mime_type: text/x-ruby language_id: 232 Modelica: type: programming @@ -2596,7 +2596,7 @@ Modelica: tm_scope: source.modelica ace_mode: text codemirror_mode: modelica - codemirror_mime_mode: text/x-modelica + codemirror_mime_type: text/x-modelica language_id: 233 Modula-2: type: programming @@ -2667,7 +2667,7 @@ NSIS: - ".nsh" ace_mode: text codemirror_mode: nsis - codemirror_mime_mode: text/x-nsis + codemirror_mime_type: text/x-nsis language_id: 242 Nemerle: type: programming @@ -2702,7 +2702,7 @@ NetLogo: tm_scope: source.lisp ace_mode: lisp codemirror_mode: commonlisp - codemirror_mime_mode: text/x-common-lisp + codemirror_mime_type: text/x-common-lisp language_id: 246 NewLisp: type: programming @@ -2717,7 +2717,7 @@ NewLisp: tm_scope: source.lisp ace_mode: lisp codemirror_mode: commonlisp - codemirror_mime_mode: text/x-common-lisp + codemirror_mime_type: text/x-common-lisp language_id: 247 Nginx: type: markup @@ -2731,7 +2731,7 @@ Nginx: - nginx configuration file ace_mode: text codemirror_mode: nginx - codemirror_mime_mode: text/x-nginx-conf + codemirror_mime_type: text/x-nginx-conf color: "#9469E9" language_id: 248 Nimrod: @@ -2780,7 +2780,7 @@ Nu: tm_scope: source.nu ace_mode: scheme codemirror_mode: scheme - codemirror_mime_mode: text/x-scheme + codemirror_mime_type: text/x-scheme interpreters: - nush language_id: 253 @@ -2794,14 +2794,14 @@ NumPy: tm_scope: none ace_mode: text codemirror_mode: python - codemirror_mime_mode: text/x-python + codemirror_mime_type: text/x-python color: "#9C8AF9" language_id: 254 OCaml: type: programming ace_mode: ocaml codemirror_mode: mllike - codemirror_mime_mode: text/x-ocaml + codemirror_mime_type: text/x-ocaml color: "#3be133" extensions: - ".ml" @@ -2837,7 +2837,7 @@ Objective-C: - ".h" ace_mode: objectivec codemirror_mode: clike - codemirror_mime_mode: text/x-objectivec + codemirror_mime_type: text/x-objectivec language_id: 257 Objective-C++: type: programming @@ -2851,7 +2851,7 @@ Objective-C++: - ".mm" ace_mode: objectivec codemirror_mode: clike - codemirror_mime_mode: text/x-objectivec + codemirror_mime_type: text/x-objectivec language_id: 258 Objective-J: type: programming @@ -2897,7 +2897,7 @@ OpenCL: tm_scope: source.c ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-csrc + codemirror_mime_type: text/x-csrc language_id: 263 OpenEdge ABL: type: programming @@ -2921,7 +2921,7 @@ OpenRC runscript: tm_scope: source.shell ace_mode: sh codemirror_mode: shell - codemirror_mime_mode: text/x-sh + codemirror_mime_type: text/x-sh language_id: 265 OpenSCAD: type: programming @@ -2963,7 +2963,7 @@ Oz: tm_scope: source.oz ace_mode: text codemirror_mode: oz - codemirror_mime_mode: text/x-oz + codemirror_mime_type: text/x-oz language_id: 270 PAWN: type: programming @@ -2979,7 +2979,7 @@ PHP: tm_scope: text.html.php ace_mode: php codemirror_mode: php - codemirror_mime_mode: application/x-httpd-php + codemirror_mime_type: application/x-httpd-php color: "#4F5D95" extensions: - ".php" @@ -3003,7 +3003,7 @@ PLSQL: type: programming ace_mode: sql codemirror_mode: sql - codemirror_mime_mode: text/x-plsql + codemirror_mime_type: text/x-plsql tm_scope: none color: "#dad8d8" extensions: @@ -3019,7 +3019,7 @@ PLpgSQL: type: programming ace_mode: pgsql codemirror_mode: sql - codemirror_mime_mode: text/x-sql + codemirror_mime_type: text/x-sql tm_scope: source.sql extensions: - ".sql" @@ -3097,14 +3097,14 @@ Pascal: - instantfpc ace_mode: pascal codemirror_mode: pascal - codemirror_mime_mode: text/x-pascal + codemirror_mime_type: text/x-pascal language_id: 281 Perl: type: programming tm_scope: source.perl ace_mode: perl codemirror_mode: perl - codemirror_mime_mode: text/x-perl + codemirror_mime_type: text/x-perl color: "#0298c3" extensions: - ".pl" @@ -3143,7 +3143,7 @@ Perl6: tm_scope: source.perl6fe ace_mode: perl codemirror_mode: perl - codemirror_mime_mode: text/x-perl + codemirror_mime_type: text/x-perl language_id: 283 Pickle: type: data @@ -3184,7 +3184,7 @@ Pod: type: prose ace_mode: perl codemirror_mode: perl - codemirror_mime_mode: text/x-perl + codemirror_mime_type: text/x-perl wrap: true extensions: - ".pod" @@ -3231,7 +3231,7 @@ PowerShell: type: programming ace_mode: powershell codemirror_mode: powershell - codemirror_mime_mode: application/x-powershell + codemirror_mime_type: application/x-powershell aliases: - posh extensions: @@ -3278,7 +3278,7 @@ Protocol Buffer: tm_scope: source.protobuf ace_mode: protobuf codemirror_mode: protobuf - codemirror_mime_mode: text/x-protobuf + codemirror_mime_type: text/x-protobuf language_id: 297 Public Key: type: data @@ -3297,7 +3297,7 @@ Puppet: - Modulefile ace_mode: text codemirror_mode: puppet - codemirror_mime_mode: text/x-puppet + codemirror_mime_type: text/x-puppet tm_scope: source.puppet language_id: 299 Pure Data: @@ -3325,13 +3325,13 @@ PureScript: tm_scope: source.purescript ace_mode: haskell codemirror_mode: haskell - codemirror_mime_mode: text/x-haskell + codemirror_mime_type: text/x-haskell language_id: 302 Python: type: programming ace_mode: python codemirror_mode: python - codemirror_mime_mode: text/x-python + codemirror_mime_type: text/x-python color: "#3572A5" extensions: - ".py" @@ -3407,13 +3407,13 @@ R: - Rscript ace_mode: r codemirror_mode: r - codemirror_mime_mode: text/x-rsrc + codemirror_mime_type: text/x-rsrc language_id: 307 RAML: type: markup ace_mode: yaml codemirror_mode: yaml - codemirror_mime_mode: text/x-yaml + codemirror_mime_type: text/x-yaml tm_scope: source.yaml color: "#77d9fb" extensions: @@ -3460,14 +3460,14 @@ RHTML: - html+ruby ace_mode: rhtml codemirror_mode: htmlembedded - codemirror_mime_mode: application/x-erb + codemirror_mime_type: application/x-erb language_id: 312 RMarkdown: type: prose wrap: true ace_mode: markdown codemirror_mode: gfm - codemirror_mime_mode: text/x-gfm + codemirror_mime_type: text/x-gfm extensions: - ".rmd" tm_scope: source.gfm @@ -3481,7 +3481,7 @@ RPM Spec: - specfile ace_mode: text codemirror_mode: rpm - codemirror_mime_mode: text/x-rpm-spec + codemirror_mime_type: text/x-rpm-spec language_id: 314 RUNOFF: type: markup @@ -3585,7 +3585,7 @@ Rouge: type: programming ace_mode: clojure codemirror_mode: clojure - codemirror_mime_mode: text/x-clojure + codemirror_mime_type: text/x-clojure color: "#cc0088" extensions: - ".rg" @@ -3595,7 +3595,7 @@ Ruby: type: programming ace_mode: ruby codemirror_mode: ruby - codemirror_mime_mode: text/x-ruby + codemirror_mime_type: text/x-ruby color: "#701516" aliases: - jruby @@ -3658,7 +3658,7 @@ Rust: - ".rs.in" ace_mode: rust codemirror_mode: rust - codemirror_mime_mode: text/x-rustsrc + codemirror_mime_type: text/x-rustsrc language_id: 327 SAS: type: programming @@ -3668,7 +3668,7 @@ SAS: tm_scope: source.sas ace_mode: text codemirror_mode: sas - codemirror_mime_mode: text/x-sas + codemirror_mime_type: text/x-sas language_id: 328 SCSS: type: markup @@ -3676,7 +3676,7 @@ SCSS: group: CSS ace_mode: scss codemirror_mode: css - codemirror_mime_mode: text/x-scss + codemirror_mime_type: text/x-scss extensions: - ".scss" color: "#CF649A" @@ -3705,7 +3705,7 @@ SPARQL: tm_scope: source.sparql ace_mode: text codemirror_mode: sparql - codemirror_mime_mode: application/sparql-query + codemirror_mime_type: application/sparql-query extensions: - ".sparql" - ".rq" @@ -3724,7 +3724,7 @@ SQL: tm_scope: source.sql ace_mode: sql codemirror_mode: sql - codemirror_mime_mode: text/x-sql + codemirror_mime_type: text/x-sql extensions: - ".sql" - ".cql" @@ -3739,7 +3739,7 @@ SQLPL: type: programming ace_mode: sql codemirror_mode: sql - codemirror_mime_mode: text/x-sql + codemirror_mime_type: text/x-sql tm_scope: source.sql extensions: - ".sql" @@ -3751,7 +3751,7 @@ SRecode Template: tm_scope: source.lisp ace_mode: lisp codemirror_mode: commonlisp - codemirror_mime_mode: text/x-common-lisp + codemirror_mime_type: text/x-common-lisp extensions: - ".srt" language_id: 335 @@ -3770,7 +3770,7 @@ SVG: tm_scope: text.xml ace_mode: xml codemirror_mode: xml - codemirror_mime_mode: text/xml + codemirror_mime_type: text/xml language_id: 337 Sage: type: programming @@ -3781,7 +3781,7 @@ Sage: tm_scope: source.python ace_mode: python codemirror_mode: python - codemirror_mime_mode: text/x-python + codemirror_mime_type: text/x-python language_id: 338 SaltStack: type: programming @@ -3794,7 +3794,7 @@ SaltStack: tm_scope: source.yaml.salt ace_mode: yaml codemirror_mode: yaml - codemirror_mime_mode: text/x-yaml + codemirror_mime_type: text/x-yaml language_id: 339 Sass: type: markup @@ -3804,14 +3804,14 @@ Sass: - ".sass" ace_mode: sass codemirror_mode: sass - codemirror_mime_mode: text/x-sass + codemirror_mime_type: text/x-sass color: "#CF649A" language_id: 340 Scala: type: programming ace_mode: scala codemirror_mode: clike - codemirror_mime_mode: text/x-scala + codemirror_mime_type: text/x-scala color: "#c22d40" extensions: - ".scala" @@ -3846,7 +3846,7 @@ Scheme: - r6rs ace_mode: scheme codemirror_mode: scheme - codemirror_mime_mode: text/x-scheme + codemirror_mime_type: text/x-scheme language_id: 343 Scilab: type: programming @@ -3899,7 +3899,7 @@ Shell: - zsh ace_mode: sh codemirror_mode: shell - codemirror_mime_mode: text/x-sh + codemirror_mime_type: text/x-sh language_id: 346 ShellSession: type: programming @@ -3911,7 +3911,7 @@ ShellSession: tm_scope: text.shell-session ace_mode: sh codemirror_mode: shell - codemirror_mime_mode: text/x-sh + codemirror_mime_type: text/x-sh language_id: 347 Shen: type: programming @@ -3938,7 +3938,7 @@ Slim: tm_scope: text.slim ace_mode: text codemirror_mode: slim - codemirror_mime_mode: text/x-slim + codemirror_mime_type: text/x-slim language_id: 350 Smali: type: programming @@ -3957,7 +3957,7 @@ Smalltalk: - squeak ace_mode: text codemirror_mode: smalltalk - codemirror_mime_mode: text/x-stsrc + codemirror_mime_type: text/x-stsrc language_id: 352 Smarty: type: programming @@ -3965,7 +3965,7 @@ Smarty: - ".tpl" ace_mode: smarty codemirror_mode: smarty - codemirror_mime_mode: text/x-smarty + codemirror_mime_type: text/x-smarty tm_scope: text.html.smarty language_id: 353 SourcePawn: @@ -3988,7 +3988,7 @@ Squirrel: tm_scope: source.c++ ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-c++src + codemirror_mime_type: text/x-c++src language_id: 355 Stan: type: programming @@ -4011,7 +4011,7 @@ Standard ML: tm_scope: source.ml ace_mode: text codemirror_mode: mllike - codemirror_mime_mode: text/x-ocaml + codemirror_mime_type: text/x-ocaml language_id: 357 Stata: type: programming @@ -4059,7 +4059,7 @@ Swift: - ".swift" ace_mode: text codemirror_mode: swift - codemirror_mime_mode: text/x-swift + codemirror_mime_type: text/x-swift language_id: 362 SystemVerilog: type: programming @@ -4070,7 +4070,7 @@ SystemVerilog: - ".vh" ace_mode: verilog codemirror_mode: verilog - codemirror_mime_mode: text/x-systemverilog + codemirror_mime_type: text/x-systemverilog language_id: 363 TLA: type: programming @@ -4086,7 +4086,7 @@ TOML: tm_scope: source.toml ace_mode: toml codemirror_mode: toml - codemirror_mime_mode: text/x-toml + codemirror_mime_type: text/x-toml language_id: 365 TXL: type: programming @@ -4107,7 +4107,7 @@ Tcl: - wish ace_mode: tcl codemirror_mode: tcl - codemirror_mime_mode: text/x-tcl + codemirror_mime_type: text/x-tcl language_id: 367 Tcsh: type: programming @@ -4118,14 +4118,14 @@ Tcsh: tm_scope: source.shell ace_mode: sh codemirror_mode: shell - codemirror_mime_mode: text/x-sh + codemirror_mime_type: text/x-sh language_id: 368 TeX: type: markup color: "#3D6117" ace_mode: tex codemirror_mode: stex - codemirror_mime_mode: text/x-stex + codemirror_mime_type: text/x-stex wrap: true aliases: - latex @@ -4160,7 +4160,7 @@ Terra: color: "#00004c" ace_mode: lua codemirror_mode: lua - codemirror_mime_mode: text/x-lua + codemirror_mime_type: text/x-lua interpreters: - lua language_id: 371 @@ -4194,7 +4194,7 @@ Textile: type: prose ace_mode: textile codemirror_mode: textile - codemirror_mime_mode: text/x-textile + codemirror_mime_type: text/x-textile wrap: true extensions: - ".textile" @@ -4223,7 +4223,7 @@ Turtle: tm_scope: source.turtle ace_mode: text codemirror_mode: turtle - codemirror_mime_mode: text/turtle + codemirror_mime_type: text/turtle language_id: 376 Twig: type: markup @@ -4233,7 +4233,7 @@ Twig: tm_scope: text.html.twig ace_mode: twig codemirror_mode: twig - codemirror_mime_mode: text/x-twig + codemirror_mime_type: text/x-twig language_id: 377 TypeScript: type: programming @@ -4246,14 +4246,14 @@ TypeScript: tm_scope: source.ts ace_mode: typescript codemirror_mode: javascript - codemirror_mime_mode: application/typescript + codemirror_mime_type: application/typescript language_id: 378 Unified Parallel C: type: programming group: C ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-csrc + codemirror_mime_type: text/x-csrc color: "#4e3617" extensions: - ".upc" @@ -4263,7 +4263,7 @@ Unity3D Asset: type: data ace_mode: yaml codemirror_mode: yaml - codemirror_mime_mode: text/x-yaml + codemirror_mime_type: text/x-yaml extensions: - ".anim" - ".asset" @@ -4279,7 +4279,7 @@ Uno: - ".uno" ace_mode: csharp codemirror_mode: clike - codemirror_mime_mode: text/x-csharp + codemirror_mime_type: text/x-csharp tm_scope: source.cs language_id: 381 UnrealScript: @@ -4290,7 +4290,7 @@ UnrealScript: tm_scope: source.java ace_mode: java codemirror_mode: clike - codemirror_mime_mode: text/x-java + codemirror_mime_type: text/x-java language_id: 382 UrWeb: type: programming @@ -4325,7 +4325,7 @@ VHDL: - ".vhw" ace_mode: vhdl codemirror_mode: vhdl - codemirror_mime_mode: text/x-vhdl + codemirror_mime_type: text/x-vhdl language_id: 385 Vala: type: programming @@ -4343,7 +4343,7 @@ Verilog: - ".veo" ace_mode: verilog codemirror_mode: verilog - codemirror_mime_mode: text/x-verilog + codemirror_mime_type: text/x-verilog language_id: 387 VimL: type: programming @@ -4382,7 +4382,7 @@ Visual Basic: - vbnet ace_mode: text codemirror_mode: vb - codemirror_mime_mode: text/x-vb + codemirror_mime_type: text/x-vb language_id: 389 Volt: type: programming @@ -4392,7 +4392,7 @@ Volt: tm_scope: source.d ace_mode: d codemirror_mode: d - codemirror_mime_mode: text/x-d + codemirror_mime_type: text/x-d language_id: 390 Vue: type: markup @@ -4431,7 +4431,7 @@ WebIDL: tm_scope: source.webidl ace_mode: text codemirror_mode: webidl - codemirror_mime_mode: text/x-webidl + codemirror_mime_type: text/x-webidl language_id: 395 World of Warcraft Addon Data: type: data @@ -4458,13 +4458,13 @@ XC: tm_scope: source.xc ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-csrc + codemirror_mime_type: text/x-csrc language_id: 398 XML: type: data ace_mode: xml codemirror_mode: xml - codemirror_mime_mode: text/xml + codemirror_mime_type: text/xml aliases: - rss - xsd @@ -4574,7 +4574,7 @@ XPages: tm_scope: none ace_mode: xml codemirror_mode: xml - codemirror_mime_mode: text/xml + codemirror_mime_type: text/xml language_id: 400 XProc: type: programming @@ -4584,7 +4584,7 @@ XProc: tm_scope: text.xml ace_mode: xml codemirror_mode: xml - codemirror_mime_mode: text/xml + codemirror_mime_type: text/xml language_id: 401 XQuery: type: programming @@ -4597,7 +4597,7 @@ XQuery: - ".xqy" ace_mode: xquery codemirror_mode: xquery - codemirror_mime_mode: application/xquery + codemirror_mime_type: application/xquery tm_scope: source.xq language_id: 402 XS: @@ -4607,7 +4607,7 @@ XS: tm_scope: source.c ace_mode: c_cpp codemirror_mode: clike - codemirror_mime_mode: text/x-csrc + codemirror_mime_type: text/x-csrc language_id: 403 XSLT: type: programming @@ -4619,7 +4619,7 @@ XSLT: tm_scope: text.xml.xsl ace_mode: xml codemirror_mode: xml - codemirror_mime_mode: text/xml + codemirror_mime_type: text/xml color: "#EB8CEB" language_id: 404 Xojo: @@ -4657,7 +4657,7 @@ YAML: - ".clang-format" ace_mode: yaml codemirror_mode: yaml - codemirror_mime_mode: text/x-yaml + codemirror_mime_type: text/x-yaml language_id: 407 YANG: type: data @@ -4715,7 +4715,7 @@ edn: type: data ace_mode: clojure codemirror_mode: clojure - codemirror_mime_mode: text/x-clojure + codemirror_mime_type: text/x-clojure extensions: - ".edn" tm_scope: source.clojure @@ -4764,13 +4764,13 @@ reStructuredText: - ".rst.txt" ace_mode: text codemirror_mode: rst - codemirror_mime_mode: text/x-rst + codemirror_mime_type: text/x-rst language_id: 419 wisp: type: programming ace_mode: clojure codemirror_mode: clojure - codemirror_mime_mode: text/x-clojure + codemirror_mime_type: text/x-clojure color: "#7582D1" extensions: - ".wisp" diff --git a/test/test_grammars.rb b/test/test_grammars.rb index 3b03ca81..1b878847 100644 --- a/test/test_grammars.rb +++ b/test/test_grammars.rb @@ -126,7 +126,7 @@ class TestGrammars < Minitest::Test private def submodule_paths - @submodule_paths ||= `git config --list --file "#{File.join(ROOT, ".gitmodules")}"`.lines.grep(/\.path=/).map { |line| line.chomp.split("=", 2).last } + @submodule_paths ||= `git config --list --file "#{File.join(ROOT, ".gitmodules")}"`.lines.grep(/\.path=/).map { |line| line.chomp.split("=", 2).last }.reject { |path| path =~ /CodeMirror/ } end # Returns a hash of submodules in the form of submodule_path => license diff --git a/test/test_language.rb b/test/test_language.rb index 48391e59..1f6d19d2 100644 --- a/test/test_language.rb +++ b/test/test_language.rb @@ -358,11 +358,11 @@ class TestLanguage < Minitest::Test assert_equal 'clike', Language['C++'].codemirror_mode end - def test_codemirror_mime_mode - assert_equal 'text/x-ruby', Language['Ruby'].codemirror_mime_mode - assert_equal 'text/javascript', Language['JavaScript'].codemirror_mime_mode - assert_equal 'text/x-csrc', Language['C'].codemirror_mime_mode - assert_equal 'text/x-c++src', Language['C++'].codemirror_mime_mode + def test_codemirror_mime_type + assert_equal 'text/x-ruby', Language['Ruby'].codemirror_mime_type + assert_equal 'text/javascript', Language['JavaScript'].codemirror_mime_type + assert_equal 'text/x-csrc', Language['C'].codemirror_mime_type + assert_equal 'text/x-c++src', Language['C++'].codemirror_mime_type end def test_wrap @@ -454,9 +454,9 @@ class TestLanguage < Minitest::Test def test_codemirror_modes_present Language.all.each do |language| - if language.codemirror_mode || language.codemirror_mime_mode + if language.codemirror_mode || language.codemirror_mime_type assert language.codemirror_mode, "#{language.inspect} missing CodeMirror mode" - assert language.codemirror_mime_mode, "#{language.inspect} missing CodeMirror MIME mode" + assert language.codemirror_mime_type, "#{language.inspect} missing CodeMirror MIME mode" end end end @@ -472,17 +472,17 @@ class TestLanguage < Minitest::Test def test_codemirror_mode_and_mime_defined_by_meta_mapping meta = File.read(File.expand_path("../../vendor/CodeMirror/mode/meta.js", __FILE__)) Language.all.each do |language| - next unless language.codemirror_mode && language.codemirror_mime_mode - assert meta.match(/^.+#{Regexp.escape(language.codemirror_mime_mode)}.+#{Regexp.escape(language.codemirror_mode)}.+$/), "#{language.inspect}: #{language.codemirror_mime_mode} not defined under #{language.codemirror_mode}" + next unless language.codemirror_mode && language.codemirror_mime_type + assert meta.match(/^.+#{Regexp.escape(language.codemirror_mime_type)}.+#{Regexp.escape(language.codemirror_mode)}.+$/), "#{language.inspect}: #{language.codemirror_mime_type} not defined under #{language.codemirror_mode}" end end def test_codemirror_mime_declared_in_mode_file Language.all.each do |language| - next unless language.codemirror_mode && language.codemirror_mime_mode + next unless language.codemirror_mode && language.codemirror_mime_type filename = File.expand_path("../../vendor/CodeMirror/mode/#{language.codemirror_mode}/#{language.codemirror_mode}.js", __FILE__) assert File.exist?(filename), "#{filename} does not exist" - assert File.read(filename).match(language.codemirror_mime_mode), "#{language.inspect}: #{language.codemirror_mime_mode} not defined in #{filename}" + assert File.read(filename).match(language.codemirror_mime_type), "#{language.inspect}: #{language.codemirror_mime_type} not defined in #{filename}" end end From e424e8e88cf41424351be0377cee5b55b0e0152f Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Fri, 23 Sep 2016 16:41:16 -0700 Subject: [PATCH 29/45] Linguist 4.8.15 --- lib/linguist/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linguist/version.rb b/lib/linguist/version.rb index 920b08ea..8218aafe 100644 --- a/lib/linguist/version.rb +++ b/lib/linguist/version.rb @@ -1,3 +1,3 @@ module Linguist - VERSION = "4.8.14" + VERSION = "4.8.15" end From 41593b3ea77466103648b630458cb33fc8f42b4b Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Sun, 25 Sep 2016 16:41:49 +0200 Subject: [PATCH 30/45] Update season package in npm to fix parsing error Fixes the Travis build failures --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 827997e5..c2e22111 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "repository": "https://github.com/github/linguist", "dependencies": { - "season": "~>5.0" + "season": "~>5.4" }, "license": "MIT" } From f8ce42e169062e080a24ded5152a2e7d827519b6 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Mon, 26 Sep 2016 19:51:51 +0200 Subject: [PATCH 31/45] Recognize licenses in READMEs using Licensee Since v7.0.0 Licensee can detect license text in READMEs Using this, we might be able to rely solely on Licensee in the future --- test/test_grammars.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_grammars.rb b/test/test_grammars.rb index 1b878847..c4204327 100644 --- a/test/test_grammars.rb +++ b/test/test_grammars.rb @@ -141,7 +141,7 @@ class TestGrammars < Minitest::Test # Given the path to a submodule, return its SPDX-compliant license key def submodule_license(submodule) # Prefer Licensee to detect a submodule's license - project = Licensee::FSProject.new(submodule) + project = Licensee::FSProject.new(submodule, detect_readme: true) return project.license.key if project.license # We know a license file exists, but Licensee wasn't able to detect the license, From 524337d07b22a63ea2b5415b80ab617eacb7c9d5 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Mon, 26 Sep 2016 19:38:26 +0200 Subject: [PATCH 32/45] Use Licensee hashes to uniquely identify licenses Since v6.1.0, Licensee exposes the hash of the license We can use it to uniquely identify unrecognized licenses, Thus, tests will fail if the content of an unrecognized license changes Projects for which no license was found are kept in the whitelist --- test/test_grammars.rb | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/test/test_grammars.rb b/test/test_grammars.rb index c4204327..5680e4fb 100644 --- a/test/test_grammars.rb +++ b/test/test_grammars.rb @@ -5,14 +5,16 @@ class TestGrammars < Minitest::Test # List of projects that are allowed without licenses PROJECT_WHITELIST = [ - "vendor/grammars/factor", - "vendor/grammars/go-tmbundle", - "vendor/grammars/jflex.tmbundle", "vendor/grammars/language-csharp", - "vendor/grammars/language-viml", "vendor/grammars/sublimeassembly" ].freeze + HASH_WHITELIST = [ + "ebae2d87e06d3acef075d049fcfc8958c0364863", # go-tmbundle + "ff21db2554d69d78b2220db5615b16bbba0788d3", # factor + "b9a7428fd036eed8503995e06e989180c276b17d" # jflex.tmbundle + ].freeze + # List of allowed SPDX license names LICENSE_WHITELIST = %w[ apache-2.0 @@ -90,7 +92,10 @@ class TestGrammars < Minitest::Test end def test_submodules_have_approved_licenses - unapproved = submodule_licenses.reject { |k,v| LICENSE_WHITELIST.include?(v) || PROJECT_WHITELIST.include?(k) }.map { |k,v| "#{k}: #{v}"} + unapproved = submodule_licenses.reject { |k,v| LICENSE_WHITELIST.include?(v) || + PROJECT_WHITELIST.include?(k) || + HASH_WHITELIST.include?(v) } + .map { |k,v| "#{k}: #{v}"} message = "The following submodules have unapproved licenses:\n* #{unapproved.join("\n* ")}\n" message << "The license must be added to the LICENSE_WHITELIST in /test/test_grammars.rb once approved." assert_equal [], unapproved, message @@ -139,6 +144,7 @@ class TestGrammars < Minitest::Test end # Given the path to a submodule, return its SPDX-compliant license key + # If the license is unrecognized, return its hash def submodule_license(submodule) # Prefer Licensee to detect a submodule's license project = Licensee::FSProject.new(submodule, detect_readme: true) @@ -155,7 +161,16 @@ class TestGrammars < Minitest::Test # Neither Licensee nor our own regex was able to detect the license, let's check the readme files = Dir[File.join(ROOT, submodule, "*")] if readme = files.find { |file| File.basename(file) =~ /\Areadme\b/i } - classify_license(readme) + license = classify_license(readme) + return license if license + end + + # We know a license exists, but no method was able to recognize it. + # We return the license hash in this case, to uniquely identify it. + if project.license_file + return project.license_file.hash + elsif project.readme + return project.readme.hash end end From ebe85788abf3fb769fc36ec38e34232aec362c26 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Mon, 26 Sep 2016 20:18:42 +0200 Subject: [PATCH 33/45] Rely solely on Licensee to recognize licenses Remove our own license classification code Add hashes for any project which does not have a standard license body Add projects for which a license was not found to the whitelist Requires Licensee v8.6.0 to correctly recognize TextMate bundles' .mdown README --- github-linguist.gemspec | 2 +- test/test_grammars.rb | 82 ++++++++++++++++++----------------------- 2 files changed, 37 insertions(+), 47 deletions(-) diff --git a/github-linguist.gemspec b/github-linguist.gemspec index 10a85f34..f9f6ccc6 100644 --- a/github-linguist.gemspec +++ b/github-linguist.gemspec @@ -26,6 +26,6 @@ Gem::Specification.new do |s| s.add_development_dependency 'yajl-ruby' s.add_development_dependency 'color-proximity', '~> 0.2.1' s.add_development_dependency 'licensed' - s.add_development_dependency 'licensee', '>= 8.3.0' + s.add_development_dependency 'licensee', '>= 8.6.0' end diff --git a/test/test_grammars.rb b/test/test_grammars.rb index 5680e4fb..4b7d0116 100644 --- a/test/test_grammars.rb +++ b/test/test_grammars.rb @@ -5,14 +5,47 @@ class TestGrammars < Minitest::Test # List of projects that are allowed without licenses PROJECT_WHITELIST = [ - "vendor/grammars/language-csharp", - "vendor/grammars/sublimeassembly" + "vendor/grammars/sublimeassembly", + "vendor/grammars/Sublime-Lasso", + "vendor/grammars/ant.tmbundle", + "vendor/grammars/sublime-spintools", + "vendor/grammars/SublimeGDB", + "vendor/grammars/blitzmax" ].freeze HASH_WHITELIST = [ + "bc12b3b4917eab9aedb87ec1305c2a4376e34fd1", # TextMate bundles + "16c4748566b3dd996594af0410a1875b22d3a2b3", # language-yaml and atom-salt "ebae2d87e06d3acef075d049fcfc8958c0364863", # go-tmbundle "ff21db2554d69d78b2220db5615b16bbba0788d3", # factor - "b9a7428fd036eed8503995e06e989180c276b17d" # jflex.tmbundle + "b9a7428fd036eed8503995e06e989180c276b17d", # jflex.tmbundle + "da39a3ee5e6b4b0d3255bfef95601890afd80709", # SCSS.tmbundle + "5f772ff20ddf3dbac1ec9b6a98c5aa50ace555b2", # gradle.tmbundle + "b5432a1e1055de7eeede2dddf91e009480651fd6", # jasmin-sublime + "74143c4d2a5649eb179105afcb37f466558c22ce", # language-clojure + "760471435f5ab0b9dc99a628203cd8f9156d28ce", # language-coffee-script + "330e6d465e26bdd232aafcd3f5dba6a1d098a20e", # language-csharp + "70fb557a431891c2d634c33fa7367feab5066fd6", # language-javascript + "e0528c23cd967f999e058f1408ccb5b7237daaba", # language-python + "8653305b358375d0fced85dc24793b99919b11ef", # language-shellscript + "9f0c0b0926a18f5038e455e8df60221125fc3111", # elixir-tmbundle + "90af581219debd4e90ef041b46c294e8b4ae6d14", # mako-tmbundle + "b9b24778619dce325b651f0d77cbc72e7ae0b0a3", # Julia.tmbundle + "2d4f8807be850efd925751a8e1839cfc539985b0", # actionscript3-tmbundle + "e06722add999e7428048abcc067cd85f1f7ca71c", # r.tmbundle + "50b14a0e3f03d7ca754dac42ffb33302b5882b78", # smalltalk-tmbundle + "eafbc4a2f283752858e6908907f3c0c90188785b", # gap-tmbundle + "1faa3a44cac6070f22384332434af37dfaaf2f70", # Stylus + "c87e7e574fca543941650e5b0a144b44c02c55d8", # language-crystal + "c78ec142ac3126cf639cfd67bd646ed8226d8b74", # atom-language-purescript + "341d7f66806fc41d081133d6e51ade856352e056", # FreeMarker.tmbundle + "15a394f6bc43400946570b299aee8ae264a1e3ff", # language-renpy + "c9118c370411f2f049c746c0fd096554e877aea2", # perl6fe + "8ccf886749c32fb7e65d4d1316a7ed0479c93dc9", # language-less + "2f03492b52d7dd83b4e7472f01b87c6121e5b1a4", # monkey + "9d8b5626cfe00f3c8a076173913c3b0312b5b122", # ejs-tmbundle + "5977a55c75bb4612004451a56b0b4c22d9d3311d", # language-graphql + "bdab9fdc21e6790b479ccb5945b78bc0f6ce2493" # language-blade ].freeze # List of allowed SPDX license names @@ -150,21 +183,6 @@ class TestGrammars < Minitest::Test project = Licensee::FSProject.new(submodule, detect_readme: true) return project.license.key if project.license - # We know a license file exists, but Licensee wasn't able to detect the license, - # Let's try our own more permissive regex method - if project.license_file - path = File.expand_path project.license_file.path, submodule - license = classify_license(path) - return license if license - end - - # Neither Licensee nor our own regex was able to detect the license, let's check the readme - files = Dir[File.join(ROOT, submodule, "*")] - if readme = files.find { |file| File.basename(file) =~ /\Areadme\b/i } - license = classify_license(readme) - return license if license - end - # We know a license exists, but no method was able to recognize it. # We return the license hash in this case, to uniquely identify it. if project.license_file @@ -173,32 +191,4 @@ class TestGrammars < Minitest::Test return project.readme.hash end end - - def classify_license(path) - content = File.read(path) - return unless content =~ /\blicen[cs]e\b/i - if content.include?("Apache License") && content.include?("2.0") - "apache-2.0" - elsif content.include?("GNU") && content =~ /general/i && content =~ /public/i - if content =~ /version 2/i - "gpl-2.0" - elsif content =~ /version 3/i - "gpl-3.0" - end - elsif content.include?("GPL") && content.include?("http://www.gnu.org/licenses/gpl.html") - "gpl-3.0" - elsif content.include?("Creative Commons Attribution-Share Alike 3.0") - "cc-by-sa-3.0" - elsif content.include?("tidy-license.txt") || content.include?("If not otherwise specified (see below)") || content.include?("Permission to copy, use, modify, sell and distribute this") - "textmate" - elsif content.include?("Permission is hereby granted") || content =~ /\bMIT\b/ - "mit" - elsif content.include?("This package is provided as-is and is placed in the Public Domain") - "public" - elsif content.include?("http://www.wtfpl.net/txt/copying/") - "wtfpl" - elsif content.include?("zlib") && content.include?("license") && content.include?("2. Altered source versions must be plainly marked as such") - "zlib" - end - end end From 05b536fc617e954a587cb2a7b758108d6189faf0 Mon Sep 17 00:00:00 2001 From: alexruperez Date: Wed, 28 Sep 2016 11:24:17 +0200 Subject: [PATCH 34/45] Added BuddyBuildSDK.framework to lib/linguist/vendor.yml --- lib/linguist/vendor.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/linguist/vendor.yml b/lib/linguist/vendor.yml index e500f85d..0e6daa27 100644 --- a/lib/linguist/vendor.yml +++ b/lib/linguist/vendor.yml @@ -229,6 +229,9 @@ # Fabric - Fabric.framework/ +# BuddyBuild +- BuddyBuildSDK.framework/ + # git config files - gitattributes$ - gitignore$ From e7e8a7d8358791115034179cede5447d2744f47e Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Sat, 24 Sep 2016 17:19:32 +0200 Subject: [PATCH 35/45] Tests for .m heuristic rules --- test/test_heuristics.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/test_heuristics.rb b/test/test_heuristics.rb index 62e5a050..5e677e27 100644 --- a/test/test_heuristics.rb +++ b/test/test_heuristics.rb @@ -145,6 +145,18 @@ class TestHeuristcs < Minitest::Test }) end + def test_m_by_heuristics + assert_heuristics({ + "Objective-C" => all_fixtures("Objective-C", "*.m"), + "Mercury" => all_fixtures("Mercury", "*.m"), + "MUF" => all_fixtures("MUF", "*.m"), + "M" => all_fixtures("M", "MDB.m"), + "Mathematica" => all_fixtures("Mathematica", "*.m") - all_fixtures("Mathematica", "Problem12.m"), + "Matlab" => all_fixtures("Matlab", "create_ieee_paper_plots.m"), + "Limbo" => all_fixtures("Limbo", "*.m") + }) + end + # Candidate languages = ["C++", "Objective-C"] def test_obj_c_by_heuristics # Only calling out '.h' filenames as these are the ones causing issues From cd9401c424eb79a38ad99cd22cc8a6be1c3152d7 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Sat, 24 Sep 2016 17:56:36 +0200 Subject: [PATCH 36/45] Enable testing absence of heuristic result --- test/test_heuristics.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/test_heuristics.rb b/test/test_heuristics.rb index 5e677e27..fc694632 100644 --- a/test/test_heuristics.rb +++ b/test/test_heuristics.rb @@ -29,7 +29,11 @@ class TestHeuristcs < Minitest::Test hash.each do |language, blobs| Array(blobs).each do |blob| result = Heuristics.call(file_blob(blob), candidates) - assert_equal [Language[language]], result, "Failed for #{blob}" + if language.nil? + assert_equal [], result, "Failed for #{blob}" + else + assert_equal [Language[language]], result, "Failed for #{blob}" + end end end end From 3ae89b48ba94401305e5fdbf6c18ffc056cbd398 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Sat, 24 Sep 2016 17:57:31 +0200 Subject: [PATCH 37/45] Improve Mathematica's heuristic rule Use closing of Mathematica comment instead of opening Unit test to check that test file is not detected as Mathematica anymore --- lib/linguist/heuristics.rb | 2 +- samples/Objective-C/cocoa_monitor.m | 413 ++++++++++++++++++++++++++++ test/test_heuristics.rb | 5 +- 3 files changed, 417 insertions(+), 3 deletions(-) create mode 100644 samples/Objective-C/cocoa_monitor.m diff --git a/lib/linguist/heuristics.rb b/lib/linguist/heuristics.rb index 2c99b476..66ef2ecb 100644 --- a/lib/linguist/heuristics.rb +++ b/lib/linguist/heuristics.rb @@ -244,7 +244,7 @@ module Linguist Language["MUF"] elsif /^\s*;/.match(data) Language["M"] - elsif /^\s*\(\*/.match(data) + elsif /\*\)$/.match(data) Language["Mathematica"] elsif /^\s*%/.match(data) Language["Matlab"] diff --git a/samples/Objective-C/cocoa_monitor.m b/samples/Objective-C/cocoa_monitor.m new file mode 100644 index 00000000..9a384b69 --- /dev/null +++ b/samples/Objective-C/cocoa_monitor.m @@ -0,0 +1,413 @@ +//======================================================================== +// GLFW 3.3 OS X - www.glfw.org +//------------------------------------------------------------------------ +// Copyright (c) 2002-2006 Marcus Geelnard +// Copyright (c) 2006-2016 Camilla Berglund +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would +// be appreciated but is not required. +// +// 2. Altered source versions must be plainly marked as such, and must not +// be misrepresented as being the original software. +// +// 3. This notice may not be removed or altered from any source +// distribution. +// +//======================================================================== + +#include "internal.h" + +#include +#include + +#include +#include +#include +#include + + +// Get the name of the specified display +// +static char* getDisplayName(CGDirectDisplayID displayID) +{ + char* name; + CFDictionaryRef info, names; + CFStringRef value; + CFIndex size; + + // NOTE: This uses a deprecated function because Apple has + // (as of January 2015) not provided any alternative + info = IODisplayCreateInfoDictionary(CGDisplayIOServicePort(displayID), + kIODisplayOnlyPreferredName); + names = CFDictionaryGetValue(info, CFSTR(kDisplayProductName)); + + if (!names || !CFDictionaryGetValueIfPresent(names, CFSTR("en_US"), + (const void**) &value)) + { + // This may happen if a desktop Mac is running headless + _glfwInputError(GLFW_PLATFORM_ERROR, + "Cocoa: Failed to retrieve display name"); + + CFRelease(info); + return strdup("Unknown"); + } + + size = CFStringGetMaximumSizeForEncoding(CFStringGetLength(value), + kCFStringEncodingUTF8); + name = calloc(size + 1, 1); + CFStringGetCString(value, name, size, kCFStringEncodingUTF8); + + CFRelease(info); + + return name; +} + +// Check whether the display mode should be included in enumeration +// +static GLFWbool modeIsGood(CGDisplayModeRef mode) +{ + uint32_t flags = CGDisplayModeGetIOFlags(mode); + if (!(flags & kDisplayModeValidFlag) || !(flags & kDisplayModeSafeFlag)) + return GLFW_FALSE; + + if (flags & kDisplayModeInterlacedFlag) + return GLFW_FALSE; + + if (flags & kDisplayModeStretchedFlag) + return GLFW_FALSE; + + CFStringRef format = CGDisplayModeCopyPixelEncoding(mode); + if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) && + CFStringCompare(format, CFSTR(IO32BitDirectPixels), 0)) + { + CFRelease(format); + return GLFW_FALSE; + } + + CFRelease(format); + return GLFW_TRUE; +} + +// Convert Core Graphics display mode to GLFW video mode +// +static GLFWvidmode vidmodeFromCGDisplayMode(CGDisplayModeRef mode, + CVDisplayLinkRef link) +{ + GLFWvidmode result; + result.width = (int) CGDisplayModeGetWidth(mode); + result.height = (int) CGDisplayModeGetHeight(mode); + result.refreshRate = (int) CGDisplayModeGetRefreshRate(mode); + + if (result.refreshRate == 0) + { + const CVTime time = CVDisplayLinkGetNominalOutputVideoRefreshPeriod(link); + if (!(time.flags & kCVTimeIsIndefinite)) + result.refreshRate = (int) (time.timeScale / (double) time.timeValue); + } + + CFStringRef format = CGDisplayModeCopyPixelEncoding(mode); + + if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) == 0) + { + result.redBits = 5; + result.greenBits = 5; + result.blueBits = 5; + } + else + { + result.redBits = 8; + result.greenBits = 8; + result.blueBits = 8; + } + + CFRelease(format); + return result; +} + +// Starts reservation for display fading +// +static CGDisplayFadeReservationToken beginFadeReservation(void) +{ + CGDisplayFadeReservationToken token = kCGDisplayFadeReservationInvalidToken; + + if (CGAcquireDisplayFadeReservation(5, &token) == kCGErrorSuccess) + CGDisplayFade(token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0.0, 0.0, 0.0, TRUE); + + return token; +} + +// Ends reservation for display fading +// +static void endFadeReservation(CGDisplayFadeReservationToken token) +{ + if (token != kCGDisplayFadeReservationInvalidToken) + { + CGDisplayFade(token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, FALSE); + CGReleaseDisplayFadeReservation(token); + } +} + + +////////////////////////////////////////////////////////////////////////// +////// GLFW internal API ////// +////////////////////////////////////////////////////////////////////////// + +// Change the current video mode +// +GLFWbool _glfwSetVideoModeNS(_GLFWmonitor* monitor, const GLFWvidmode* desired) +{ + CFArrayRef modes; + CFIndex count, i; + CVDisplayLinkRef link; + CGDisplayModeRef native = NULL; + GLFWvidmode current; + const GLFWvidmode* best; + + best = _glfwChooseVideoMode(monitor, desired); + _glfwPlatformGetVideoMode(monitor, ¤t); + if (_glfwCompareVideoModes(¤t, best) == 0) + return GLFW_TRUE; + + CVDisplayLinkCreateWithCGDisplay(monitor->ns.displayID, &link); + + modes = CGDisplayCopyAllDisplayModes(monitor->ns.displayID, NULL); + count = CFArrayGetCount(modes); + + for (i = 0; i < count; i++) + { + CGDisplayModeRef dm = (CGDisplayModeRef) CFArrayGetValueAtIndex(modes, i); + if (!modeIsGood(dm)) + continue; + + const GLFWvidmode mode = vidmodeFromCGDisplayMode(dm, link); + if (_glfwCompareVideoModes(best, &mode) == 0) + { + native = dm; + break; + } + } + + if (native) + { + if (monitor->ns.previousMode == NULL) + monitor->ns.previousMode = CGDisplayCopyDisplayMode(monitor->ns.displayID); + + CGDisplayFadeReservationToken token = beginFadeReservation(); + CGDisplaySetDisplayMode(monitor->ns.displayID, native, NULL); + endFadeReservation(token); + } + + CFRelease(modes); + CVDisplayLinkRelease(link); + + if (!native) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "Cocoa: Monitor mode list changed"); + return GLFW_FALSE; + } + + return GLFW_TRUE; +} + +// Restore the previously saved (original) video mode +// +void _glfwRestoreVideoModeNS(_GLFWmonitor* monitor) +{ + if (monitor->ns.previousMode) + { + CGDisplayFadeReservationToken token = beginFadeReservation(); + CGDisplaySetDisplayMode(monitor->ns.displayID, + monitor->ns.previousMode, NULL); + endFadeReservation(token); + + CGDisplayModeRelease(monitor->ns.previousMode); + monitor->ns.previousMode = NULL; + } +} + + +////////////////////////////////////////////////////////////////////////// +////// GLFW platform API ////// +////////////////////////////////////////////////////////////////////////// + +_GLFWmonitor** _glfwPlatformGetMonitors(int* count) +{ + uint32_t i, found = 0, displayCount; + _GLFWmonitor** monitors; + CGDirectDisplayID* displays; + + *count = 0; + + CGGetOnlineDisplayList(0, NULL, &displayCount); + displays = calloc(displayCount, sizeof(CGDirectDisplayID)); + monitors = calloc(displayCount, sizeof(_GLFWmonitor*)); + + CGGetOnlineDisplayList(displayCount, displays, &displayCount); + + for (i = 0; i < displayCount; i++) + { + _GLFWmonitor* monitor; + + if (CGDisplayIsAsleep(displays[i])) + continue; + + const CGSize size = CGDisplayScreenSize(displays[i]); + char* name = getDisplayName(displays[i]); + + monitor = _glfwAllocMonitor(name, size.width, size.height); + monitor->ns.displayID = displays[i]; + monitor->ns.unitNumber = CGDisplayUnitNumber(displays[i]); + + free(name); + + found++; + monitors[found - 1] = monitor; + } + + free(displays); + + *count = found; + return monitors; +} + +GLFWbool _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second) +{ + // HACK: Compare unit numbers instead of display IDs to work around display + // replacement on machines with automatic graphics switching + return first->ns.unitNumber == second->ns.unitNumber; +} + +void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos) +{ + const CGRect bounds = CGDisplayBounds(monitor->ns.displayID); + + if (xpos) + *xpos = (int) bounds.origin.x; + if (ypos) + *ypos = (int) bounds.origin.y; +} + +GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count) +{ + CFArrayRef modes; + CFIndex found, i, j; + GLFWvidmode* result; + CVDisplayLinkRef link; + + *count = 0; + + CVDisplayLinkCreateWithCGDisplay(monitor->ns.displayID, &link); + + modes = CGDisplayCopyAllDisplayModes(monitor->ns.displayID, NULL); + found = CFArrayGetCount(modes); + result = calloc(found, sizeof(GLFWvidmode)); + + for (i = 0; i < found; i++) + { + CGDisplayModeRef dm = (CGDisplayModeRef) CFArrayGetValueAtIndex(modes, i); + if (!modeIsGood(dm)) + continue; + + const GLFWvidmode mode = vidmodeFromCGDisplayMode(dm, link); + + for (j = 0; j < *count; j++) + { + if (_glfwCompareVideoModes(result + j, &mode) == 0) + break; + } + + // Skip duplicate modes + if (i < *count) + continue; + + (*count)++; + result[*count - 1] = mode; + } + + CFRelease(modes); + CVDisplayLinkRelease(link); + return result; +} + +void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode *mode) +{ + CGDisplayModeRef displayMode; + CVDisplayLinkRef link; + + CVDisplayLinkCreateWithCGDisplay(monitor->ns.displayID, &link); + + displayMode = CGDisplayCopyDisplayMode(monitor->ns.displayID); + *mode = vidmodeFromCGDisplayMode(displayMode, link); + CGDisplayModeRelease(displayMode); + + CVDisplayLinkRelease(link); +} + +void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp) +{ + uint32_t i, size = CGDisplayGammaTableCapacity(monitor->ns.displayID); + CGGammaValue* values = calloc(size * 3, sizeof(CGGammaValue)); + + CGGetDisplayTransferByTable(monitor->ns.displayID, + size, + values, + values + size, + values + size * 2, + &size); + + _glfwAllocGammaArrays(ramp, size); + + for (i = 0; i < size; i++) + { + ramp->red[i] = (unsigned short) (values[i] * 65535); + ramp->green[i] = (unsigned short) (values[i + size] * 65535); + ramp->blue[i] = (unsigned short) (values[i + size * 2] * 65535); + } + + free(values); +} + +void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp) +{ + int i; + CGGammaValue* values = calloc(ramp->size * 3, sizeof(CGGammaValue)); + + for (i = 0; i < ramp->size; i++) + { + values[i] = ramp->red[i] / 65535.f; + values[i + ramp->size] = ramp->green[i] / 65535.f; + values[i + ramp->size * 2] = ramp->blue[i] / 65535.f; + } + + CGSetDisplayTransferByTable(monitor->ns.displayID, + ramp->size, + values, + values + ramp->size, + values + ramp->size * 2); + + free(values); +} + + +////////////////////////////////////////////////////////////////////////// +////// GLFW native API ////// +////////////////////////////////////////////////////////////////////////// + +GLFWAPI CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* handle) +{ + _GLFWmonitor* monitor = (_GLFWmonitor*) handle; + _GLFW_REQUIRE_INIT_OR_RETURN(kCGNullDirectDisplay); + return monitor->ns.displayID; +} + diff --git a/test/test_heuristics.rb b/test/test_heuristics.rb index fc694632..8575de3a 100644 --- a/test/test_heuristics.rb +++ b/test/test_heuristics.rb @@ -151,13 +151,14 @@ class TestHeuristcs < Minitest::Test def test_m_by_heuristics assert_heuristics({ - "Objective-C" => all_fixtures("Objective-C", "*.m"), + "Objective-C" => all_fixtures("Objective-C", "*.m") - all_fixtures("Objective-C", "cocoa_monitor.m"), "Mercury" => all_fixtures("Mercury", "*.m"), "MUF" => all_fixtures("MUF", "*.m"), "M" => all_fixtures("M", "MDB.m"), "Mathematica" => all_fixtures("Mathematica", "*.m") - all_fixtures("Mathematica", "Problem12.m"), "Matlab" => all_fixtures("Matlab", "create_ieee_paper_plots.m"), - "Limbo" => all_fixtures("Limbo", "*.m") + "Limbo" => all_fixtures("Limbo", "*.m"), + nil => ["Objective-C/cocoa_monitor.m"] }) end From 82167063da5c26e61d34647731bddfa71e845a8c Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Tue, 27 Sep 2016 22:58:44 +0200 Subject: [PATCH 38/45] Tests to ensure the whitelists are up-to-date --- test/test_grammars.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/test_grammars.rb b/test/test_grammars.rb index 4b7d0116..15701423 100644 --- a/test/test_grammars.rb +++ b/test/test_grammars.rb @@ -134,6 +134,21 @@ class TestGrammars < Minitest::Test assert_equal [], unapproved, message end + def test_whitelisted_submodules_dont_have_licenses + licensed = submodule_licenses.reject { |k,v| v.nil? }.select { |k,v| PROJECT_WHITELIST.include?(k) } + message = "The following whitelisted submodules have a license:\n* #{licensed.keys.join("\n* ")}\n" + message << "Please remove them from the project whitelist." + assert_equal Hash.new, licensed, message + end + + def test_whitelisted_hashes_dont_have_licenses + used_hashes = submodule_licenses.values.reject { |v| v.nil? || LICENSE_WHITELIST.include?(v) } + unused_hashes = HASH_WHITELIST - used_hashes + message = "The following whitelisted license hashes are unused:\n* #{unused_hashes.join("\n* ")}\n" + message << "Please remove them from the hash whitelist." + assert_equal Array.new, unused_hashes, message + end + def test_submodules_whitelist_has_no_extra_entries skip("Need to work out how to handle dual-licensed entities") extra_whitelist_entries = PROJECT_WHITELIST - submodule_licenses.select { |k,v| v.nil? }.keys From eeec48198ad01ee7d9f4d13a9f1ea4cc7670f667 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Tue, 27 Sep 2016 23:09:30 +0200 Subject: [PATCH 39/45] Update submodules --- test/test_grammars.rb | 3 --- vendor/CodeMirror | 2 +- vendor/grammars/Lean.tmbundle | 2 +- vendor/grammars/Sublime-SQF-Language | 2 +- vendor/grammars/SublimeGDB | 2 +- vendor/grammars/elixir-tmbundle | 2 +- vendor/grammars/language-csharp | 2 +- vendor/grammars/language-graphql | 2 +- vendor/grammars/language-javascript | 2 +- vendor/grammars/language-shellscript | 2 +- vendor/grammars/language-yaml | 2 +- vendor/grammars/objective-c.tmbundle | 2 +- vendor/grammars/sublimeassembly | 2 +- 13 files changed, 12 insertions(+), 15 deletions(-) diff --git a/test/test_grammars.rb b/test/test_grammars.rb index 15701423..5548c9e5 100644 --- a/test/test_grammars.rb +++ b/test/test_grammars.rb @@ -5,11 +5,9 @@ class TestGrammars < Minitest::Test # List of projects that are allowed without licenses PROJECT_WHITELIST = [ - "vendor/grammars/sublimeassembly", "vendor/grammars/Sublime-Lasso", "vendor/grammars/ant.tmbundle", "vendor/grammars/sublime-spintools", - "vendor/grammars/SublimeGDB", "vendor/grammars/blitzmax" ].freeze @@ -44,7 +42,6 @@ class TestGrammars < Minitest::Test "8ccf886749c32fb7e65d4d1316a7ed0479c93dc9", # language-less "2f03492b52d7dd83b4e7472f01b87c6121e5b1a4", # monkey "9d8b5626cfe00f3c8a076173913c3b0312b5b122", # ejs-tmbundle - "5977a55c75bb4612004451a56b0b4c22d9d3311d", # language-graphql "bdab9fdc21e6790b479ccb5945b78bc0f6ce2493" # language-blade ].freeze diff --git a/vendor/CodeMirror b/vendor/CodeMirror index 562e8eff..39ffcd87 160000 --- a/vendor/CodeMirror +++ b/vendor/CodeMirror @@ -1 +1 @@ -Subproject commit 562e8eff5b0916d3b63fc59eda9540f8f455c6ed +Subproject commit 39ffcd8701c35363ab754b82c3c171913ecf478e diff --git a/vendor/grammars/Lean.tmbundle b/vendor/grammars/Lean.tmbundle index a1a3818e..fa8fcd28 160000 --- a/vendor/grammars/Lean.tmbundle +++ b/vendor/grammars/Lean.tmbundle @@ -1 +1 @@ -Subproject commit a1a3818ecfdd1365ec01ac3894106b5a70b455ac +Subproject commit fa8fcd2856945972a64dcba6f288cfb632a424c8 diff --git a/vendor/grammars/Sublime-SQF-Language b/vendor/grammars/Sublime-SQF-Language index 984606e1..0e72aacb 160000 --- a/vendor/grammars/Sublime-SQF-Language +++ b/vendor/grammars/Sublime-SQF-Language @@ -1 +1 @@ -Subproject commit 984606e146b4ef96753db7f3a16adeee2b152e24 +Subproject commit 0e72aacb4ae6174509a47f3d20913254f3620947 diff --git a/vendor/grammars/SublimeGDB b/vendor/grammars/SublimeGDB index d9a512da..c39ee600 160000 --- a/vendor/grammars/SublimeGDB +++ b/vendor/grammars/SublimeGDB @@ -1 +1 @@ -Subproject commit d9a512da6eb23b8193a8696a6fc1afd77f310d6e +Subproject commit c39ee600ba734ba8724b70e120ddb8b0ac600587 diff --git a/vendor/grammars/elixir-tmbundle b/vendor/grammars/elixir-tmbundle index d632e68d..fb4a0114 160000 --- a/vendor/grammars/elixir-tmbundle +++ b/vendor/grammars/elixir-tmbundle @@ -1 +1 @@ -Subproject commit d632e68d09f179cb9fefdb5cfb16db44f39b216a +Subproject commit fb4a0114268b5d816861d3b4048b166cf55160b1 diff --git a/vendor/grammars/language-csharp b/vendor/grammars/language-csharp index db446854..2af2edde 160000 --- a/vendor/grammars/language-csharp +++ b/vendor/grammars/language-csharp @@ -1 +1 @@ -Subproject commit db4468545a8a1a5e76518e0ae2f6697dc21bf686 +Subproject commit 2af2edde5518bc01ff384452d6b77b46b73e2652 diff --git a/vendor/grammars/language-graphql b/vendor/grammars/language-graphql index 4be0d1ae..40d3aef4 160000 --- a/vendor/grammars/language-graphql +++ b/vendor/grammars/language-graphql @@ -1 +1 @@ -Subproject commit 4be0d1ae7b847182d4a743f43f44416d7f7d6423 +Subproject commit 40d3aef44756438290037c25f3427d18552df7b8 diff --git a/vendor/grammars/language-javascript b/vendor/grammars/language-javascript index 101a00ad..537f3a5d 160000 --- a/vendor/grammars/language-javascript +++ b/vendor/grammars/language-javascript @@ -1 +1 @@ -Subproject commit 101a00adb2925e7e397bd6374b4aa04e4d17479d +Subproject commit 537f3a5d9574ff385fe217006ba0df75eb8eeea3 diff --git a/vendor/grammars/language-shellscript b/vendor/grammars/language-shellscript index 6d66ca58..8d75aeaf 160000 --- a/vendor/grammars/language-shellscript +++ b/vendor/grammars/language-shellscript @@ -1 +1 @@ -Subproject commit 6d66ca58c030a9509b9e01ce57456511c529eb6a +Subproject commit 8d75aeaf52881d7712487005d31749fe41e458a6 diff --git a/vendor/grammars/language-yaml b/vendor/grammars/language-yaml index 784cecc6..29d4b546 160000 --- a/vendor/grammars/language-yaml +++ b/vendor/grammars/language-yaml @@ -1 +1 @@ -Subproject commit 784cecc64ffdb891f6a7fbba62e476b0c833e66f +Subproject commit 29d4b546f265c71cdd35abcb5b382f07c1760239 diff --git a/vendor/grammars/objective-c.tmbundle b/vendor/grammars/objective-c.tmbundle index d80c2bbd..2fc124a6 160000 --- a/vendor/grammars/objective-c.tmbundle +++ b/vendor/grammars/objective-c.tmbundle @@ -1 +1 @@ -Subproject commit d80c2bbdef8433b3d2cf0af660ea460d97009735 +Subproject commit 2fc124a68a66018bedcf75ed8fd74d92acdb483f diff --git a/vendor/grammars/sublimeassembly b/vendor/grammars/sublimeassembly index edb58c82..2599ced0 160000 --- a/vendor/grammars/sublimeassembly +++ b/vendor/grammars/sublimeassembly @@ -1 +1 @@ -Subproject commit edb58c8246fc92ab4003bb039b5e0d09c706574f +Subproject commit 2599ced076f6147d6456a60de9ff83f2507c9e6e From c863435c84e53c8edfd02e5341950cf01a63e47c Mon Sep 17 00:00:00 2001 From: Lars Brinkhoff Date: Mon, 3 Oct 2016 19:22:34 +0200 Subject: [PATCH 40/45] Add ' all_fixtures("Markdown", "*.md"), + "GCC machine description" => all_fixtures("GCC machine description", "*.md") + }) + end + # Candidate languages = ["C++", "Objective-C"] def test_obj_c_by_heuristics # Only calling out '.h' filenames as these are the ones causing issues From 7e63399196d88ed763c6d082a93ef9830e28e5e8 Mon Sep 17 00:00:00 2001 From: Alhadis Date: Tue, 4 Oct 2016 17:23:45 +1100 Subject: [PATCH 41/45] Delete colour property for ASN.1 language This is classified on GitHub as "data", so the colour it's assigned only wastes valuable "real estate" when checking colour proximity. References: github/linguist#3113 --- lib/linguist/languages.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 269525ce..f9c7c628 100755 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -103,7 +103,6 @@ APL: language_id: 6 ASN.1: type: data - color: "#aeead0" extensions: - ".asn" - ".asn1" From e38cc75da57504655fa37192d47350bb1586f7f5 Mon Sep 17 00:00:00 2001 From: Alhadis Date: Wed, 5 Oct 2016 13:06:49 +1100 Subject: [PATCH 42/45] Update ASN.1 grammar This stops the ASN.1 submodule from being flagged as modified due to its .DS_Store file being wiped locally by an automated process. References: ajLangley12/language-asn1#1 --- vendor/grammars/language-asn1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/grammars/language-asn1 b/vendor/grammars/language-asn1 index bc3811c7..208b6d9e 160000 --- a/vendor/grammars/language-asn1 +++ b/vendor/grammars/language-asn1 @@ -1 +1 @@ -Subproject commit bc3811c7706476e48f5085660b72b18ad028314f +Subproject commit 208b6d9ebe873180b109a286a481ca6639200d3e From 20b8188384710444e3388b969cfe0327e1d4465d Mon Sep 17 00:00:00 2001 From: Alhadis Date: Wed, 5 Oct 2016 16:14:33 +1100 Subject: [PATCH 43/45] Add test to guard against unused colours --- lib/linguist/languages.yml | 2 +- test/test_language.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index f9c7c628..c890ae40 100755 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -19,7 +19,7 @@ # language_id - Integer used as a language-name-independent indexed field so that we can rename # languages in Linguist without reindexing all the code on GitHub. Must not be # changed for existing languages without the explicit permission of GitHub staff. -# color - CSS hex color to represent the language. +# color - CSS hex color to represent the language. Only used if type is "programming" or "prose" # tm_scope - The TextMate scope that represents this programming # language. This should match one of the scopes listed in # the grammars.yml file. Use "none" if there is no grammar diff --git a/test/test_language.rb b/test/test_language.rb index 1f6d19d2..08f60112 100644 --- a/test/test_language.rb +++ b/test/test_language.rb @@ -494,4 +494,11 @@ class TestLanguage < Minitest::Test message << missing.sort.join("\n") assert missing.empty?, message end + + def test_no_unused_colours + Language.all.each do |language| + next unless language.type == :data || language.type == :prose + assert !language.color, "Unused colour assigned to #{language.name}" + end + end end From 12695fee2f2752aa5a207025523b53ba1a410e62 Mon Sep 17 00:00:00 2001 From: Alhadis Date: Wed, 5 Oct 2016 21:36:22 +1100 Subject: [PATCH 44/45] Add ".make" as a Makefile file extension --- lib/linguist/languages.yml | 1 + samples/Makefile/file-icons.make | 134 +++++++++++++++++++++++++++++++ 2 files changed, 135 insertions(+) create mode 100644 samples/Makefile/file-icons.make diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 269525ce..c8234cb5 100755 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -2429,6 +2429,7 @@ Makefile: extensions: - ".mak" - ".d" + - ".make" - ".mk" - ".mkfile" filenames: diff --git a/samples/Makefile/file-icons.make b/samples/Makefile/file-icons.make new file mode 100644 index 00000000..09d8a78c --- /dev/null +++ b/samples/Makefile/file-icons.make @@ -0,0 +1,134 @@ +charmap := charmap.md +font-name := file-icons +font-folder := dist +font-config := icomoon.json +icon-size := 34 +icon-folder := svg +repo-name := Alhadis/FileIcons +svg := $(wildcard $(icon-folder)/*.svg) +last-commit = $(shell git log -1 --oneline --no-abbrev | cut -d' ' -f1) + + +all: unpack $(font-folder)/$(font-name).woff2 charmap + + +# Aliases +unpack: $(font-folder)/$(font-name).ttf +charmap: $(charmap) + + +# Extract a downloaded IcoMoon folder +$(font-folder)/%.ttf: %.zip + @rm -rf $(font-folder) tmp $(font-config) + @unzip -qd tmp $^ + @mv tmp/fonts $(font-folder) + @mv tmp/selection.json $(font-config) + @rm -rf tmp $^ + @perl -pi -e 's|^( {2})+|"\t" x (length($$&)/2)|ge' $(font-config) + @echo "" >> $(font-config) # Ensure trailing newline + @echo "Files extracted." + + +# Generate a WOFF2 file from a TTF +%.woff2: %.ttf + @[ ! -f $@ ] && { \ + hash woff2_compress 2>/dev/null || { \ + echo >&2 "WOFF2 conversion tools not found. Consult the readme file."; \ + exit 2; \ + }; \ + woff2_compress $^ >/dev/null; \ + echo "WOFF2 file generated."; \ + }; + + + +# Clean up SVG source +lint: $(svg) + @perl -0777 -pi -e '\ + s/\r\n/\n/g; \ + s/\s*<\/g>//gmi; \ + s/\s*<\/g>//gmi; \ + s/\s+(id|viewBox|xml:space)="[^"]*"/ /gmi; \ + s/]*>//gi; \ + s/<\?xml.*?\?>//gi; \ + s///gm; \ + s/ style="enable-background:.*?;"//gmi; \ + s/"\s+>/">/g; \ + s/\x20{2,}/ /g; \ + s/[\t\n]+//gm;' $^ + + + +# Generate/update character map +$(charmap): + @./create-map.pl -r=$(repo-name) -i=$(icon-folder) --size=$(icon-size) $(font-folder)/$(font-name).svg $@ + + + + +# POSIX systems only: reattach hard links to File-Icons package +relink: + @$(call need-var,ATOM_FILE_ICONS,ERROR_NO_PKG) + @ln -f $(font-folder)/$(font-name).woff2 $(wildcard $(ATOM_FILE_ICONS)/fonts/file-icons-*.woff2) + + + +# Force an icon's preview to be refreshed on GitHub +cachebust: + @$(call need-var,icon,ERROR_NO_ICON) + @base="https://cdn.rawgit.com/Alhadis/FileIcons/"; \ + perl -pi -e 's{$$base\K\w+(?=/svg/$(icon:%.svg=%)\.svg")}{$(last-commit)}ig;' $(charmap) + + +# Dummy task to improve feedback if `cachebust` is mistyped +icon: + $(call need-var,,ERROR_UNDEF_ICON) + + + +# Reset unstaged changes/additions in object directories +clean: + @git clean -fd $(font-folder) + @git checkout -- $(font-folder) 2>/dev/null || true + + +# Delete extracted and generated files +distclean: + @rm -rf $(font-folder) + + +.PHONY: clean distclean $(charmap) cachebust icon +.ONESHELL: + + +# Error message shown to users attempting to run `make relink` without a link +ERROR_NO_PKG := Environment variable ATOM_FILE_ICONS not found. \ + | \ + | Try this instead:\ + | \ + | \ make relink ATOM_FILE_ICONS=/path/to/your/file-icons/installation | + + +# Error message shown when running `make cachebust` without an icon +ERROR_NO_ICON := No icon specified. Task aborted.| \ + | Usage: \ + | \ make icon=file[.svg] cachebust \ + | \ + | Examples: \ + | \ make icon=Manpage cachebust \ + | \ make icon=APL.svg cachebust | + + +# Shown if user tries running `make icon NAME cachebust` by mistake +ERROR_UNDEF_ICON := No task named \"icon\". \ + | \ + | Did you mean this? \ + | \ make icon=NAME cachebust | + + + +# If the given value is empty, die with an error message +need = @$(if $(1),,echo $(subst | ,$$'\n',$(2)); exit 2) + +# Like `need`, but uses variable names instead of string values +need-var = @$(call need,$($(1)),$($(2))) From c8d376754e3be7d292c93b3d39622969f270bc7b Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Sun, 9 Oct 2016 17:55:50 +0200 Subject: [PATCH 45/45] Improve documentation on the language_id --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eb7532e0..cfba2222 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,13 +27,13 @@ We try only to add languages once they have some usage on GitHub. In most cases To add support for a new language: -0. Add an entry for your language to [`languages.yml`][languages]. +0. Add an entry for your language to [`languages.yml`][languages]. Omit the `language_id` field for now. 0. Add a grammar for your language. Please only add grammars that have [one of these licenses](https://github.com/github/linguist/blob/257425141d4e2a5232786bf0b13c901ada075f93/vendor/licenses/config.yml#L2-L11). 0. Add your grammar as a submodule: `git submodule add https://github.com/JaneSmith/MyGrammar vendor/grammars/MyGrammar`. 0. Add your grammar to [`grammars.yml`][grammars] by running `script/convert-grammars --add vendor/grammars/MyGrammar`. 0. Download the license for the grammar: `script/licensed`. Be careful to only commit the file for the new grammar, as this script may update licenses for other grammars as well. 0. Add samples for your language to the [samples directory][samples] in the correct subdirectory. -0. Add a `language_id` for your language. See `script/set-language-ids` for more information. **You should only ever need to run `script/set-language-ids --update`. Anything other than this risks breaking GitHub search :cry:** +0. Add a `language_id` for your language using `script/set-language-ids`. **You should only ever need to run `script/set-language-ids --update`. Anything other than this risks breaking GitHub search :cry:** 0. Open a pull request, linking to a [GitHub search result](https://github.com/search?utf8=%E2%9C%93&q=extension%3Aboot+NOT+nothack&type=Code&ref=searchresults) showing in-the-wild usage. In addition, if your new language defines an extension that's already listed in [`languages.yml`][languages] (such as `.foo`) then sometimes a few more steps will need to be taken: