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ยง
Sourcefn extensions(&self) -> &'static [&'static str]
fn extensions(&self) -> &'static [&'static str]
File extensions associated with this language.
Sourcefn line_comment(&self) -> Option<&'static str>
fn line_comment(&self) -> Option<&'static str>
Delimiter for single-line comments.
Sourcefn block_comment(&self) -> Option<(&'static str, &'static str)>
fn block_comment(&self) -> Option<(&'static str, &'static str)>
Start and end delimiters for multi-line block comments.
Sourcefn import_keywords(&self) -> &'static [&'static str]
fn import_keywords(&self) -> &'static [&'static str]
Keywords used to declare imports or dependencies.
Provided Methodsยง
Sourcefn indent_size(&self) -> usize
fn indent_size(&self) -> usize
Number of spaces representing one level of indentation.