pub struct CppAdapter;Expand description
Zero-sized adapter handle; all state lives in the shared parser pack.
Implementations§
Source§impl CppAdapter
impl CppAdapter
Trait Implementations§
Source§impl Clone for CppAdapter
impl Clone for CppAdapter
Source§fn clone(&self) -> CppAdapter
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CppAdapter
Source§impl Debug for CppAdapter
impl Debug for CppAdapter
Source§impl Default for CppAdapter
impl Default for CppAdapter
Source§fn default() -> CppAdapter
fn default() -> CppAdapter
Returns the “default value” for a type. Read more
Source§impl LanguageAdapter for CppAdapter
impl LanguageAdapter for CppAdapter
Source§fn language_id(&self) -> LanguageId
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
fn display_name(&self) -> &'static str
Human-readable display name.
Source§fn file_extensions(&self) -> &'static [&'static str]
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>
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
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>
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
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
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
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
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>
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
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>
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>
fn unsupported_constructs( &self, _file: FileId, _ctx: &AdapterContext<'_>, ) -> Vec<UnsupportedConstruct>
Report constructs the adapter saw but does not fully support.
Auto Trait Implementations§
impl Freeze for CppAdapter
impl RefUnwindSafe for CppAdapter
impl Send for CppAdapter
impl Sync for CppAdapter
impl Unpin for CppAdapter
impl UnsafeUnpin for CppAdapter
impl UnwindSafe for CppAdapter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more