ide - Rust (original) (raw)

Expand description

ide crate provides “ide-centric” APIs for the rust-analyzer. That is, it generally operates with files and text ranges, and returns results as Strings, suitable for displaying to the human.

What powers this API are the RootDatabase struct, which defines a salsadatabase, and the hir crate, where majority of the analysis happens. However, IDE specific bits of the analysis (most notably completion) happen in this crate.

Analysis

Analysis is a snapshot of a world state at a moment in time. It is the main entry point for asking semantic information about the world. When the world state is advanced using AnalysisHost::apply_change method, all existingAnalysis are canceled (most method return Err(Canceled)).

AnalysisHost

AnalysisHost stores the current state of the world.

Annotation

AnnotationConfig

Assist

AssistConfig

AssistId

Unique identifier of the assist, should not be shown to the user directly.

CallHierarchyConfig

CallItem

CompletionConfig

CompletionFieldsToResolve

CompletionItem

CompletionItem describes a single completion entity which expands to 1 or more entries in the editor pop-up.

CompletionRelevance

Crate

CrateGraphBuilder

Diagnostic

DiagnosticsConfig

Documentation

Holds documentation

ExpandedMacro

FileChange

Encapsulate a bunch of raw .set calls on the database.

FileId

Handle to a file in [Vfs]

Fold

GenericParameterHints

Highlight

HighlightConfig

HighlightRelatedConfig

HighlightedRange

HlMods

HlRange

HoverConfig

HoverGotoTypeData

HoverResult

Contains the results when hovering over an item

Indel

InsertDelete – a single “atomic” change to text

InlayFieldsToResolve

InlayHint

InlayHintLabel

InlayHintLabelPart

InlayHintsConfig

JoinLinesConfig

Label

A type to specify UI label, like an entry in the list of assists. Enforces proper casing:

LineCol

(line, column) information in the native, UTF-8 encoding.

LineIndex

Maps flat TextSize offsets to/from (line, column) representation.

Markup

MemoryLayoutHoverConfig

Moniker

Information which uniquely identifies a definition which might be referenceable outside of the source file. Visibility declarations do not affect presence.

MonikerIdentifier

NavigationTarget

NavigationTarget represents an element in the editor’s UI which you can click on to navigate to a particular piece of code.

PackageInformation

ParallelPrimeCachesProgress

We’re indexing many crates.

Query

RangeInfo

Info associated with a text range.

ReferenceCategory

ReferenceSearchResult

RenameError

RootDatabase

Runnable

SearchScope

Generally, search_scope returns files that might contain references for the element. For pub(crate) things it’s a crate, for pub things it’s a crate and dependant crates. In some cases, the location of the references is known to within a TextRange, e.g. for things like local variables.

Semantics

Primary API to get semantic information, like types, from syntax trees.

SignatureHelp

Contains information about an item signature as seen from a use site.

SingleResolve

Hold the AssistId data of a certain assist to resolve. The original id object cannot be used due to a 'static lifetime and the requirement to construct this struct dynamically during the resolve handling.

Snippet

A user supplied snippet.

SnippetEdit

SourceChange

SourceRoot

Files are grouped into source roots. A source root is a directory on the file systems which is watched for changes. Typically it corresponds to a Rust crate. Source roots might be nested: in this case, a file belongs to the nearest enclosing source root. Paths to files are always relative to a source root, and the analyzer does not know the root path of the source root at all. So, a file from one source root can’t refer to a file in another source root by path.

SourceRootId

SsrError

StaticIndex

A static representation of fully analyzed source code.

StaticIndexedFile

StructureNode

TestItem

TextEdit

TextRange

A range in text, represented as a pair of TextSize.

TextSize

A measure of text length. Also, equivalently, an index into text.

TokenId

TokenStaticData

UpdateTest

UpmappingResult

AdjustmentHints

AdjustmentHintsMode

AnnotationKind

AnnotationLocation

AssistKind

AssistResolveStrategy

A way to control how many assist to resolve during the assist resolution. When an assist is resolved, its edits are calculated that might be costly to always do by default.

CallableSnippets

ClosureReturnTypeHints

CompletionItemKind

The type of the completion item.

CompletionItemRefMode

DiagnosticCode

Direction

DiscriminantHints

Edition

ExprFillDefaultMode

FileSystemEdit

FoldKind

HlMod

HlOperator

HlPunct

HlTag

HoverAction

HoverDocFormat

InlayHintPosition

InlayKind

InlayTooltip

LazyProperty

A type signaling that a value is either computed, or is available for computation.

LifetimeElisionHints

MemoryLayoutHoverRenderKind

MonikerDescriptorKind

MonikerKind

MonikerResult

RunnableKind

Severity

SnippetScope

A snippet scope describing where a snippet may apply to. These may differ slightly in meaning depending on the snippet trigger.

StructureNodeKind

SubstTyLen

SymbolInformationKind

SymbolKind

TestId

TestItemKind

VendoredLibrariesConfig

TryToNav

Cancellable

FilePosition

FileRange