ManifestParser

Trait ManifestParser 

Source
pub trait ManifestParser: Send + Sync {
    type Dependency: DependencyInfo + Clone + Send + Sync;
    type ParseResult: ParseResultInfo<Dependency = Self::Dependency> + Send;

    // Required method
    fn parse(&self, content: &str, doc_uri: &Uri) -> Result<Self::ParseResult>;
}
Expand description

Generic manifest parser interface.

Implementors parse ecosystem-specific manifest files (Cargo.toml, package.json, etc.) and extract dependency information with precise LSP positions.

§Note

This trait is being phased out in favor of the Ecosystem trait. New implementations should use Ecosystem::parse_manifest() instead.

Required Associated Types§

Source

type Dependency: DependencyInfo + Clone + Send + Sync

Parsed dependency type for this ecosystem.

Source

type ParseResult: ParseResultInfo<Dependency = Self::Dependency> + Send

Parse result containing dependencies and optional workspace information.

Required Methods§

Source

fn parse(&self, content: &str, doc_uri: &Uri) -> Result<Self::ParseResult>

Parses a manifest file and extracts all dependencies with positions.

§Errors

Returns error if:

  • Manifest syntax is invalid
  • File path cannot be determined from URL

Implementors§