diff --git a/src/event_handlers/source_code_event_handler.py b/src/event_handlers/source_code_event_handler.py index 51cff20..b1328e0 100644 --- a/src/event_handlers/source_code_event_handler.py +++ b/src/event_handlers/source_code_event_handler.py @@ -91,12 +91,19 @@ class SourceCodeEventHandler(EventHandlerBase, SupervisorMixin): def map_file_extension_to_language(filename): language_map = { - # TODO: extend, maybe auto-generate??? '.py': 'python', - '.js': 'javascript' + '.js': 'javascript', + '.html': 'html', + '.css': 'css', + '.java': 'java', + '.cpp': 'c_cpp', + '.hpp': 'c_cpp', + '.c': 'c_cpp', + '.h': 'c_cpp', + '.cs': 'csharp' } _, extension = splitext(filename) - language = 'javascript' + language = 'text' try: language = language_map[extension] except KeyError: log.debug('No such extension in list, falling back to default: "{}".'.format(language)) return language \ No newline at end of file