blob: 64309fb28480968bd14b5c5d290fbd87a8ce0706 [file] [log] [blame] [edit]
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="This crate defines the core data structure representing IDE state – `RootDatabase`."><title>ide_db - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-84e720fa.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="ide_db" data-themes="" data-resource-suffix="" data-rustdoc-version="1.89.0 (29483883e 2025-08-04)" data-channel="1.89.0" data-search-js="search-92309212.js" data-settings-js="settings-5514c975.js" ><script src="../static.files/storage-4e99c027.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-fd3af306.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../ide_db/index.html">ide_db</a><span class="version">0.0.0</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section id="rustdoc-toc"><h3><a href="#reexports">Crate Items</a></h3><ul class="block"><li><a href="#reexports" title="Re-exports">Re-exports</a></li><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#macros" title="Macros">Macros</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Crate <span>ide_db</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/ide_db/lib.rs.html#1-366">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This crate defines the core data structure representing IDE state – <code>RootDatabase</code>.</p>
<p>It is mainly a <code>HirDatabase</code> for semantic analysis, plus a <code>SymbolsDatabase</code>, for fuzzy search.</p>
</div></details><h2 id="reexports" class="section-header">Re-exports<a href="#reexports" class="anchor">§</a></h2><dl class="item-table reexports"><dt id="reexport.line_index"><code>pub use ::line_index;</code></dt><dt id="reexport.base_db"><code>pub use base_db;</code></dt><dt id="reexport.span"><code>pub use span;</code></dt></dl><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="active_parameter/index.html" title="mod ide_db::active_parameter">active_<wbr>parameter</a></dt><dd>This module provides functionality for querying callable information about a token.</dd><dt><a class="mod" href="assists/index.html" title="mod ide_db::assists">assists</a></dt><dd>This module defines the <code>Assist</code> data structure. The actual assist live in
the <code>ide_assists</code> downstream crate. We want to define the data structures in
this low-level crate though, because <code>ide_diagnostics</code> also need them
(fixits for diagnostics and assists are the same thing under the hood). We
want to compile <code>ide_assists</code> and <code>ide_diagnostics</code> in parallel though, so
we pull the common definitions upstream, to this crate.</dd><dt><a class="mod" href="defs/index.html" title="mod ide_db::defs">defs</a></dt><dd><code>NameDefinition</code> keeps information about the element we want to search references for.
The element is represented by <code>NameKind</code>. It’s located inside some <code>container</code> and
has a <code>visibility</code>, which defines a search scope.
Note that the reference search is possible for not all of the classified items.</dd><dt><a class="mod" href="documentation/index.html" title="mod ide_db::documentation">documentation</a></dt><dd>Documentation attribute related utilities.</dd><dt><a class="mod" href="famous_defs/index.html" title="mod ide_db::famous_defs">famous_<wbr>defs</a></dt><dd>See <a href="famous_defs/struct.FamousDefs.html" title="struct ide_db::famous_defs::FamousDefs"><code>FamousDefs</code></a>.</dd><dt><a class="mod" href="generated/index.html" title="mod ide_db::generated">generated</a></dt><dt><a class="mod" href="helpers/index.html" title="mod ide_db::helpers">helpers</a></dt><dd>Random assortment of ide helpers for high-level ide features that don’t fit in any other module.</dd><dt><a class="mod" href="imports/index.html" title="mod ide_db::imports">imports</a></dt><dt><a class="mod" href="items_locator/index.html" title="mod ide_db::items_locator">items_<wbr>locator</a></dt><dd>This module has the functionality to search the project and its dependencies for a certain item,
by its name and a few criteria.
The main reason for this module to exist is the fact that project’s items and dependencies’ items
are located in different caches, with different APIs.</dd><dt><a class="mod" href="label/index.html" title="mod ide_db::label">label</a></dt><dd>See <a href="label/struct.Label.html" title="struct ide_db::label::Label"><code>Label</code></a></dd><dt><a class="mod" href="path_transform/index.html" title="mod ide_db::path_transform">path_<wbr>transform</a></dt><dd>See <a href="path_transform/struct.PathTransform.html" title="struct ide_db::path_transform::PathTransform"><code>PathTransform</code></a>.</dd><dt><a class="mod" href="prime_caches/index.html" title="mod ide_db::prime_caches">prime_<wbr>caches</a></dt><dd>rust-analyzer is lazy and doesn’t compute anything unless asked. This
sometimes is counter productive when, for example, the first goto definition
request takes longer to compute. This module implements prepopulation of
various caches, it’s not really advanced at the moment.</dd><dt><a class="mod" href="rename/index.html" title="mod ide_db::rename">rename</a></dt><dd>Rename infrastructure for rust-analyzer. It is used primarily for the
literal “rename” in the ide (look for tests there), but it is also available
as a general-purpose service. For example, it is used by the fix for the
“incorrect case” diagnostic.</dd><dt><a class="mod" href="rust_doc/index.html" title="mod ide_db::rust_doc">rust_<wbr>doc</a></dt><dd>Rustdoc specific doc comment handling</dd><dt><a class="mod" href="search/index.html" title="mod ide_db::search">search</a></dt><dd>Implementation of find-usages functionality.</dd><dt><a class="mod" href="source_change/index.html" title="mod ide_db::source_change">source_<wbr>change</a></dt><dd>This modules defines type to represent changes to the source code, that flow
from the server to the client.</dd><dt><a class="mod" href="symbol_index/index.html" title="mod ide_db::symbol_index">symbol_<wbr>index</a></dt><dd>This module handles fuzzy-searching of functions, structs and other symbols
by name across the whole workspace and dependencies.</dd><dt><a class="mod" href="syntax_helpers/index.html" title="mod ide_db::syntax_helpers">syntax_<wbr>helpers</a></dt><dt><a class="mod" href="text_edit/index.html" title="mod ide_db::text_edit">text_<wbr>edit</a></dt><dd>Representation of a <code>TextEdit</code>.</dd><dt><a class="mod" href="traits/index.html" title="mod ide_db::traits">traits</a></dt><dd>Functionality for obtaining data related to traits from the DB.</dd><dt><a class="mod" href="ty_filter/index.html" title="mod ide_db::ty_filter">ty_<wbr>filter</a></dt><dd>This module contains structures for filtering the expected types.
Use case for structures in this module is, for example, situation when you need to process
only certain <code>Enum</code>s.</dd><dt><a class="mod" href="use_trivial_constructor/index.html" title="mod ide_db::use_trivial_constructor">use_<wbr>trivial_<wbr>constructor</a></dt><dd>Functionality for generating trivial constructors</dd></dl><h2 id="macros" class="section-header">Macros<a href="#macros" class="anchor">§</a></h2><dl class="item-table"><dt><a class="macro" href="macro._bail.html" title="macro ide_db::_bail">_bail</a></dt><dt><a class="macro" href="macro._format_err.html" title="macro ide_db::_format_err">_format_<wbr>err</a></dt></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.ChangeWithProcMacros.html" title="struct ide_db::ChangeWithProcMacros">Change<wbr>With<wbr>Proc<wbr>Macros</a></dt><dt><a class="struct" href="struct.EditionedFileId.html" title="struct ide_db::EditionedFileId">Editioned<wbr>File<wbr>Id</a></dt><dt><a class="struct" href="struct.FileId.html" title="struct ide_db::FileId">FileId</a></dt><dd>Handle to a file in [<code>Vfs</code>]</dd><dt><a class="struct" href="struct.FxHasher.html" title="struct ide_db::FxHasher">FxHasher</a></dt><dd>A speedy hash algorithm for use within rustc. The hashmap in liballoc
by default uses SipHash which isn’t quite as speedy as we want. In the
compiler we’re not really worried about DOS attempts, so we use a fast
non-cryptographic hash.</dd><dt><a class="struct" href="struct.Ranker.html" title="struct ide_db::Ranker">Ranker</a></dt><dt><a class="struct" href="struct.RootDatabase.html" title="struct ide_db::RootDatabase">Root<wbr>Database</a></dt><dt><a class="struct" href="struct.SnippetCap.html" title="struct ide_db::SnippetCap">Snippet<wbr>Cap</a></dt></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.Severity.html" title="enum ide_db::Severity">Severity</a></dt><dt><a class="enum" href="enum.SymbolKind.html" title="enum ide_db::SymbolKind">Symbol<wbr>Kind</a></dt></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.LineIndexDatabase.html" title="trait ide_db::LineIndexDatabase">Line<wbr>Index<wbr>Database</a></dt></dl><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><dl class="item-table"><dt><a class="type" href="type.FilePosition.html" title="type ide_db::FilePosition">File<wbr>Position</a></dt><dt><a class="type" href="type.FileRange.html" title="type ide_db::FileRange">File<wbr>Range</a></dt><dt><a class="type" href="type.FxHashMap.html" title="type ide_db::FxHashMap">FxHash<wbr>Map</a></dt><dd>Type alias for a hash map that uses the Fx hashing algorithm.</dd><dt><a class="type" href="type.FxHashSet.html" title="type ide_db::FxHashSet">FxHash<wbr>Set</a></dt><dd>Type alias for a hash set that uses the Fx hashing algorithm.</dd><dt><a class="type" href="type.FxIndexMap.html" title="type ide_db::FxIndexMap">FxIndex<wbr>Map</a></dt><dd><code>base_db</code> is normally also needed in places where <code>ide_db</code> is used, so this re-export is for convenience.</dd><dt><a class="type" href="type.FxIndexSet.html" title="type ide_db::FxIndexSet">FxIndex<wbr>Set</a></dt><dd><code>base_db</code> is normally also needed in places where <code>ide_db</code> is used, so this re-export is for convenience.</dd></dl></section></div></main></body></html>