Icon associated with extension
See this detailed answer for &quot;How to set an icon for a file type on Mac?&quot; on superuser.com.
In this case, you need to update TextEdit's resources and plist to get it to use your custom icon for a file type it does not know about. The LaunchServices database also needs to be updated for the changes to be seen.
Here's a small snippet from that answer (bold emphasis mine):

Icons for file types are handled by Launch Services (the service determining, among other things, which application handles a file type). The file icon is always provided by the application handling opening a file by default. This way, e.g. Preview provides PDF icons by default, and PNG icons, but if you change all PNG files to open using Pixelmator instead, these files get a Pixelmator-style icon afterwards.
What you need to do is add your file type definition to the application that opens it by default, or create your own &quot;dummy&quot; application for the file type.