-
Notifications
You must be signed in to change notification settings - Fork 7.6k
File Extension Detection (Filenames with dots) #8042
Comments
Looks like a bug in the recently added |
Hmm, actually -- looks like this behavior was specifically requested by @redmunds when reviewing the PR #7242. Setting to 'needs review' so we can resolve that question... (Personally I think we should only resolve LanguageManager-recognized extensions, and not try to get fancier -- although the examples in the screenshots above might be a little contrived, it does seem odd & potentially confusing that we act as if we're recognizing a longer extension in the file tree UI while the actual editor mode is only respecting a subset of that file extension). |
I made up the filenames in the screenshots above of course. In the last one primarily to show that you can chain as many extension as you like apparently. This is a screenshot of files in my actual project using the OpenUI5 Framework. To the left with activated extensions Brackets Icons and Brackets Extension Highlighter and without any extension to the right. |
@peterflynn Note that the coloring was changed to match the renaming pattern that had already been established, so that also needs to be considered with any changes. People are generally more concerned with the unique part of the filename than the file extension. This is done so every combination of all LanguageManager-recognized file extensions (e.g. |
Re-assigning to me because this is behaving as designed. |
Is Somewhat recently, I saw a system that would automatically process files based on their extensions. A I agree with what @peterflynn says above that it seems like we're best off just using extensions explicitly defined in LanguageManager (or the contents after the last |
I think the inconsistencies in the screenshot above with a real-world project are another good example of why the current behavior is confusing. (In addition to the concerns I raised above about different parts of Brackets treating the same file as having differing file extension parts). |
Reviewed medium priority to @redmunds to change the behavior to:
|
Yes. Yes. I'm not sure how common it is, but people do it. The file name/extension coloring changes were done to be consistent with what gets selected during file renaming (issues #7265). So you want file renaming behavior changed, too, right? |
I'm looking at the file renaming behavior right now as part of #8788. I do think the renaming behavior and coloring of extensions should be consistent. I might take this on, but this issue seems separable enough from the rest of the project manager revamp that it is not clear whether I should. I'm going to make a note in #8788 about it, though. |
I am using the Brackets Icons Extension to get a better overview of my file types and I was surprised that some
.js
files were not marked as the other JavaScript files.After reloading Brackets without extensions, I saw that the file extension detection is not what I expected it to be.
I am not sure, if this is the way it should be, but for me the extension would be the part of the file after the last
.
in the filename.It also doesn't look like Brackets has general problems with dots in filenames as
script.abc.js
is handled correctly.Only known file extension at the end of the filename seem to be added to the extension:
The text was updated successfully, but these errors were encountered: