pub struct PythonAdapter;Implementations§
Source§impl PythonAdapter
impl PythonAdapter
Trait Implementations§
Source§impl Clone for PythonAdapter
impl Clone for PythonAdapter
Source§fn clone(&self) -> PythonAdapter
fn clone(&self) -> PythonAdapter
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 PythonAdapter
Source§impl Debug for PythonAdapter
impl Debug for PythonAdapter
Source§impl Default for PythonAdapter
impl Default for PythonAdapter
Source§fn default() -> PythonAdapter
fn default() -> PythonAdapter
Returns the “default value” for a type. Read more
Source§impl LanguageAdapter for PythonAdapter
impl LanguageAdapter for PythonAdapter
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 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 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 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 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 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 PythonAdapter
impl RefUnwindSafe for PythonAdapter
impl Send for PythonAdapter
impl Sync for PythonAdapter
impl Unpin for PythonAdapter
impl UnsafeUnpin for PythonAdapter
impl UnwindSafe for PythonAdapter
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