mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	Treat .cu files as .cpp
This commit is contained in:
		| @@ -105,14 +105,15 @@ C++: | ||||
|   aliases: | ||||
|   - cpp | ||||
|   extensions: | ||||
|   - .cpp | ||||
|   - .hh | ||||
|   - .c++ | ||||
|   - .cc | ||||
|   - .cpp | ||||
|   - .cu | ||||
|   - .cxx | ||||
|   - .h++ | ||||
|   - .hh | ||||
|   - .hpp | ||||
|   - .hxx | ||||
|   - .c++ | ||||
|   - .cxx | ||||
|   - .tcc | ||||
|  | ||||
| C-ObjDump: | ||||
|   | ||||
| @@ -42,10 +42,11 @@ application/x-chrome-extension @crx | ||||
| application/x-ms-xbap @xbap :8bit | ||||
| application/x-shockwave-flash @swf | ||||
| application/x-silverlight-app @xap | ||||
| application/x-supercollider @sc :8bit | ||||
| application/x-troff-ms :8bit | ||||
| application/x-wais-source :8bit | ||||
| application/xaml+xml @xaml :8bit | ||||
| application/supercollider @sc :8bit | ||||
| image/x-icns @icns | ||||
| text/cache-manifest @manifest | ||||
| text/plain @cu,cxx | ||||
| text/x-nimrod @nim | ||||
|   | ||||
| @@ -211,6 +211,7 @@ class TestBlob < Test::Unit::TestCase | ||||
|     assert_equal Language['C++'],         blob("bar.h").language | ||||
|     assert_equal Language['C++'],         blob("bar.hpp").language | ||||
|     assert_equal Language['C++'],         blob("hello.cpp").language | ||||
|     assert_equal Language['C++'],         blob("cuda.cu").language | ||||
|     assert_equal Language['GAS'],         blob("hello.s").language | ||||
|     assert_equal Language['Objective-C'], blob("Foo.h").language | ||||
|     assert_equal Language['Objective-C'], blob("Foo.m").language | ||||
|   | ||||
| @@ -46,6 +46,14 @@ class TestMime < Test::Unit::TestCase | ||||
|     assert_equal 'text/cache-manifest', Mime.mime_for('.manifest') | ||||
|     assert_equal 'text/html', Mime.mime_for('.html') | ||||
|     assert_equal 'text/nimrod', Mime.mime_for('.nim') | ||||
|     assert_equal 'text/plain', Mime.mime_for('.c') | ||||
|     assert_equal 'text/plain', Mime.mime_for('.cc') | ||||
|     assert_equal 'text/plain', Mime.mime_for('.cpp') | ||||
|     assert_equal 'text/plain', Mime.mime_for('.cu') | ||||
|     assert_equal 'text/plain', Mime.mime_for('.cxx') | ||||
|     assert_equal 'text/plain', Mime.mime_for('.h') | ||||
|     assert_equal 'text/plain', Mime.mime_for('.hh') | ||||
|     assert_equal 'text/plain', Mime.mime_for('.hpp') | ||||
|     assert_equal 'text/plain', Mime.mime_for('.kt') | ||||
|     assert_equal 'video/quicktime', Mime.mime_for('.mov') | ||||
|   end | ||||
| @@ -141,6 +149,7 @@ class TestMime < Test::Unit::TestCase | ||||
|     assert Mime.text?('text/x-nimrod') | ||||
|  | ||||
|     # Legacy. Prefer testing mime types instead of extensions. | ||||
|     assert Mime.text?('.cu') | ||||
|     assert Mime.text?('.js') | ||||
|     assert Mime.text?('.latex') | ||||
|     assert Mime.text?('.ms') | ||||
|   | ||||
		Reference in New Issue
	
	Block a user