LanguageDescription

data class LanguageDescription(val name: String, val alias: List<String> = emptyList(), val extensions: List<String> = emptyList(), val filename: List<Regex> = emptyList(), val load: () -> LanguageSupport? = null)

Metadata descriptor for a language. Used for language detection and dynamic language loading.

Parameters

name

Human-readable name of the language (e.g., "JavaScript").

alias

Alternative names for the language (e.g., "js", "ecmascript").

extensions

File extensions associated with the language (e.g., listOf("js", "mjs", "cjs")).

filename

Regex patterns matching filenames for this language (e.g., listOf(Regex("Makefile")) for Makefiles without extensions).

load

Factory function that creates a LanguageSupport instance.

Constructors

Link copied to clipboard
constructor(name: String, alias: List<String> = emptyList(), extensions: List<String> = emptyList(), filename: List<Regex> = emptyList(), load: () -> LanguageSupport? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val load: () -> LanguageSupport?
Link copied to clipboard

Functions

Link copied to clipboard
fun matchFilename(filename: String): Boolean

Check whether this language matches a given file name.

Link copied to clipboard

Check whether this language matches a given name or alias.