Language
Superclasses: Object
Represents a syntax highlighted language.
A GtkSourceLanguage
represents a programming or markup language, affecting
syntax highlighting and context classes.
Use LanguageManager
to obtain a GtkSourceLanguage
instance, and
set_language
to apply it to a Buffer
.
Methods
- class Language
- get_globs() list[str] | None
Returns the globs associated to this language.
This is just an utility wrapper around
get_metadata
to retrieve the “globs” metadata property and split it into an array.
Returns whether the language should be hidden from the user.
- get_id() str
Returns the ID of the language.
The ID is not locale-dependent.The returned string is owned by
language
and should not be freed or modified.
- get_mime_types() list[str] | None
Returns the mime types associated to this language.
This is just an utility wrapper around
get_metadata
to retrieve the “mimetypes” metadata property and split it into an array.
- get_name() str
Returns the localized name of the language.
The returned string is owned by
language
and should not be freed or modified.
- get_section() str
Returns the localized section of the language.
Each language belong to a section (ex. HTML belongs to the Markup section). The returned string is owned by
language
and should not be freed or modified.