Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2079)

Unified Diff: Source/devtools/front_end/ResourceType.js

Issue 18341003: DevTools: [CodeMirror] Add syntax highlighting for some other languages. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaselined Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/ResourceType.js
diff --git a/Source/devtools/front_end/ResourceType.js b/Source/devtools/front_end/ResourceType.js
index a3f3110d30dd8596440896357f29fb08d1823ea3..2c206c7fd07a5ee9e1cd1518f7666999c97f8f30 100644
--- a/Source/devtools/front_end/ResourceType.js
+++ b/Source/devtools/front_end/ResourceType.js
@@ -122,3 +122,59 @@ WebInspector.resourceTypes = {
WebSocket: new WebInspector.ResourceType("websocket", "WebSocket", "WebSockets", "rgb(186,186,186)", false), // FIXME: Decide the color.
Other: new WebInspector.ResourceType("other", "Other", "Other", "rgb(186,186,186)", false)
}
+
+WebInspector.ResourceType.mimeTypesForExtensions = {
+ // Web extensions
+ "js": "text/javascript",
+ "css": "text/css",
+ "html": "text/html",
+ "htm": "text/html",
+ "xml": "application/xml",
+ "xsl": "application/xml",
+
+ // HTML Embedded Scripts: ASP, JSP
+ "asp": "application/x-aspx",
+ "aspx": "application/x-aspx",
+ "jsp": "application/x-jsp",
+
+ // C/C++
+ "c": "text/x-c++src",
+ "cc": "text/x-c++src",
+ "cpp": "text/x-c++src",
+ "h": "text/x-c++src",
+ "m": "text/x-c++src",
+ "mm": "text/x-c++src",
+
+ // CoffeeScript
+ "coffee": "text/x-coffeescript",
+
+ // Dart
+ "dart": "text/javascript",
+
+ // TypeScript
+ "ts": "text/typescript",
+
+ // JSON
+ "json": "application/json",
+ "gyp": "application/json",
+ "gypi": "application/json",
+
+ // C#
+ "cs": "text/x-csharp",
+
+ // Java
+ "java": "text/x-java",
+
+ // PHP
+ "php": "text/x-php",
+ "phtml": "application/x-httpd-php",
+
+ // Python
+ "py": "text/x-python",
+
+ // Shell
+ "sh": "text/x-sh",
+
+ // SCSS
+ "scss": "text/x-scss"
+}

Powered by Google App Engine
This is Rietveld 408576698