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