elementary / code

Code editor designed for elementary OS
https://elementary.io
GNU General Public License v3.0
480 stars 112 forks source link

Add GUI option to import .lang files #780

Open GarkGarcia opened 4 years ago

GarkGarcia commented 4 years ago

Prerequisites

Feature

As far as I can tell, Code uses gtk-sourceview for syntax highlighting. Therefore, it should be easy to add new language definitions by simply placing the .lang and a mimetype file in the appropriate folders. However, Code does not offer a way to it through it's GUI. Instead, users have to manually install the language definition, or file a Github issue to get their favourite languages supported.

My solution is simple. Include an option for the user to import .lang files. It could be placed in the Syntax Highlighting menu. If there is already a mimetype file installed that references the new language definition, then that mimetype would be used. Otherwise the user would be prompted to create a new mimetype.

Alternatives

cassidyjames commented 4 years ago

I agree, this would be much nicer than telling developers to go manually drop a file into the filesystem.

naim5am commented 4 years ago

Until that happens, for the next person asking where to save .lang files.. thanks https://elementaryos.stackexchange.com/questions/17254/how-to-add-support-for-additional-coding-languages

User ~/.local/share/gtksourceview-3.0/language-specs/

System-wide /usr/share/gtksourceview-3.0/language-specs/

Format https://developer.gnome.org/gtksourceview/stable/lang-reference.html