[][src]Struct lark_query_system::LarkDatabase

pub struct LarkDatabase { /* fields omitted */ }

Methods

impl LarkDatabase[src]

Trait Implementations

impl LsDatabase for LarkDatabase[src]

fn check_for_cancellation(&self) -> Cancelable<()>[src]

fn errors_for_project(
    &self
) -> Cancelable<HashMap<String, Vec<RangedDiagnostic>>>
[src]

fn range(&self, span: Span<FileName>) -> Range[src]

fn accumulate_errors_for_entity(
    &self,
    entity: Entity,
    errors: &mut Vec<Diagnostic>
) -> Cancelable<()>
[src]

fn find_all_references_to_definition(
    &self,
    definition_entity: Entity
) -> Vec<(String, Range)>
[src]

fn find_all_references_to_variable(
    &self,
    fn_body: &FnBody,
    variable: Variable
) -> Vec<(String, Range)>
[src]

fn find_all_references_to_field(
    &self,
    field_entity: Entity
) -> Vec<(String, Range)>
[src]

fn rename_all_references_at_position(
    &self,
    url: &str,
    position: Position,
    new_name: &str
) -> Cancelable<Vec<(String, Range, String)>>
[src]

fn find_all_references_at_position(
    &self,
    url: &str,
    position: Position
) -> Cancelable<Vec<(String, Range)>>
[src]

fn get_entity_span_if_possible(
    &self,
    entity: Entity,
    use_minimal_span: bool
) -> Option<Span<FileName>>
[src]

fn definition_range_at_position(
    &self,
    url: &str,
    position: Position,
    minimal_span: bool
) -> Cancelable<Option<(String, Range)>>
[src]

fn hover_text_at_position(
    &self,
    url: &str,
    position: Position
) -> Cancelable<Option<String>>
[src]

Returns the hover text to display for a given position (if any). Read more

fn position_to_byte_index(&self, url: &str, position: Position) -> ByteIndex[src]

impl AsRef<EntityTables> for LarkDatabase[src]

impl AsRef<GlobalIdentifierTables> for LarkDatabase[src]

impl AsRef<DeclarationTables> for LarkDatabase[src]

impl AsRef<BaseInferredTables> for LarkDatabase[src]

impl AsRef<FullInferredTables> for LarkDatabase[src]

impl Default for LarkDatabase[src]

impl Debug for LarkDatabase[src]

impl<'_> ReportingFiles for &'_ LarkDatabase[src]

type Span = Span<FileName>

type FileId = FileName

impl ParserDatabase for LarkDatabase

fn file_names(&self) -> Seq<FileName>

fn file_text(&self, id: FileName) -> Text

fn entity_span(&self, entity: Entity) -> Span<FileName>

fn characteristic_entity_span(&self, entity: Entity) -> Span<FileName>

fn line_offsets(&self, id: FileName) -> Seq<usize>

Returns, for each line in the given file, the start index -- the final element is the length of the file (there is kind of a "pseudo-empty line" at the end, so to speak). So for the input "a\nb\r\nc" you would get [0, 2, 5, 6]. Read more

fn location(&self, id: FileName, index: ByteIndex) -> Location

fn byte_index(&self, id: FileName, line: u64, column: u64) -> ByteIndex

Given a (zero-based) line number line and column within the line, gives a byte-index into the file's text. Read more

fn file_tokens(
    &self,
    id: FileName
) -> WithError<Seq<Spanned<LexToken, FileName>>>

fn parsed_file(&self, id: FileName) -> WithError<ParsedFile>

fn child_parsed_entities(&self, entity: Entity) -> WithError<Seq<ParsedEntity>>

fn parsed_entity(&self, entity: Entity) -> ParsedEntity

fn child_entities(&self, entity: Entity) -> Seq<Entity>

Returns the immediate children of entity in the entity tree.

fn descendant_entities(&self, entity: Entity) -> Seq<Entity>

Transitive closure of child_entities.

fn fn_body(&self, key: Entity) -> WithError<Arc<FnBody>>

Get the fn-body for a given def-id.

fn hover_targets(&self, file: FileName, index: ByteIndex) -> Seq<HoverTarget>

Given a span, find the things that it may have been referring to.

fn members(&self, key: Entity) -> Result<Seq<Member>, ErrorReported>

Get the list of member names and their def-ids for a given struct.

fn member_entity(
    &self,
    entity: Entity,
    kind: MemberKind,
    id: GlobalIdentifier
) -> Option<Entity>

Gets the def-id for a field of a given class.

fn ty(&self, key: Entity) -> WithError<Ty<Declaration>>

Get the type of something.

fn signature(
    &self,
    key: Entity
) -> WithError<Result<Signature<Declaration>, ErrorReported>>

Get the signature of a function.

fn generic_declarations(
    &self,
    key: Entity
) -> WithError<Result<Arc<GenericDeclarations>, ErrorReported>>

Get the generic declarations from a particular item.

fn resolve_name(&self, scope: Entity, name: GlobalIdentifier) -> Option<Entity>

Resolve a type name that appears in the given entity.

impl ParserDatabaseExt for LarkDatabase[src]

fn init_parser_db(&mut self)[src]

fn add_file<impl IntoFileName, impl Into>(
    &mut self,
    path: impl IntoFileName,
    contents: impl Into
) where
    impl Into: Into<Text>,
    impl IntoFileName: IntoFileName
[src]

fn top_level_entities_in_file<impl IntoFileName>(
    &self,
    file: impl IntoFileName
) -> Seq<Entity> where
    impl IntoFileName: IntoFileName
[src]

Returns the "top-level" entities defined in the given file -- does not descend to visit the children of those entities etc. Read more

impl Database for LarkDatabase[src]

fn sweep_all(&self, strategy: SweepStrategy)[src]

Iterates through all query storage and removes any values that have not been used since the last revision was created. The intended use-cycle is that you first execute all of your "main" queries; this will ensure that all query values they consume are marked as used. You then invoke this method to remove other values that were not needed for your main query results. Read more

fn query<Q>(&self, query: Q) -> QueryTable<Self, Q> where
    Q: Query<Self>,
    Self: GetQueryTable<Q>, 
[src]

Get access to extra methods pertaining to a given query. For example, you can use this to run the GC (sweep) across a single input. You can also use it to invoke a query, though it's more common to use the trait method on the database itself. Read more

fn query_mut<Q>(&mut self, query: Q) -> QueryTableMut<Self, Q> where
    Q: Query<Self>,
    Self: GetQueryTable<Q>, 
[src]

Like query, but gives access to methods for setting the value of an input. Read more

fn salsa_event<impl Fn() -> Event>(
    &self,
    event_fn: impl Fn() -> Event
) where
    impl Fn() -> Event: Fn() -> Event<Self>, 
[src]

This function is invoked at key points in the salsa runtime. It permits the database to be customized and to inject logging or other custom behavior. Read more

fn on_propagated_panic(&self) -> ![src]

This function is invoked when a dependent query is being computed by the other thread, and that thread panics. Read more

impl QueryDescriptor<LarkDatabase> for __SalsaQueryDescriptor

impl DatabaseStorageTypes for LarkDatabase

type QueryDescriptor = __SalsaQueryDescriptor

A "query descriptor" packages up all the possible queries and a key. It is used to store information about (e.g.) the stack. Read more

type DatabaseStorage = LarkDatabaseStorage

Defines the "storage type", where all the query data is kept. This type is defined by the database_storage macro. Read more

impl DatabaseOps for LarkDatabase

impl GetQueryTable<FileNamesQuery> for LarkDatabase

impl GetQueryTable<FileTextQuery> for LarkDatabase

impl GetQueryTable<LineOffsetsQuery> for LarkDatabase

impl GetQueryTable<LocationQuery> for LarkDatabase

impl GetQueryTable<ByteIndexQuery> for LarkDatabase

impl GetQueryTable<FileTokensQuery> for LarkDatabase

impl GetQueryTable<ParsedFileQuery> for LarkDatabase

impl GetQueryTable<ChildParsedEntitiesQuery> for LarkDatabase

impl GetQueryTable<ParsedEntityQuery> for LarkDatabase

impl GetQueryTable<ChildEntitiesQuery> for LarkDatabase

impl GetQueryTable<FnBodyQuery> for LarkDatabase

impl GetQueryTable<HoverTargetsQuery> for LarkDatabase

impl GetQueryTable<MembersQuery> for LarkDatabase

impl GetQueryTable<MemberEntityQuery> for LarkDatabase

impl GetQueryTable<DescendantEntitiesQuery> for LarkDatabase

impl GetQueryTable<EntitySpanQuery> for LarkDatabase

impl GetQueryTable<CharacteristicEntitySpanQuery> for LarkDatabase

impl GetQueryTable<TyQuery> for LarkDatabase

impl GetQueryTable<SignatureQuery> for LarkDatabase

impl GetQueryTable<GenericDeclarationsQuery> for LarkDatabase

impl GetQueryTable<ResolveNameQuery> for LarkDatabase

impl GetQueryTable<BaseTypeCheckQuery> for LarkDatabase

impl GetQueryTable<FullTypeCheckQuery> for LarkDatabase

impl ParallelDatabase for LarkDatabase[src]

impl PrettyPrintDatabase for LarkDatabase[src]

impl TypeCheckDatabase for LarkDatabase

fn base_type_check(
    &self,
    key: Entity
) -> WithError<Arc<TypeCheckResults<BaseInferred>>>

Compute the "base type information" for a given fn body. This is the type information excluding permissions. Read more

fn full_type_check(
    &self,
    key: Entity
) -> WithError<Arc<TypeCheckResults<FullInferred>>>

Compute the "base type information" for a given fn body. This is the type information excluding permissions. Read more

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<Cx, T> FmtWithSpecialized for T where
    Cx: ?Sized,
    T: Debug + ?Sized

impl<T> Erased for T

impl<T> LazyParsedEntityDatabase for T where
    T: ParserDatabase
[src]