SourceCodeSyntaxHighlight icon indicating copy to clipboard operation
SourceCodeSyntaxHighlight copied to clipboard

Unable to add a plain file extension .theme as PHP

Open vinmassaro opened this issue 3 years ago • 4 comments

I'm trying to add the .theme extension to render as PHP but can't get it to work. I've tried a number of file name patterns with and without using regular expression with no luck. The "Inquiry file" tool returns it as unsupported, see the attached screenshot. Is there any way I can add this type? Thank you.

Screen Shot 2022-04-26 at 11 28 37 AM

vinmassaro avatar Apr 26 '22 15:04 vinmassaro

It is not possible to dynamically add a custom format. You can only customize plain file WITHOUT extension. Otherwise, for all files with an extension it is necessary to enable its support at the compile time of the application.

.theme extension is very common, for example it is used for application themes which are written in lua format. So it is probably not appropriate to associate this extension with some language.

sbarex avatar Apr 26 '22 17:04 sbarex

Got it, I misunderstood the function here. I agree with not associating it with a particular language. Is there any way to define it to render as plain text somehow so you can at least preview it?

vinmassaro avatar Apr 26 '22 19:04 vinmassaro

My use-case is to view *.code-workspace files as JSON. I think matching regex only for files without extension is a bit limiting!

dufferzafar avatar Jul 16 '22 08:07 dufferzafar

sorry but this is a limitation/features os macOS. Every file extension generate diffent UTIs anche each UTIs must be handled at the compiling time to be supported...

sbarex avatar Jul 16 '22 14:07 sbarex