-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Avoid searching binary files; tweaks to language mappings; APIs to unregister file extension mapping #7290
Avoid searching binary files; tweaks to language mappings; APIs to unregister file extension mapping #7290
Changes from 3 commits
247d711
78ac6ea
e9ad8a0
e013ca4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,7 +93,9 @@ | |
"php": { | ||
"name": "PHP", | ||
"mode": "php", | ||
"fileExtensions": ["php", "php3", "php4", "php5", "phtm", "phtml", "ctp"] | ||
"fileExtensions": ["php", "php3", "php4", "php5", "phtm", "phtml", "ctp"], | ||
"blockComment": ["/*", "*/"], | ||
"lineComment": ["//", "#"] | ||
}, | ||
|
||
"c": { | ||
|
@@ -120,13 +122,6 @@ | |
"lineComment": ["//"] | ||
}, | ||
|
||
"clike": { | ||
"name": "clike", | ||
"mode": "clike", | ||
"blockComment": ["/*", "*/"], | ||
"lineComment": ["//", "#"] | ||
}, | ||
|
||
"java": { | ||
"name": "Java", | ||
"mode": ["clike", "text/x-java"], | ||
|
@@ -138,7 +133,9 @@ | |
"scala": { | ||
"name": "Scala", | ||
"mode": ["clike", "text/x-scala"], | ||
"fileExtensions": ["scala", "sbt"] | ||
"fileExtensions": ["scala", "sbt"], | ||
"blockComment": ["/*", "*/"], | ||
"lineComment": ["//"] | ||
}, | ||
|
||
"coffeescript": { | ||
|
@@ -242,5 +239,12 @@ | |
"name": "Audio", | ||
"fileExtensions": ["mp3", "wav", "aif", "aiff", "ogg"], | ||
"isBinary": true | ||
}, | ||
|
||
"binary": { | ||
"name": "Other Binary", | ||
"fileExtensions": ["svgz", "jsz", "zip", "gz", "htmz", "htmlz", "rar", "tar", "exe", "bin", "dll", "pdb", "lib", "obj", "so", "a", "dylib", | ||
"pdf", "psd", "ai", "tif", "tiff", "mpg", "mpeg", "avi", "flv", "mp4", "ttf", "otf", "woff"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this break extensions like mine that creates a custom viewer for fonts since now some of the extensions are in this unused language? https://github.com/TomMalbran/brackets-fonts-viewer My extension defines a font language, and uses it to register a custom font viewer. We could have other extensions doing the same for pdf, zip files and others. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, good point - so we should hold off on merging this part until #6873 is implemented There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or we could at least split them and give them better languages and not put them all in the same bag. But we could still run into the same issue. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should think about grouping them a bit more in order to make some more custom viewers available. Maybe think of these:
And why don't we add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don`t think that we need separate languages, I would just put them all together. A custom viewer extension can just remove the file extensions from this list and create the language. Also, we can't even open audio or video files in Brackets, so doesn't make sense to make languages that we are not using. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I think if we're not doing any special handling of them we should just lump them all together for now. As @TomMalbran says, if an extension wants to provide support for a bunch of font type, or video, or whatnot, it can register a new language and take over those file extensions itself. I'm not sure why we even break out audio separately -- but just in case extensions are relying on it, I'd like to leave it as-is for now. @SAplayer The reason .tiff isn't listed under images is because Brackets doesn't support it -- our image-preview UI can't render it, and it's not a format used when coding CSS/HTML (for the same reason). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we can break extensions that use any of the new file extensions added here, we could just also break extensions that use the audio language. I don't think that there should be any with it since you can't do much with it. Can you check that? |
||
"isBinary": true | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor Nit: extra
>