Match multiple file extensions #52
Match multiple file extensions #52Claudiohbsantos merged 2 commits intomaterial-extensions:masterfrom zm-cttae:feat-multiple-file-extensions
Conversation
Claudiohbsantos
left a comment
There was a problem hiding this comment.
Hey @zm-cttae ! Thanks for the pull request, and I'm very sorry it has sat open for so long.
I took a look at the ticket and I'm not entirely clear on what problem we're trying to solve here. Could you give me a couple of examples of files that are being missed by the current logic but that would be correctly picked up with these changes?
Thanks!
| // https://github.com/microsoft/vscode/issues/116199 | ||
| if (fileName.length <= 255) { | ||
| for (let i = 0; i < fileName.length; i += 1) { | ||
| if (fileName[i] === '.') fileExtensions.push(fileName.slice(i + 1)); |
There was a problem hiding this comment.
To confirm the intended behavior, for a file name.ext1.ext2.ext3 we expect fileExtensions to be ['ext1.ext2.ext', 'ext2.ext3', 'ext.3'] ?
There was a problem hiding this comment.
Sounds right. This is the same implementation that's present in core VS Code UI
| return iconMap.fileExtensions[fileExtension]; | ||
| if (iconMap.languageIds[fileExtension] && !isDir && !isSubmodule) | ||
| return iconMap.languageIds[fileExtension]; | ||
| for (const ext of fileExtensions) { |
There was a problem hiding this comment.
Just confirming that the intention here is to match the first (left-most) extension that matches a known icon. Is that the idea?
|
Before this PR, any |
Closes #50. Prior art:
https://github.com/microsoft/vscode/blob/5235c6b/src/vs/editor/common/services/getIconClasses.ts#L57-L58