microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.07k stars 29.21k forks source link

Explorer: same extension but different icon #65819

Closed fabiospampinato closed 5 years ago

fabiospampinato commented 5 years ago

I've no idea how to reproduce this, but I got this:

screen shot 2018-12-29 at 16 43 14

Then I reloaded the window and it became:

screen shot 2018-12-29 at 16 43 39
bpasero commented 5 years ago

@fabiospampinato maybe you changed the language mode of the editor in the running session?

fabiospampinato commented 5 years ago

@bpasero I'm pretty sure I didn't 🤔

bpasero commented 5 years ago

Steps?

fabiospampinato commented 5 years ago
  1. Download TestStack.enex: https://www.dropbox.com/s/jowvijlkk5ysric/TestStack.enex?dl=1
  2. Open the directory containing TestStack.enex in a new VSC window
  3. If there are no files open, and you keep reloading the window or (sometimes) open TestStack.enex after startup, its icon doesn't change
  4. If you instead have TestStack.enex open when you reload the window its icon will change

It looks like VSC is trying to infer the filetype when I open the file, but it doesn't always work, the only way I can see the icon change reliably is if the file is already open when I reload the window.

bpasero commented 5 years ago

@fabiospampinato wanna investigate and look why it is not working?

fabiospampinato commented 5 years ago

@bpasero not really, I've quite a lot on my plate right now, and this issue was only a very minor annoyance for me.

bpasero commented 5 years ago

Ok, same here. This issue can probably be explained by the fact that the language mode is only determined by the contents of the file (looking at the XML header) so we require the model to be loaded for the icon to be looked up.

Currently no plans to fix this though as we do not want to load models for each icon.