Comment 1 for bug 1251365

Revision history for this message
Julien Spautz (julien-spautz) wrote :

Little hint: gtksourceview knows what tokens the language uses for line and block comments, if the .lang file specifies this, ofc.

See: <metadata> on https://developer.gnome.org/gtksourceview/unstable/lang-reference.html
and http://valadoc.org/#!api=gtksourceview-3.0/Gtk.SourceLanguage.get_metadata

Haven't tried this, but it should work somewhat like this:

var line_comment_start = source_language.get_metadata ("line-comment-start"); // block-comment-start, block-comment-end

for C this would return "//", "/*", "*/" respectively.