LanguagePlugin

Trait LanguagePlugin 

Source
pub trait LanguagePlugin: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn extensions(&self) -> &[&str];
    fn key_files(&self) -> &[&str];
    fn get_lsp_config(&self) -> LspConfig;
    fn get_init_action(&self, opts: &InitOptions) -> ProjectAction;
    fn check_tooling_action(&self, path: &Path) -> ProjectAction;
    fn init_command(&self, opts: &InitOptions) -> String;
    fn test_command(&self) -> String;
    fn run_command(&self) -> String;

    // Provided method
    fn detect(&self, path: &Path) -> bool { ... }
}
Expand description

A plugin for a specific programming language

Required Methods§

Source

fn name(&self) -> &str

Name of the language

Source

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

File extensions this plugin handles

Source

fn key_files(&self) -> &[&str]

Key files that identify this language (e.g., Cargo.toml, pyproject.toml)

Source

fn get_lsp_config(&self) -> LspConfig

Get the LSP configuration for this language

Source

fn get_init_action(&self, opts: &InitOptions) -> ProjectAction

Get the action to initialize a new project (greenfield)

Source

fn check_tooling_action(&self, path: &Path) -> ProjectAction

Check if an existing project needs tooling sync (e.g., uv sync, cargo fetch)

Source

fn init_command(&self, opts: &InitOptions) -> String

Get the command to initialize a new project DEPRECATED: Use get_init_action instead

Source

fn test_command(&self) -> String

Get the command to run tests

Source

fn run_command(&self) -> String

Get the command to run the project (for verification)

Provided Methods§

Source

fn detect(&self, path: &Path) -> bool

Detect if this plugin should handle the given project directory

Implementors§