Skip to main content

CppAdapter

Struct CppAdapter 

Source
pub struct CppAdapter;
Expand description

Zero-sized adapter handle; all state lives in the shared parser pack.

Implementations§

Source§

impl CppAdapter

Source

pub fn new() -> Self

Construct a fresh adapter handle.

Trait Implementations§

Source§

impl Clone for CppAdapter

Source§

fn clone(&self) -> CppAdapter

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for CppAdapter

Source§

impl Debug for CppAdapter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CppAdapter

Source§

fn default() -> CppAdapter

Returns the “default value” for a type. Read more
Source§

impl LanguageAdapter for CppAdapter

Source§

fn language_id(&self) -> LanguageId

Short machine identifier (e.g. "rust", "python"). Must match the key used by tree-sitter-language-pack where possible.
Source§

fn display_name(&self) -> &'static str

Human-readable display name.
Source§

fn file_extensions(&self) -> &'static [&'static str]

File extensions this adapter claims (lowercase, no leading dot).
Source§

fn tree_sitter_language(&self) -> Result<Language, AdapterError>

The Tree-sitter Language used for parsing. Most adapters fetch this from tree_sitter_language_pack::get_language.
Source§

fn source_syntax_proves_language( &self, _snapshot: &FileSnapshot, tree: &Tree, ) -> LanguageOwnershipEvidence

Prove that an ambiguous-extension file belongs to this adapter from grammar-owned syntax in its concrete tree. Read more
Source§

fn parse_recovery_edits( &self, snapshot: &FileSnapshot, vfs: &Vfs, tree: &Tree, ) -> Vec<ParseRecoveryEdit>

Return same-width parser-buffer normalizations for a second, grammar-recovery parse. Read more
Source§

fn capabilities(&self) -> LanguageCapabilities

What the adapter claims to support; unsupported constructs are surfaced as diagnostics by the pipeline.
Source§

fn extract_declarations( &self, file: FileId, ctx: &AdapterContext<'_>, ) -> DeclIndex

Extract declarations and references from a single file.
Source§

fn extract_imports(&self, file: FileId, ctx: &AdapterContext<'_>) -> ImportIndex

Extract imports / uses / includes from a single file.
Source§

fn grammar_name_for_path(&self, _path: &Path) -> &'static str

Select the exact Tree-sitter grammar pack for one source path. Most languages have one grammar and inherit their language id. An adapter that owns multiple grammar variants (TypeScript/TSX) selects here from file syntax metadata rather than asking the parser or shared analyzer to recognize an extension.
Source§

fn tree_sitter_language_for_path( &self, path: &Path, ) -> Result<Language, AdapterError>

Load the exact grammar selected for one source path. The default keeps existing single-grammar adapters on their normal constructor and loads a named variant only when grammar_name_for_path differs.
Source§

fn fragment_parse_context(&self) -> FragmentParseContext

Wrapper required to parse a standalone mid-file source fragment. Returned bytes are adapter grammar metadata and never appear in output.
Source§

fn discover_workspace_roots( &self, _files: &[FileId], _ctx: &AdapterContext<'_>, ) -> Vec<WorkspaceRoot>

Discover workspace roots (packages, modules) from the set of files. Default implementation treats the workspace as a single root.
Source§

fn unsupported_constructs( &self, _file: FileId, _ctx: &AdapterContext<'_>, ) -> Vec<UnsupportedConstruct>

Report constructs the adapter saw but does not fully support.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.