pub struct SimpleParserDatabase { /* private fields */ }
Expand description
A salsa database for parsing only.
Implementations§
Source§impl SimpleParserDatabase
impl SimpleParserDatabase
Sourcepub fn parse_virtual(
&self,
content: impl ToString,
) -> Result<SyntaxNode, Diagnostics<ParserDiagnostic>>
pub fn parse_virtual( &self, content: impl ToString, ) -> Result<SyntaxNode, Diagnostics<ParserDiagnostic>>
Parses new file and returns its syntax root.
This is similar to Self::parse_virtual_with_diagnostics, but is more ergonomic in cases when exact diagnostics do not matter at the usage place. If the parser has emitted error diagnostics, this function will return an error. If no error diagnostics has been emitted, the syntax root will be returned.
Sourcepub fn parse_virtual_with_diagnostics(
&self,
content: impl ToString,
) -> (SyntaxNode, Diagnostics<ParserDiagnostic>)
pub fn parse_virtual_with_diagnostics( &self, content: impl ToString, ) -> (SyntaxNode, Diagnostics<ParserDiagnostic>)
Parses new file and return its syntax root with diagnostics.
This function creates new virtual file with the given content and parses it. Diagnostics gathered by the parser are returned alongside the result.
Sourcepub fn parse_token_stream(
&self,
token_stream: &dyn TokenStream,
) -> (SyntaxNode, Diagnostics<ParserDiagnostic>)
pub fn parse_token_stream( &self, token_stream: &dyn TokenStream, ) -> (SyntaxNode, Diagnostics<ParserDiagnostic>)
Parses a TokenStream (based on whole file) and returns its syntax root. It’s very similar to Self::parse_virtual_with_diagnostics, but instead of taking a content as a string, it takes a TokenStream.
Sourcepub fn parse_token_stream_expr(
&self,
token_stream: &dyn TokenStream,
) -> (SyntaxNode, Diagnostics<ParserDiagnostic>)
pub fn parse_token_stream_expr( &self, token_stream: &dyn TokenStream, ) -> (SyntaxNode, Diagnostics<ParserDiagnostic>)
Parses a TokenStream (based on a single expression). It’s very similar to the Self::parse_token_stream.
Trait Implementations§
Source§impl Database for SimpleParserDatabase
impl Database for SimpleParserDatabase
Source§fn salsa_event(&self, event_fn: Event)
fn salsa_event(&self, event_fn: Event)
Source§fn unwind_if_cancelled(&self)
fn unwind_if_cancelled(&self)
Source§fn salsa_runtime(&self) -> &Runtime
fn salsa_runtime(&self) -> &Runtime
Source§fn salsa_runtime_mut(&mut self) -> &mut Runtime
fn salsa_runtime_mut(&mut self) -> &mut Runtime
Source§impl DatabaseOps for SimpleParserDatabase
impl DatabaseOps for SimpleParserDatabase
Source§fn ops_database(&self) -> &dyn Database
fn ops_database(&self) -> &dyn Database
dyn Database
.Source§fn ops_salsa_runtime(&self) -> &Runtime
fn ops_salsa_runtime(&self) -> &Runtime
Source§fn ops_salsa_runtime_mut(&mut self) -> &mut Runtime
fn ops_salsa_runtime_mut(&mut self) -> &mut Runtime
Source§fn fmt_index(&self, input: DatabaseKeyIndex, fmt: &mut Formatter<'_>) -> Result
fn fmt_index(&self, input: DatabaseKeyIndex, fmt: &mut Formatter<'_>) -> Result
Source§fn maybe_changed_after(
&self,
input: DatabaseKeyIndex,
revision: Revision,
) -> bool
fn maybe_changed_after( &self, input: DatabaseKeyIndex, revision: Revision, ) -> bool
input
may have changed since revision
.Source§fn cycle_recovery_strategy(
&self,
input: DatabaseKeyIndex,
) -> CycleRecoveryStrategy
fn cycle_recovery_strategy( &self, input: DatabaseKeyIndex, ) -> CycleRecoveryStrategy
CycleRecoveryStrategy
for a given input.Source§fn for_each_query(&self, op: &mut dyn FnMut(&dyn QueryStorageMassOps))
fn for_each_query(&self, op: &mut dyn FnMut(&dyn QueryStorageMassOps))
Source§impl DatabaseStorageTypes for SimpleParserDatabase
impl DatabaseStorageTypes for SimpleParserDatabase
Source§type DatabaseStorage = __SalsaDatabaseStorage
type DatabaseStorage = __SalsaDatabaseStorage
database_storage
macro.Source§impl Default for SimpleParserDatabase
impl Default for SimpleParserDatabase
Source§impl ExternalFiles for SimpleParserDatabase
impl ExternalFiles for SimpleParserDatabase
Source§fn ext_as_virtual(&self, external_id: InternId) -> VirtualFile
fn ext_as_virtual(&self, external_id: InternId) -> VirtualFile
Source§fn try_ext_as_virtual(&self, _external_id: InternId) -> Option<VirtualFile>
fn try_ext_as_virtual(&self, _external_id: InternId) -> Option<VirtualFile>
Source§impl HasQueryGroup<FilesDatabase> for SimpleParserDatabase
impl HasQueryGroup<FilesDatabase> for SimpleParserDatabase
Source§fn group_storage(&self) -> &<FilesDatabase as QueryGroup>::GroupStorage
fn group_storage(&self) -> &<FilesDatabase as QueryGroup>::GroupStorage
Source§fn group_storage_mut(
&mut self,
) -> (&<FilesDatabase as QueryGroup>::GroupStorage, &mut Runtime)
fn group_storage_mut( &mut self, ) -> (&<FilesDatabase as QueryGroup>::GroupStorage, &mut Runtime)
Runtime
, since otherwise
the database is borrowed and one cannot get access to it.Source§impl HasQueryGroup<ParserDatabase> for SimpleParserDatabase
impl HasQueryGroup<ParserDatabase> for SimpleParserDatabase
Source§fn group_storage(&self) -> &<ParserDatabase as QueryGroup>::GroupStorage
fn group_storage(&self) -> &<ParserDatabase as QueryGroup>::GroupStorage
Source§fn group_storage_mut(
&mut self,
) -> (&<ParserDatabase as QueryGroup>::GroupStorage, &mut Runtime)
fn group_storage_mut( &mut self, ) -> (&<ParserDatabase as QueryGroup>::GroupStorage, &mut Runtime)
Runtime
, since otherwise
the database is borrowed and one cannot get access to it.Source§impl HasQueryGroup<SyntaxDatabase> for SimpleParserDatabase
impl HasQueryGroup<SyntaxDatabase> for SimpleParserDatabase
Source§fn group_storage(&self) -> &<SyntaxDatabase as QueryGroup>::GroupStorage
fn group_storage(&self) -> &<SyntaxDatabase as QueryGroup>::GroupStorage
Source§fn group_storage_mut(
&mut self,
) -> (&<SyntaxDatabase as QueryGroup>::GroupStorage, &mut Runtime)
fn group_storage_mut( &mut self, ) -> (&<SyntaxDatabase as QueryGroup>::GroupStorage, &mut Runtime)
Runtime
, since otherwise
the database is borrowed and one cannot get access to it.Source§impl Upcast<dyn FilesGroup> for SimpleParserDatabase
impl Upcast<dyn FilesGroup> for SimpleParserDatabase
fn upcast(&self) -> &(dyn FilesGroup + 'static)
Source§impl Upcast<dyn SyntaxGroup> for SimpleParserDatabase
impl Upcast<dyn SyntaxGroup> for SimpleParserDatabase
fn upcast(&self) -> &(dyn SyntaxGroup + 'static)
Auto Trait Implementations§
impl !Freeze for SimpleParserDatabase
impl RefUnwindSafe for SimpleParserDatabase
impl Send for SimpleParserDatabase
impl !Sync for SimpleParserDatabase
impl Unpin for SimpleParserDatabase
impl UnwindSafe for SimpleParserDatabase
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
Source§impl<DB> FilesGroup for DB
impl<DB> FilesGroup for DB
fn intern_crate(&self, crt: CrateLongId) -> CrateId
fn lookup_intern_crate(&self, key: CrateId) -> CrateLongId
fn intern_file(&self, file: FileLongId) -> FileId
fn lookup_intern_file(&self, key: FileId) -> FileLongId
fn intern_flag(&self, flag: FlagLongId) -> FlagId
fn lookup_intern_flag(&self, key: FlagId) -> FlagLongId
Source§fn crate_configs(&self) -> Arc<OrderedHashMap<CrateId, CrateConfiguration>>
fn crate_configs(&self) -> Arc<OrderedHashMap<CrateId, CrateConfiguration>>
Source§fn set_crate_configs(
&mut self,
value__: Arc<OrderedHashMap<CrateId, CrateConfiguration>>,
)
fn set_crate_configs( &mut self, value__: Arc<OrderedHashMap<CrateId, CrateConfiguration>>, )
crate_configs
input. Read moreSource§fn set_crate_configs_with_durability(
&mut self,
value__: Arc<OrderedHashMap<CrateId, CrateConfiguration>>,
durability__: Durability,
)
fn set_crate_configs_with_durability( &mut self, value__: Arc<OrderedHashMap<CrateId, CrateConfiguration>>, durability__: Durability, )
crate_configs
input with a
specific durability instead of the default of
Durability::LOW
. You can use Durability::MAX
to promise that its value will never change again. Read moreSource§fn file_overrides(&self) -> Arc<OrderedHashMap<FileId, Arc<str>>>
fn file_overrides(&self) -> Arc<OrderedHashMap<FileId, Arc<str>>>
Source§fn set_file_overrides(&mut self, value__: Arc<OrderedHashMap<FileId, Arc<str>>>)
fn set_file_overrides(&mut self, value__: Arc<OrderedHashMap<FileId, Arc<str>>>)
file_overrides
input. Read moreSource§fn set_file_overrides_with_durability(
&mut self,
value__: Arc<OrderedHashMap<FileId, Arc<str>>>,
durability__: Durability,
)
fn set_file_overrides_with_durability( &mut self, value__: Arc<OrderedHashMap<FileId, Arc<str>>>, durability__: Durability, )
file_overrides
input with a
specific durability instead of the default of
Durability::LOW
. You can use Durability::MAX
to promise that its value will never change again. Read moreSource§fn set_flags(&mut self, value__: Arc<OrderedHashMap<FlagId, Arc<Flag>>>)
fn set_flags(&mut self, value__: Arc<OrderedHashMap<FlagId, Arc<Flag>>>)
flags
input. Read moreSource§fn set_flags_with_durability(
&mut self,
value__: Arc<OrderedHashMap<FlagId, Arc<Flag>>>,
durability__: Durability,
)
fn set_flags_with_durability( &mut self, value__: Arc<OrderedHashMap<FlagId, Arc<Flag>>>, durability__: Durability, )
flags
input with a
specific durability instead of the default of
Durability::LOW
. You can use Durability::MAX
to promise that its value will never change again. Read moreSource§fn set_cfg_set_with_durability(
&mut self,
value__: Arc<CfgSet>,
durability__: Durability,
)
fn set_cfg_set_with_durability( &mut self, value__: Arc<CfgSet>, durability__: Durability, )
cfg_set
input with a
specific durability instead of the default of
Durability::LOW
. You can use Durability::MAX
to promise that its value will never change again. Read moreSource§fn crate_config(&self, crate_id: CrateId) -> Option<CrateConfiguration>
fn crate_config(&self, crate_id: CrateId) -> Option<CrateConfiguration>
Source§fn priv_raw_file_content(&self, file_id: FileId) -> Option<Arc<str>>
fn priv_raw_file_content(&self, file_id: FileId) -> Option<Arc<str>>
Source§fn file_content(&self, file_id: FileId) -> Option<Arc<str>>
fn file_content(&self, file_id: FileId) -> Option<Arc<str>>
fn file_summary(&self, file_id: FileId) -> Option<Arc<FileSummary>>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more