mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Heuristic for .ts (TypeScript, XML)
This commit is contained in:
@@ -165,5 +165,13 @@ module Linguist
|
||||
Language["text"]
|
||||
end
|
||||
end
|
||||
|
||||
disambiguate "TypeScript", "XML" do |data|
|
||||
if data.include?("<TS ")
|
||||
Language["XML"]
|
||||
else
|
||||
Language["TypeScript"]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -143,4 +143,11 @@ class TestHeuristcs < Test::Unit::TestCase
|
||||
"LoomScript" => "LoomScript/HelloWorld.ls"
|
||||
})
|
||||
end
|
||||
|
||||
def test_ts_by_heuristics
|
||||
assert_heuristics({
|
||||
"TypeScript" => all_fixtures("TypeScript", "*.ts"),
|
||||
"XML" => all_fixtures("XML", "*.ts")
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user