Skip to main content

Language

Trait Language 

Source
pub trait Language: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn extensions(&self) -> &'static [&'static str];
    fn line_comment(&self) -> Option<&'static str>;
    fn block_comment(&self) -> Option<(&'static str, &'static str)>;
    fn import_keywords(&self) -> &'static [&'static str];

    // Provided method
    fn indent_size(&self) -> usize { ... }
}
Expand description

Interface for language-specific analysis strategies.

Required Methodsยง

Source

fn name(&self) -> &'static str

Friendly name of the language (e.g., โ€œRustโ€).

Source

fn extensions(&self) -> &'static [&'static str]

File extensions associated with this language.

Source

fn line_comment(&self) -> Option<&'static str>

Delimiter for single-line comments.

Source

fn block_comment(&self) -> Option<(&'static str, &'static str)>

Start and end delimiters for multi-line block comments.

Source

fn import_keywords(&self) -> &'static [&'static str]

Keywords used to declare imports or dependencies.

Provided Methodsยง

Source

fn indent_size(&self) -> usize

Number of spaces representing one level of indentation.

Implementorsยง