diff --git a/.gitmodules b/.gitmodules index 47cf934f..35cc9de8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -169,9 +169,6 @@ [submodule "vendor/grammars/sublime-idris"] path = vendor/grammars/sublime-idris url = https://github.com/laughedelic/sublime-idris -[submodule "vendor/grammars/sublime-better-typescript"] - path = vendor/grammars/sublime-better-typescript - url = https://github.com/lavrton/sublime-better-typescript [submodule "vendor/grammars/moonscript-tmbundle"] path = vendor/grammars/moonscript-tmbundle url = https://github.com/leafo/moonscript-tmbundle @@ -397,9 +394,6 @@ [submodule "vendor/grammars/processing.tmbundle"] path = vendor/grammars/processing.tmbundle url = https://github.com/textmate/processing.tmbundle -[submodule "vendor/grammars/prolog.tmbundle"] - path = vendor/grammars/prolog.tmbundle - url = https://github.com/textmate/prolog.tmbundle [submodule "vendor/grammars/python-django.tmbundle"] path = vendor/grammars/python-django.tmbundle url = https://github.com/textmate/python-django.tmbundle @@ -671,6 +665,12 @@ [submodule "vendor/grammars/st2-zonefile"] path = vendor/grammars/st2-zonefile url = https://github.com/sixty4k/st2-zonefile +[submodule "vendor/grammars/sublimeprolog"] + path = vendor/grammars/sublimeprolog + url = https://github.com/alnkpa/sublimeprolog [submodule "vendor/grammars/sublime-aspectj"] path = vendor/grammars/sublime-aspectj url = https://github.com/pchaigno/sublime-aspectj +[submodule "vendor/grammars/sublime-typescript"] + path = vendor/grammars/sublime-typescript + url = https://github.com/Microsoft/TypeScript-Sublime-Plugin diff --git a/README.md b/README.md index 374851fb..4ca08af1 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ See [Troubleshooting](#troubleshooting) and [`CONTRIBUTING.md`](/CONTRIBUTING.md The Language stats bar is built by aggregating the languages of each file in that repository. If it is reporting a language that you don't expect: 0. Click on the name of the language in the stats bar to see a list of the files that are identified as that language. -0. If you see files that you didn't write, consider moving the files into one of the [paths for vendored code](https://github.com/github/linguist/blob/master/lib/linguist/vendor.yml), or use the [manual overrides](#overrides) feature to ignore them. +0. If you see files that you didn't write, consider moving the files into one of the [paths for vendored code](/lib/linguist/vendor.yml), or use the [manual overrides](#overrides) feature to ignore them. 0. If the files are being misclassified, search for [open issues][issues] to see if anyone else has already reported the issue. Any information you an add, especially links to public repositories, is helpful. 0. If there are no reported issues of this misclassification, [open an issue][new-issue] and include a link to the repository or a sample of the code that is being misclassified. diff --git a/grammars.yml b/grammars.yml index 88d21d39..ae9ff92c 100644 --- a/grammars.yml +++ b/grammars.yml @@ -432,8 +432,6 @@ vendor/grammars/powershell: - source.powershell vendor/grammars/processing.tmbundle: - source.processing -vendor/grammars/prolog.tmbundle: -- source.prolog vendor/grammars/protobuf-tmbundle: - source.protobuf vendor/grammars/puppet-textmate-bundle: @@ -484,8 +482,6 @@ vendor/grammars/sublime-aspectj/: - source.aspectj vendor/grammars/sublime-befunge: - source.befunge -vendor/grammars/sublime-better-typescript: -- source.ts vendor/grammars/sublime-bsv: - source.bsv vendor/grammars/sublime-cirru: @@ -524,6 +520,9 @@ vendor/grammars/sublime-text-ox/: - source.ox vendor/grammars/sublime-text-pig-latin/: - source.pig_latin +vendor/grammars/sublime-typescript/: +- source.ts +- source.tsx vendor/grammars/sublime-varnish: - source.varnish.vcl vendor/grammars/sublime_cobol: @@ -534,6 +533,9 @@ vendor/grammars/sublime_cobol: vendor/grammars/sublime_man_page_support: - source.man - text.groff +vendor/grammars/sublimeprolog/: +- source.prolog +- source.prolog.eclipse vendor/grammars/sublimetext-cuda-cpp: - source.cuda-c++ vendor/grammars/swift.tmbundle: diff --git a/lib/linguist/heuristics.rb b/lib/linguist/heuristics.rb index fc8699c5..7c523fa8 100644 --- a/lib/linguist/heuristics.rb +++ b/lib/linguist/heuristics.rb @@ -33,7 +33,7 @@ module Linguist # # Examples # - # disambiguate "Perl", "Prolog" do |data| + # disambiguate ".pm" do |data| # if data.include?("use strict") # Language["Perl"] # elsif /^[^#]+:-/.match(data) @@ -102,7 +102,7 @@ module Linguist end end - disambiguate ".pm" do |data| + disambiguate ".pm", ".t" do |data| if /^(use v6|(my )?class|module)/.match(data) Language["Perl6"] elsif /use strict|use\s+v?5\./.match(data) @@ -112,7 +112,7 @@ module Linguist disambiguate ".ecl" do |data| if /^[^#]+:-/.match(data) - Language["Prolog"] + Language["ECLiPSe"] elsif data.include?(":=") Language["ECL"] end diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index ef3b0968..8936b0f4 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -843,6 +843,14 @@ ECL: tm_scope: none ace_mode: text +ECLiPSe: + type: programming + group: prolog + extensions: + - .ecl + tm_scope: source.prolog.eclipse + ace_mode: prolog + Eagle: type: markup color: "#814C05" @@ -2628,11 +2636,11 @@ Prolog: color: "#74283c" extensions: - .pl - - .ecl - .pro - .prolog interpreters: - swipl + tm_scope: source.prolog ace_mode: prolog Propeller Spin: @@ -2813,7 +2821,7 @@ RMarkdown: ace_mode: markdown extensions: - .rmd - tm_scope: none + tm_scope: source.gfm Racket: type: programming diff --git a/samples/Prolog/or-constraint.ecl b/samples/ECLiPSe/or-constraint.ecl similarity index 100% rename from samples/Prolog/or-constraint.ecl rename to samples/ECLiPSe/or-constraint.ecl diff --git a/test/test_grammars.rb b/test/test_grammars.rb index 6aab2935..65a7e6de 100644 --- a/test/test_grammars.rb +++ b/test/test_grammars.rb @@ -27,6 +27,7 @@ class TestGrammars < Minitest::Test gpl-3.0 lgpl-3.0 mit + mpl-2.0 textmate unlicense wtfpl diff --git a/test/test_heuristics.rb b/test/test_heuristics.rb index 59041e7b..cca48675 100644 --- a/test/test_heuristics.rb +++ b/test/test_heuristics.rb @@ -66,11 +66,21 @@ class TestHeuristcs < Minitest::Test }) end - # Candidate languages = ["ECL", "Prolog"] - def test_ecl_prolog_by_heuristics + # Candidate languages = ["Perl", "Perl6"] + def test_t_perl_by_heuristics + assert_heuristics({ + "Perl" => all_fixtures("Perl", "*.t"), + "Perl6" => ["Perl6/01-dash-uppercase-i.t", "Perl6/01-parse.t", "Perl6/advent2009-day16.t", + "Perl6/basic-open.t", "Perl6/calendar.t", "Perl6/for.t", "Perl6/hash.t", + "Perl6/listquote-whitespace.t"] + }) + end + + # Candidate languages = ["ECL", "ECLiPSe"] + def test_ecl_by_heuristics assert_heuristics({ "ECL" => all_fixtures("ECL", "*.ecl"), - "Prolog" => all_fixtures("Prolog", "*.ecl") + "ECLiPSe" => all_fixtures("ECLiPSe", "*.ecl") }) end diff --git a/vendor/grammars/sublime-typescript b/vendor/grammars/sublime-typescript new file mode 160000 index 00000000..0d519e5a --- /dev/null +++ b/vendor/grammars/sublime-typescript @@ -0,0 +1 @@ +Subproject commit 0d519e5a5592bd4152523fe359d1a0ebbe9cc493 diff --git a/vendor/grammars/sublimeprolog b/vendor/grammars/sublimeprolog new file mode 160000 index 00000000..9fd46df4 --- /dev/null +++ b/vendor/grammars/sublimeprolog @@ -0,0 +1 @@ +Subproject commit 9fd46df4b63479a8672d184cd47374a044a11b11