From 583392d1794a4c55776a1fbb86c34cc3d25d4b2b Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Sat, 6 Dec 2014 16:31:14 -0500 Subject: [PATCH] Heuristic for .ts (TypeScript, XML) --- lib/linguist/heuristics.rb | 8 ++++++++ test/test_heuristics.rb | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/lib/linguist/heuristics.rb b/lib/linguist/heuristics.rb index 0d0b8338..69dcb395 100644 --- a/lib/linguist/heuristics.rb +++ b/lib/linguist/heuristics.rb @@ -165,5 +165,13 @@ module Linguist Language["text"] end end + + disambiguate "TypeScript", "XML" do |data| + if data.include?(" "LoomScript/HelloWorld.ls" }) end + + def test_ts_by_heuristics + assert_heuristics({ + "TypeScript" => all_fixtures("TypeScript", "*.ts"), + "XML" => all_fixtures("XML", "*.ts") + }) + end end