Skip to main content

travsr_plugin_protocol/
plugin.rs

1use crate::types::{InvokeRequest, InvokeResponse, ParseRequest, ParseResponse};
2use travsr_core::Language;
3
4/// Implemented once per language. Stateless and Send+Sync so a single instance
5/// is shared across walker threads (in-process) or drives one child process (sidecar).
6pub trait Plugin: Send + Sync {
7    fn language(&self) -> Language;
8    fn extensions(&self) -> &[&str];
9    fn supports_phase_b(&self) -> bool {
10        false
11    }
12    fn parse(&self, req: &ParseRequest) -> ParseResponse;
13    fn invoke_phase_b(&self, _req: &InvokeRequest) -> InvokeResponse {
14        InvokeResponse::unsupported()
15    }
16}