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 salsa
database, and the hir crate, where majority of the analysis happens.
However, IDE specific bits of the analysis (most notably completion) happen
in this crate.
Structs§
- 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_changemethod, all existingAnalysisare canceled (most method returnErr(Canceled)). - Analysis
Host AnalysisHoststores the current state of the world.- Annotation
- Annotation
Config - Assist
- Assist
Config - Assist
Id - Unique identifier of the assist, should not be shown to the user directly.
- Call
Hierarchy Config - Call
Item - Completion
Config - Completion
Fields ToResolve - Completion
Item CompletionItemdescribes a single completion entity which expands to 1 or more entries in the editor pop-up.- Completion
Relevance - Crate
- Crate
Graph Builder - Diagnostic
- Diagnostics
Config - Documentation
- Holds documentation
- Expanded
Macro - File
Change - Encapsulate a bunch of raw
.setcalls on the database. - FileId
- Handle to a file in
Vfs - File
Structure Config - Find
AllRefs Config - Fold
- Generic
Parameter Hints - Goto
Definition Config - Highlight
- Highlight
Config - Highlight
Related Config - Highlighted
Range - HlMods
- HlRange
- Hover
Config - Hover
Goto Type Data - Hover
Result - Contains the results when hovering over an item
- Indel
InsertDelete– a single “atomic” change to text- Inlay
Fields ToResolve - Inlay
Hint - Inlay
Hint Label - Inlay
Hint Label Part - Inlay
Hints Config - Join
Lines Config - 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.- Line
Index - Maps flat
TextSizeoffsets to/from(line, column)representation. - Markup
- Memory
Layout Hover Config - Moniker
- Information which uniquely identifies a definition which might be referenceable outside of the source file. Visibility declarations do not affect presence.
- Moniker
Identifier - Navigation
Target NavigationTargetrepresents an element in the editor’s UI which you can click on to navigate to a particular piece of code.- Package
Information - Parallel
Prime Caches Progress - We’re indexing many crates.
- Query
- Range
Info - Info associated with a text range.
- Reference
Category - Reference
Search Result - Result of a reference search operation.
- Rename
Config - Rename
Error - Root
Database - Runnable
- Search
Scope - Generally,
search_scopereturns files that might contain references for the element. Forpub(crate)things it’s a crate, forpubthings it’s a crate and dependant crates. In some cases, the location of the references is known to within aTextRange, e.g. for things like local variables. - Semantics
- Primary API to get semantic information, like types, from syntax trees.
- Signature
Help - Contains information about an item signature as seen from a use site.
- Single
Resolve - Hold the
AssistIddata of a certain assist to resolve. The original id object cannot be used due to a'staticlifetime and the requirement to construct this struct dynamically during the resolve handling. - Snippet
- A user supplied snippet.
- Snippet
Edit - Source
Change - Source
Root - 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.
- Source
Root Id - SsrError
- Static
Index - A static representation of fully analyzed source code.
- Static
Indexed File - Structure
Node - Test
Item - Text
Edit - Text
Range - A range in text, represented as a pair of
TextSize. - Text
Size - A measure of text length. Also, equivalently, an index into text.
- TokenId
- Token
Static Data - Update
Test - Upmapping
Result
Enums§
- Adjustment
Hints - Adjustment
Hints Mode - Annotation
Kind - Annotation
Location - Assist
Kind - Assist
Resolve Strategy - 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.
- Callable
Snippets - Closure
Return Type Hints - Completion
Item Kind - The type of the completion item.
- Completion
Item RefMode - Diagnostic
Code - Direction
- Discriminant
Hints - Edition
- Expr
Fill Default Mode - File
System Edit - Fold
Kind - HlMod
- HlOperator
- HlPunct
- HlTag
- Hover
Action - Hover
DocFormat - Inlay
Hint Position - Inlay
Kind - Inlay
Tooltip - Lazy
Property - A type signaling that a value is either computed, or is available for computation.
- Lifetime
Elision Hints - Memory
Layout Hover Render Kind - Moniker
Descriptor Kind - Moniker
Kind - Moniker
Result - Runnable
Kind - Severity
- Snippet
Scope - A snippet scope describing where a snippet may apply to. These may differ slightly in meaning depending on the snippet trigger.
- Structure
Node Kind - Subst
TyLen - Symbol
Information Kind - Symbol
Kind - TestId
- Test
Item Kind - Vendored
Libraries Config