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§
Sourcefn extensions(&self) -> &[&str]
fn extensions(&self) -> &[&str]
File extensions this plugin handles
Sourcefn key_files(&self) -> &[&str]
fn key_files(&self) -> &[&str]
Key files that identify this language (e.g., Cargo.toml, pyproject.toml)
Sourcefn get_lsp_config(&self) -> LspConfig
fn get_lsp_config(&self) -> LspConfig
Get the LSP configuration for this language
Sourcefn get_init_action(&self, opts: &InitOptions) -> ProjectAction
fn get_init_action(&self, opts: &InitOptions) -> ProjectAction
Get the action to initialize a new project (greenfield)
Sourcefn check_tooling_action(&self, path: &Path) -> ProjectAction
fn check_tooling_action(&self, path: &Path) -> ProjectAction
Check if an existing project needs tooling sync (e.g., uv sync, cargo fetch)
Sourcefn init_command(&self, opts: &InitOptions) -> String
fn init_command(&self, opts: &InitOptions) -> String
Get the command to initialize a new project DEPRECATED: Use get_init_action instead
Sourcefn test_command(&self) -> String
fn test_command(&self) -> String
Get the command to run tests
Sourcefn run_command(&self) -> String
fn run_command(&self) -> String
Get the command to run the project (for verification)