code icon indicating copy to clipboard operation
code copied to clipboard

Allow existing syntax highlighting definitions to be used for other file extensions

Open jeremypw opened this issue 7 months ago • 2 comments

Problem

There are a number of requests for syntax highlighting of file formats not currently supported by Gtk.SourceView. Such requests should properly be made upstream so all users can benefit. However, there is no guarantee that support will ensue in the near future.

As a fallback it may help some users to be able to set Code to use a sufficiently close syntax highlighting definition for a different file format (file extension).

Proposal

In the language dropdown have a button "+" that brings up a dialog to enter a file extension and a picklist of supported languages. Code would then henceforth apply the desired highlighting to that type of file.

Prior Art (Optional)

No response

jeremypw avatar Jun 18 '25 18:06 jeremypw

I know some people write additional language support files for syntax highlighting that you place in ~/.local/share/gtksourceview-X.X/language-specs/ but it would be nifty to have a GUI method to "import" these language files to that directory.

zeebok avatar Aug 01 '25 06:08 zeebok

@zeebok Could you create a separate issue for that feature? It is not quite the same as this one.

jeremypw avatar Aug 01 '25 13:08 jeremypw