TagStudioDev / TagStudio

A User-Focused Photo & File Management System
https://docs.tagstud.io/
GNU General Public License v3.0
5.25k stars 374 forks source link

[Feature Request]: Syntax Highlighting in Code File Thumbnails #585

Open Cool-Game-Dev opened 2 hours ago

Cool-Game-Dev commented 2 hours ago

Checklist

Description

Add syntax highlighting to thumbnails/previews of code files.

Solution

Create a code media type and apply syntax highlighting to thumbnails and previews. Examples of code file types could include code files themselves as well as metadata and data files, such as .csproj or .json.

Alternatives

No response

python357-1 commented 2 hours ago

QSyntaxHighlighter does exist, but it seems to be meant more for being used by other Qt widgets, and we would need to specify (or find) syntax highlighting rules for every language we wanted to support. I would say it would make more sense to use a python library for treesitter, like https://github.com/tree-sitter/py-tree-sitter