test C and C++ detection when editing header files
This commit is contained in:
parent
f53044fd23
commit
4c8919f9ac
11 changed files with 49 additions and 17 deletions
|
@ -123,7 +123,12 @@ def get_language_from_extension(file_name):
|
|||
"""Returns a matching language for the given file extension.
|
||||
"""
|
||||
|
||||
extension = os.path.splitext(file_name)[1].lower()
|
||||
filepart, extension = os.path.splitext(file_name)
|
||||
|
||||
if os.path.exists(u('{0}{1}').format(u(filepart), u('.c'))) or os.path.exists(u('{0}{1}').format(u(filepart), u('.C'))):
|
||||
return 'C'
|
||||
|
||||
extension = extension.lower()
|
||||
if extension == '.h':
|
||||
directory = os.path.dirname(file_name)
|
||||
available_files = os.listdir(directory)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue