sbarex / SourceCodeSyntaxHighlight

Quick Look extension for highlight source code files on macOS 10.15 and later.
GNU General Public License v3.0
3.02k stars 72 forks source link

Add support for .mojo filename extension #253

Open SimplyYummy opened 1 year ago

SimplyYummy commented 1 year ago

Thanks for this great and awesome app. Can we get .mojo and .🔥 extensions for mojo files supported?

It isn't currently supported at the moment as its a new language that's a superset of python. Currently there is no preview when using quicklook, which is expected as its a new programming language.

  1. Website for mojo language: https://docs.modular.com/mojo/

  2. Mojo's official syntax highlighting: https://github.com/modularml/mojo-syntax

  3. Converted syntax to tmLanguage if it helps: https://github.com/SimplyYummy/Modular-Mojo-Syntax-Highlighting/blob/main/mojo.syntax.tmLanguage

Running mdls -name kMDItemContentType -name kMDItemContentTypeTree filename.mojo shows the below:

kMDItemContentType     = "com.coteditor.mojo"
kMDItemContentTypeTree = (
    "com.coteditor.mojo",
    "public.source-code",
    "public.plain-text",
    "public.text",
    "public.data",
    "public.item",
    "public.content"
)

And the output from Inquiry window in Syntax Highlighter.app:

Screenshot mojo extension

sbarex commented 5 months ago

Sorry, but mojo is not handled by the rendering engine Highlight, that is not compatible with the tmLanguage format.