SublimeText / AFileIcon

Sublime Text File-Specific Icons for Improved Visual Grepping

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add this icon for Mp3tag web source framework

stephen147 opened this issue · comments

It's for a Websource Framework language used for mp3tag.

I suppose if you do add it the extension could just be file_type_mp3tagwsf.

https://community.mp3tag.de/t/web-sources-framework/1633

I tried to add this myself but I couldn't get it to work.

Here are the files' names:

file_type_mp3tagwsf.png
file_type_mp3tagwsf@2x.png
file_type_mp3tagwsf@3x.png

file_type_mp3tag
file_type_mp3tag@2x
file_type_mp3tag@3x

Thanks.

Does any syntax definition exist for that file type already?

I need a scope name to use as this is the way ST assigns icons. (file extension <- scope -> icon)

No, not that I could see. It's a fairly edge case language.

If it's something like mp3tagwsf it'll be fine. wsf standing for web source framework.

The extension used for the files are .scr but that would be a screen saver file! 🤣

The extension is one of the main issues if no installable syntax file exists.

A File Icon creates hidden dummy syntaxes for missing ones, but I can't assign such a general extension to it for obvious reasons. Assigning a file to a hiddens syntax manually is not easy, too, as it would require you to know the exact name of the syntax file.

Thanks. so does that mean I have to stick with:

<key>icon</key>
<string>file_type_text</string>

I could add an mp3tag icon, which matches the overall design, but as I can't assign such a general extension, it won't make much sense for 99.99% of the users. Noone would ever find that icon nor being able to assign an extension without deep understanding about how things work except there was an installable syntax definition package for it, which provides required information.

What you basically need to display "custom" icons is

file_type_mp3tag.tmPreferences

<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
	<dict>
		<key>scope</key>
		<string>text.mp3tag, source.mp3tagwsf</string>
		<key>settings</key>
		<dict>
			<key>icon</key>
			<string>file_type_mp3tag</string>
		</dict>
	</dict>
</plist>

A syntax definition, which provides the scope, e.g. MP3tag Web Framework.sublime-syntax

%YAML 1.2
---
name: MP3tag Web Framework
scope: source.mp3tagwsf
hidden: true
file_extensions:
  - scr
contexts:
  main:  [] // empty dictionary, all displayed as plain text

and the icon files placed in the root of the package or within an icons sub folder.

Thanks, I can't get that to work.

My files are below and placed in the ...\Packages\User folder.

file_type_mp3tag.png
file_type_mp3tag.tmPreferences
file_type_mp3tag@2x.png
file_type_mp3tag@3x.png
Mp3tag WSF (Dark).tmTheme
Mp3tag WSF (Light).tmTheme
Mp3tag WSF.sublime-settings
Mp3tag WSF.sublime-syntax
Mp3tag WSF.tmPreferences

Ideally, I'd like to put them inside a folder in the ...\User\Mp3tag WSF folder to organise it a little but I'd be happy to get this sorted first.

My files are attached. Sorry to bother you but I tried and don't know what's wrong.
Mp3tag WSF.zip

The trick is ST looking for icon resorces in the same directory (or icons subdir) as the sublime-theme file only. You'd need to create a dummy theme file with the same name as the one you are actually using.

If you use Default.sublime-theme for instance, just create an empty file of that name in your user package. That should do the trick.

This also works with those files arranged in a sub directory.

I've already added an icon assigned to source.mp3tagwsf and text.mp3tag scopes locally. I can upload it, so you just need a proper dummy syntax (see above) to assign it to the extensions of choise.

Thanks for adding that. Look forward to when you push the release out.

So to be clear, I just have to create a file called MP3tag Web Framework.sublime-syntax

with this:

%YAML 1.2
---
name: MP3tag Web Framework
scope: source.mp3tagwsf
hidden: true
file_extensions:
  - scr
contexts:
  main:  [] // empty dictionary, all displayed as plain text