material-extensions / material-icons-browser-extension

Browser Addon that enhances file browsers of version controls with material icons.
MIT License
511 stars 38 forks source link

Add language config mappings from VSC extensions #10

Closed ghost closed 3 years ago

ghost commented 3 years ago

The icon pack doesn't include extensions that can instead be associated with a reconfigurable language ID.

Let's pull in mutually exclusive language configuration data from Microsoft repos so that this data can be used to compute and apply icons accurately.

shivapoudel commented 3 years ago

@4086606 Just like we copied the material-icons.json into iconMap.json is there any repo we can look for to generate that language-related JSON it is because we don't wanna store those files here manually!

Currently, we clone the VSCode extension in a temporary directory and collect the material-icons.json from the vscode extension distribution folder to ours iconsMap.json. Additionally can you please sync with this PR https://github.com/Claudiohbsantos/github-material-icons-extension/pull/7/files and suggest how we can improve the language config mapping currently I had hardcoded the js and ts file extension to support icon here.

ghost commented 3 years ago

👀 Don't hardcode those please!

It's compiled from every contributes.languages in the Microsoft organisation:

(Anything with a * after needs empty arrays removed as a post-completion step.)

ghost commented 3 years ago

(CC @Claudiohbsantos) ideally this PR would precede the work in #7 and get merged first

ghost commented 3 years ago

@shivapoudel I made the package able to generate the new config file automatically in b48d6fd ... 4da4285

ghost commented 3 years ago

I also switched away from the camelcase naming convention because this repo ships with JSON files

Claudiohbsantos commented 3 years ago

Thanks for the work on this. I'm travelling for a quick break until mid next week. I'll make sure to review this asap when I'm back

ghost commented 3 years ago

I would be ideal to run the build scripts and publish all that to a dev branch. I'll have that done in an hour.

ghost commented 3 years ago

@Claudiohbsantos done, see 4086606/github-material-icons-extension@dev.

It would be nice if you publish this branch to this repo and update it for each release or PR merge

Claudiohbsantos commented 3 years ago

Thanks for the changes. I'll merge this and then jump onto the other PR asap.

I'm not sure I understand the advantage of checking in generated files into git. Could you elaborate on how that would be better than having devs run the build scripts locally?

ghost commented 3 years ago

That's what Phillip does over at the main repo. It's honestly super useful if you can't run the build scripts or download Chromium.

Claudiohbsantos commented 3 years ago

@4086606 That makes sense. With the latest PR just merged downloading Chromium shouldn't be necessary anymore, which I believe will alleviate most of this issue. For now I'll hold off on checking in the generated files, just because I generally find more issues than benefits to having to wrangle them while navigating branches and their potentially different versions, and because I don't believe this project will have/need as much contribution as the VSCode extension, so I think keeping the repo simpler makes things easier for now. I appreciate the suggestion though, and will keep it in mind for the future 👍