Language class final

A language a Highlighter can tokenize: a TextMate grammar plus its name and aliases.

The constructor is const, so bundled languages cost nothing until they are used.

Constructors

Language({required String name, required String scopeName, required Map<String, Object?> grammar, String? displayName, List<String> aliases = const [], List<String> injectTo = const []})
A language from a parsed grammar. See also Language.fromJson.
const
Language.fromJson(Map<String, Object?> grammar, {required String name, List<String> aliases = const [], List<String> injectTo = const []})
Creates a language from a decoded *.tmLanguage.json.
factory

Properties

aliases → List<String>
Other names that select the language, such as sh and bash. Highlighter.languageForPath also matches file extensions against them.
final
displayName → String?
A name for people, such as Shell for shellscript.
final
grammar → Map<String, Object?>
The raw TextMate grammar.
final
hashCode → int
The hash code for this object.
no setterinherited
injectTo → List<String>
Scope names this grammar injects into through its injectionSelector, for example ['source.js'].
final
name → String
Identifier used to select the language, for example dart.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scopeName → String
The grammar's root scope, for example source.dart.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited