pub struct Analysis { /* private fields */ }Expand description
An immutable snapshot of the world — a cloned salsa handle. Every query is Cancellable:
a concurrent apply_change cancels in-flight reads, which the client re-issues against the
fresh snapshot.
Implementations§
Source§impl Analysis
impl Analysis
Sourcepub fn syntax_tree(&self, file: FileId) -> Cancellable<Option<String>>
pub fn syntax_tree(&self, file: FileId) -> Cancellable<Option<String>>
A pretty-printed dump of the syntax tree (debugging / playground).
§Errors
Err(Cancelled) if a concurrent apply_change invalidated this snapshot.
Sourcepub fn diagnostics(&self, file: FileId) -> Cancellable<Vec<Diagnostic>>
pub fn diagnostics(&self, file: FileId) -> Cancellable<Vec<Diagnostic>>
Sourcepub fn format(&self, file: FileId) -> Cancellable<Option<String>>
pub fn format(&self, file: FileId) -> Cancellable<Option<String>>
Format file’s source, returning the tidied text — or None if the file is unknown.
Safe by construction: it normalizes whitespace + indentation and never changes meaning,
falling back to the original on anything it can’t safely reformat (see gdscript_fmt).
§Errors
Sourcepub fn document_symbols(&self, file: FileId) -> Cancellable<Vec<DocumentSymbol>>
pub fn document_symbols(&self, file: FileId) -> Cancellable<Vec<DocumentSymbol>>
The document outline (classes, funcs, vars, consts, enums, signals, members).
§Errors
Sourcepub fn semantic_tokens(&self, file: FileId) -> Cancellable<Vec<SemanticToken>>
pub fn semantic_tokens(&self, file: FileId) -> Cancellable<Vec<SemanticToken>>
Semantic-highlighting tokens: each meaningful token classified by its contextual role (declarations, types, parameters, members, calls, literals, comments) — richer than a grammar. In source order.
§Errors
Sourcepub fn folding_ranges(&self, file: FileId) -> Cancellable<Vec<FoldRange>>
pub fn folding_ranges(&self, file: FileId) -> Cancellable<Vec<FoldRange>>
Sourcepub fn completions(&self, pos: FilePosition) -> Cancellable<Vec<CompletionItem>>
pub fn completions(&self, pos: FilePosition) -> Cancellable<Vec<CompletionItem>>
Completions. After receiver. it offers the inferred member set; otherwise (or when
the receiver is Variant/Unknown) it falls back to the Tier-0 by-name completion
(keywords, annotations after @, document-local symbols) so it never regresses.
§Errors
Sourcepub fn hover(&self, pos: FilePosition) -> Cancellable<Option<HoverResult>>
pub fn hover(&self, pos: FilePosition) -> Cancellable<Option<HoverResult>>
Hover: the inferred type of the expression / binding under the cursor (Unknown
elided). None when there is nothing typed there.
§Errors
Sourcepub fn inlay_hints(&self, file: FileId) -> Cancellable<Vec<InlayHint>>
pub fn inlay_hints(&self, file: FileId) -> Cancellable<Vec<InlayHint>>
Inlay : T hints on := declarations + unannotated params / for-vars (suppressed
when the type is Variant/Unknown).
§Errors
Sourcepub fn signature_help(
&self,
pos: FilePosition,
) -> Cancellable<Option<SignatureHelp>>
pub fn signature_help( &self, pos: FilePosition, ) -> Cancellable<Option<SignatureHelp>>
Signature help at a call site (active parameter by top-level comma count).
§Errors
Sourcepub fn code_actions(&self, pos: FilePosition) -> Cancellable<Vec<CodeAction>>
pub fn code_actions(&self, pos: FilePosition) -> Cancellable<Vec<CodeAction>>
Sourcepub fn goto_definition(&self, pos: FilePosition) -> Cancellable<Vec<NavTarget>>
pub fn goto_definition(&self, pos: FilePosition) -> Cancellable<Vec<NavTarget>>
Go-to-definition: the declaration target(s) of the symbol under the cursor (cross-file).
§Errors
Sourcepub fn find_references(&self, pos: FilePosition) -> Cancellable<Vec<Reference>>
pub fn find_references(&self, pos: FilePosition) -> Cancellable<Vec<Reference>>
Find every reference to the symbol under the cursor, project-wide (incl. its declaration).
§Errors
Sourcepub fn rename(
&self,
pos: FilePosition,
new_name: &str,
) -> Cancellable<Result<SourceChange, RenameError>>
pub fn rename( &self, pos: FilePosition, new_name: &str, ) -> Cancellable<Result<SourceChange, RenameError>>
Rename the symbol under the cursor to new_name — a cross-file edit, or a refusal
(RenameError); never a partial edit.
§Errors
Err(Cancelled) if a concurrent apply_change invalidated this snapshot. The rename’s own
refusal is the Result inside the Cancellable.
Sourcepub fn workspace_symbols(&self, query: &str) -> Cancellable<Vec<NavTarget>>
pub fn workspace_symbols(&self, query: &str) -> Cancellable<Vec<NavTarget>>
Project-wide symbols matching query (fuzzy-ranked class names + members).
§Errors
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Analysis
impl !RefUnwindSafe for Analysis
impl !Sync for Analysis
impl !UnwindSafe for Analysis
impl Send for Analysis
impl Unpin for Analysis
impl UnsafeUnpin for Analysis
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.