repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/moniker.rs
src/tools/rust-analyzer/crates/ide/src/moniker.rs
//! This module generates [moniker](https://microsoft.github.io/language-server-protocol/specifications/lsif/0.6.0/specification/#exportsImports) //! for LSIF and LSP. use core::fmt; use hir::{Adt, AsAssocItem, Crate, HirDisplay, MacroKind, Semantics}; use ide_db::{ FilePosition, RootDatabase, base_db::{Crate...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/markup.rs
src/tools/rust-analyzer/crates/ide/src/markup.rs
//! Markdown formatting. //! //! Sometimes, we want to display a "rich text" in the UI. At the moment, we use //! markdown for this purpose. It doesn't feel like a right option, but that's //! what is used by LSP, so let's keep it simple. use std::fmt; use ide_db::impl_empty_upmap_from_ra_fixture; #[derive(Clone, Def...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/matching_brace.rs
src/tools/rust-analyzer/crates/ide/src/matching_brace.rs
use syntax::{ SourceFile, SyntaxKind, T, TextSize, ast::{self, AstNode}, }; // Feature: Matching Brace // // If the cursor is on any brace (`<>(){}[]||`) which is a part of a brace-pair, // moves cursor to the matching brace. It uses the actual parser to determine // braces, so it won't confuse generics with c...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/view_crate_graph.rs
src/tools/rust-analyzer/crates/ide/src/view_crate_graph.rs
use dot::{Id, LabelText}; use ide_db::base_db::salsa::plumbing::AsId; use ide_db::{ FxHashMap, RootDatabase, base_db::{ BuiltCrateData, BuiltDependency, Crate, ExtraCrateData, RootQueryDb, SourceDatabase, }, }; // Feature: View Crate Graph // // Renders the currently loaded crate graph as an SVG gr...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/lib.rs
src/tools/rust-analyzer/crates/ide/src/lib.rs
//! 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,...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/highlight_related.rs
src/tools/rust-analyzer/crates/ide/src/highlight_related.rs
use std::iter; use hir::{EditionedFileId, FilePosition, FileRange, HirFileId, InFile, Semantics, db}; use ide_db::{ FxHashMap, FxHashSet, RootDatabase, defs::{Definition, IdentClass}, helpers::pick_best_token, search::{FileReference, ReferenceCategory, SearchScope}, syntax_helpers::node_ext::{ ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/goto_declaration.rs
src/tools/rust-analyzer/crates/ide/src/goto_declaration.rs
use hir::{AsAssocItem, Semantics}; use ide_db::{ RootDatabase, defs::{Definition, NameClass, NameRefClass}, }; use syntax::{AstNode, SyntaxKind::*, T, ast, match_ast}; use crate::{ FilePosition, GotoDefinitionConfig, NavigationTarget, RangeInfo, goto_definition::goto_definition, navigation_target::TryT...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/expand_macro.rs
src/tools/rust-analyzer/crates/ide/src/expand_macro.rs
use hir::db::ExpandDatabase; use hir::{ExpandResult, InFile, Semantics}; use ide_db::{ FileId, RootDatabase, base_db::Crate, helpers::pick_best_token, syntax_helpers::prettify_macro_expansion, }; use span::{SpanMap, TextRange, TextSize}; use stdx::format_to; use syntax::{AstNode, NodeOrToken, SyntaxKind, Syntax...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/file_structure.rs
src/tools/rust-analyzer/crates/ide/src/file_structure.rs
use ide_db::SymbolKind; use syntax::{ AstNode, AstToken, NodeOrToken, SourceFile, SyntaxNode, SyntaxToken, TextRange, WalkEvent, ast::{self, HasAttrs, HasGenericParams, HasName}, match_ast, }; #[derive(Debug, Clone)] pub struct StructureNode { pub parent: Option<usize>, pub label: String, pub n...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/folding_ranges.rs
src/tools/rust-analyzer/crates/ide/src/folding_ranges.rs
use ide_db::{FxHashSet, syntax_helpers::node_ext::vis_eq}; use syntax::{ Direction, NodeOrToken, SourceFile, SyntaxKind::{self, *}, SyntaxNode, TextRange, TextSize, ast::{self, AstNode, AstToken}, match_ast, }; use std::hash::Hash; const REGION_START: &str = "// region:"; const REGION_END: &str = ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/rename.rs
src/tools/rust-analyzer/crates/ide/src/rename.rs
//! Renaming functionality. //! //! This is mostly front-end for [`ide_db::rename`], but it also includes the //! tests. This module also implements a couple of magic tricks, like renaming //! `self` and to `self` (to switch between associated function and method). use hir::{AsAssocItem, FindPathConfig, HasContainer, ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/references.rs
src/tools/rust-analyzer/crates/ide/src/references.rs
//! This module implements a reference search. //! First, the element at the cursor position must be either an `ast::Name` //! or `ast::NameRef`. If it's an `ast::NameRef`, at the classification step we //! try to resolve the direct tree parent of this element, otherwise we //! already have a definition and just need t...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/view_item_tree.rs
src/tools/rust-analyzer/crates/ide/src/view_item_tree.rs
use hir::{Semantics, db::DefDatabase}; use ide_db::{FileId, RootDatabase}; // Feature: Debug ItemTree // // Displays the ItemTree of the currently open file, for debugging. // // | Editor | Action Name | // |---------|-------------| // | VS Code | **rust-analyzer: Debug ItemTree** | pub(crate) fn view_item_tree(db: &...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/status.rs
src/tools/rust-analyzer/crates/ide/src/status.rs
use ide_db::RootDatabase; use ide_db::base_db::{BuiltCrateData, ExtraCrateData}; use itertools::Itertools; use span::FileId; use stdx::format_to; // Feature: Status // // Shows internal statistic about memory usage of rust-analyzer. // // | Editor | Action Name | // |---------|-------------| // | VS Code | **rust-ana...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/annotations.rs
src/tools/rust-analyzer/crates/ide/src/annotations.rs
use hir::{HasSource, InFile, InRealFile, Semantics}; use ide_db::{ FileId, FilePosition, FileRange, FxIndexSet, MiniCore, RootDatabase, defs::Definition, helpers::visit_file_defs, }; use itertools::Itertools; use syntax::{AstNode, TextRange, ast::HasName}; use crate::{ NavigationTarget, RunnableKind, a...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/inlay_hints.rs
src/tools/rust-analyzer/crates/ide/src/inlay_hints.rs
use std::{ fmt::{self, Write}, mem::{self, take}, }; use either::Either; use hir::{ ClosureStyle, DisplayTarget, EditionedFileId, HasVisibility, HirDisplay, HirDisplayError, HirWrite, InRealFile, ModuleDef, ModuleDefId, Semantics, sym, }; use ide_db::{ FileRange, MiniCore, RootDatabase, famous_defs...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/markdown_remove.rs
src/tools/rust-analyzer/crates/ide/src/markdown_remove.rs
//! Removes markdown from strings. use pulldown_cmark::{Event, Parser, Tag}; /// Removes all markdown, keeping the text and code blocks /// /// Currently limited in styling, i.e. no ascii tables or lists pub(crate) fn remove_markdown(markdown: &str) -> String { let mut out = String::new(); out.reserve_exact(ma...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/goto_implementation.rs
src/tools/rust-analyzer/crates/ide/src/goto_implementation.rs
use hir::{AsAssocItem, Impl, Semantics}; use ide_db::{ RootDatabase, defs::{Definition, NameClass, NameRefClass}, helpers::pick_best_token, }; use syntax::{AstNode, SyntaxKind::*, T, ast}; use crate::{FilePosition, NavigationTarget, RangeInfo, TryToNav}; pub struct GotoImplementationConfig { pub filte...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/hover.rs
src/tools/rust-analyzer/crates/ide/src/hover.rs
mod render; #[cfg(test)] mod tests; use std::{iter, ops::Not}; use either::Either; use hir::{DisplayTarget, GenericDef, GenericSubstitution, HasCrate, HasSource, Semantics}; use ide_db::{ FileRange, FxIndexSet, MiniCore, Ranker, RootDatabase, defs::{Definition, IdentClass, NameRefClass, OperatorClass}, f...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/fetch_crates.rs
src/tools/rust-analyzer/crates/ide/src/fetch_crates.rs
use ide_db::{ FileId, FxIndexSet, RootDatabase, base_db::{CrateOrigin, RootQueryDb}, }; #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct CrateInfo { pub name: Option<String>, pub version: Option<String>, pub root_file_id: FileId, } // Feature: Show Dependency Tree // // Shows a vi...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/view_mir.rs
src/tools/rust-analyzer/crates/ide/src/view_mir.rs
use hir::{DefWithBody, Semantics}; use ide_db::{FilePosition, RootDatabase}; use syntax::{AstNode, algo::ancestors_at_offset, ast}; // Feature: View Mir // // | Editor | Action Name | // |---------|-------------| // | VS Code | **rust-analyzer: View Mir** pub(crate) fn view_mir(db: &RootDatabase, position: FilePositi...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/fixture.rs
src/tools/rust-analyzer/crates/ide/src/fixture.rs
//! Utilities for creating `Analysis` instances for tests. use test_fixture::ChangeFixture; use test_utils::{RangeOrOffset, extract_annotations}; use crate::{Analysis, AnalysisHost, FileId, FilePosition, FileRange}; /// Creates analysis for a single file. pub(crate) fn file(#[rust_analyzer::rust_fixture] ra_fixture: ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/runnables.rs
src/tools/rust-analyzer/crates/ide/src/runnables.rs
use std::{fmt, sync::OnceLock}; use arrayvec::ArrayVec; use ast::HasName; use cfg::{CfgAtom, CfgExpr}; use hir::{AsAssocItem, HasAttrs, HasCrate, HasSource, Semantics, Symbol, db::HirDatabase, sym}; use ide_assists::utils::{has_test_related_attribute, test_related_attribute_syn}; use ide_db::impl_empty_upmap_from_ra_f...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/view_memory_layout.rs
src/tools/rust-analyzer/crates/ide/src/view_memory_layout.rs
use std::fmt; use hir::{DisplayTarget, Field, HirDisplay, Layout, Semantics, Type}; use ide_db::{ RootDatabase, defs::Definition, helpers::{get_definition, pick_best_token}, }; use syntax::{AstNode, SyntaxKind}; use crate::FilePosition; pub struct MemoryLayoutNode { pub item_name: String, pub typ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/doc_links.rs
src/tools/rust-analyzer/crates/ide/src/doc_links.rs
//! Extracts, resolves and rewrites links and intra-doc links in markdown documentation. #[cfg(test)] mod tests; mod intra_doc_links; use std::ops::Range; use pulldown_cmark::{BrokenLink, CowStr, Event, InlineStr, LinkType, Options, Parser, Tag}; use pulldown_cmark_to_cmark::{Options as CMarkOptions, cmark_with_opt...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/join_lines.rs
src/tools/rust-analyzer/crates/ide/src/join_lines.rs
use ide_assists::utils::extract_trivial_expression; use ide_db::syntax_helpers::node_ext::expr_as_name_ref; use itertools::Itertools; use syntax::{ NodeOrToken, SourceFile, SyntaxElement, SyntaxKind::{self, USE_TREE, WHITESPACE}, SyntaxToken, T, TextRange, TextSize, ast::{self, AstNode, AstToken, IsStri...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/move_item.rs
src/tools/rust-analyzer/crates/ide/src/move_item.rs
use std::{iter::once, mem}; use hir::Semantics; use ide_db::syntax_helpers::tree_diff::diff; use ide_db::text_edit::{TextEdit, TextEditBuilder}; use ide_db::{FileRange, RootDatabase, helpers::pick_best_token}; use itertools::Itertools; use syntax::{AstNode, SyntaxElement, SyntaxKind, SyntaxNode, TextRange, ast, match_...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/test_explorer.rs
src/tools/rust-analyzer/crates/ide/src/test_explorer.rs
//! Discovers tests use hir::{Crate, Module, ModuleDef, Semantics}; use ide_db::base_db; use ide_db::{FileId, RootDatabase, base_db::RootQueryDb}; use syntax::TextRange; use crate::{NavigationTarget, Runnable, TryToNav, runnables::runnable_fn}; #[derive(Debug)] pub enum TestItemKind { Crate(base_db::Crate), ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/goto_definition.rs
src/tools/rust-analyzer/crates/ide/src/goto_definition.rs
use std::{iter, mem::discriminant}; use crate::Analysis; use crate::{ FilePosition, NavigationTarget, RangeInfo, TryToNav, UpmappingResult, doc_links::token_as_doc_comment, navigation_target::{self, ToNav}, }; use hir::{ AsAssocItem, AssocItem, CallableKind, FileRange, HasCrate, InFile, ModuleDef, Sema...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/typing.rs
src/tools/rust-analyzer/crates/ide/src/typing.rs
//! This module handles auto-magic editing actions applied together with users //! edits. For example, if the user typed //! //! ```text //! foo //! .bar() //! .baz() //! | // <- cursor is here //! ``` //! //! and types `.` next, we want to indent the dot. //! //! Language server executes such...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/goto_type_definition.rs
src/tools/rust-analyzer/crates/ide/src/goto_type_definition.rs
use hir::GenericParam; use ide_db::{RootDatabase, defs::Definition, helpers::pick_best_token}; use syntax::{AstNode, SyntaxKind::*, SyntaxToken, T, ast, match_ast}; use crate::{FilePosition, NavigationTarget, RangeInfo, TryToNav}; // Feature: Go to Type Definition // // Navigates to the type of an identifier. // // |...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/ssr.rs
src/tools/rust-analyzer/crates/ide/src/ssr.rs
//! This module provides an SSR assist. It is not desirable to include this //! assist in ide_assists because that would require the ide_assists crate //! depend on the ide_ssr crate. use ide_assists::{Assist, AssistId, AssistResolveStrategy, GroupLabel}; use ide_db::{FileRange, RootDatabase, label::Label, source_chan...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/parent_module.rs
src/tools/rust-analyzer/crates/ide/src/parent_module.rs
use hir::{Semantics, crate_def_map}; use ide_db::{ FileId, FilePosition, RootDatabase, base_db::{Crate, RootQueryDb}, }; use itertools::Itertools; use syntax::{ algo::find_node_at_offset, ast::{self, AstNode}, }; use crate::NavigationTarget; // Feature: Parent Module // // Navigates to the parent modu...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/signature_help.rs
src/tools/rust-analyzer/crates/ide/src/signature_help.rs
//! This module provides primitives for showing type and function parameter information when editing //! a call or use-site. use std::collections::BTreeSet; use either::Either; use hir::{ AssocItem, DisplayTarget, GenericDef, GenericParam, HirDisplay, ModuleDef, PathResolution, Semantics, Trait, }; use ide_db...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/interpret.rs
src/tools/rust-analyzer/crates/ide/src/interpret.rs
use hir::{ConstEvalError, DefWithBody, DisplayTarget, Semantics}; use ide_db::{FilePosition, LineIndexDatabase, RootDatabase, base_db::SourceDatabase}; use std::time::{Duration, Instant}; use stdx::format_to; use syntax::{AstNode, TextRange, algo::ancestors_at_offset, ast}; // Feature: Interpret A Function, Static Or ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/view_syntax_tree.rs
src/tools/rust-analyzer/crates/ide/src/view_syntax_tree.rs
use hir::Semantics; use ide_db::{ FileId, LineIndexDatabase, RootDatabase, line_index::{LineCol, LineIndex}, }; use span::{TextRange, TextSize}; use stdx::format_to; use syntax::{ AstNode, AstToken, NodeOrToken, SourceFile, SyntaxNode, SyntaxToken, WalkEvent, ast::{self, IsString}, }; use triomphe::Arc;...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/view_hir.rs
src/tools/rust-analyzer/crates/ide/src/view_hir.rs
use hir::Semantics; use ide_db::{FilePosition, RootDatabase}; use syntax::AstNode; // Feature: View Hir // // | Editor | Action Name | // |---------|--------------| // | VS Code | **rust-analyzer: View Hir** // // ![View Hir](https://user-images.githubusercontent.com/48062697/113065588-068bdb80-91b1-11eb-9a78-0b4ef1e...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting.rs
src/tools/rust-analyzer/crates/ide/src/syntax_highlighting.rs
pub(crate) mod tags; mod highlights; mod escape; mod format; mod highlight; mod inject; mod html; #[cfg(test)] mod tests; use std::ops::ControlFlow; use either::Either; use hir::{DefWithBody, EditionedFileId, InFile, InRealFile, MacroKind, Name, Semantics}; use ide_db::{FxHashMap, FxHashSet, MiniCore, Ranker, Root...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/doc_links/intra_doc_links.rs
src/tools/rust-analyzer/crates/ide/src/doc_links/intra_doc_links.rs
//! Helper tools for intra doc links. const TYPES: (&[&str], &[&str]) = (&["type", "struct", "enum", "mod", "trait", "union", "module", "prim", "primitive"], &[]); const VALUES: (&[&str], &[&str]) = (&["value", "function", "fn", "method", "const", "static", "mod", "module"], &["()"]); const MACROS: (&[&str], &...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/doc_links/tests.rs
src/tools/rust-analyzer/crates/ide/src/doc_links/tests.rs
use std::{borrow::Cow, iter}; use expect_test::{Expect, expect}; use hir::Semantics; use ide_db::{ FilePosition, FileRange, RootDatabase, defs::Definition, documentation::{Documentation, HasDocs}, }; use itertools::Itertools; use syntax::{AstNode, SyntaxNode, ast, match_ast}; use crate::{ TryToNav, ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/annotations/fn_references.rs
src/tools/rust-analyzer/crates/ide/src/annotations/fn_references.rs
//! This module implements a methods and free functions search in the specified file. //! We have to skip tests, so cannot reuse file_structure module. use hir::Semantics; use ide_assists::utils::test_related_attribute_syn; use ide_db::RootDatabase; use syntax::{AstNode, SyntaxNode, TextRange, ast, ast::HasName}; use...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/typing/on_enter.rs
src/tools/rust-analyzer/crates/ide/src/typing/on_enter.rs
//! Handles the `Enter` key press. At the momently, this only continues //! comments, but should handle indent some time in the future as well. use ide_db::base_db::RootQueryDb; use ide_db::{FilePosition, RootDatabase}; use syntax::{ AstNode, SmolStr, SourceFile, SyntaxKind::*, SyntaxNode, SyntaxToken, Tex...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/hover/tests.rs
src/tools/rust-analyzer/crates/ide/src/hover/tests.rs
use expect_test::{Expect, expect}; use ide_db::{FileRange, MiniCore, base_db::SourceDatabase}; use syntax::TextRange; use crate::{ HoverConfig, HoverDocFormat, MemoryLayoutHoverConfig, MemoryLayoutHoverRenderKind, fixture, }; use hir::setup_tracing; const HOVER_BASE_CONFIG: HoverConfig<'_> = HoverConfig { li...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/hover/render.rs
src/tools/rust-analyzer/crates/ide/src/hover/render.rs
//! Logic for rendering the different hover messages use std::{borrow::Cow, env, mem, ops::Not}; use either::Either; use hir::{ Adt, AsAssocItem, AsExternAssocItem, CaptureKind, DisplayTarget, DropGlue, DynCompatibilityViolation, HasCrate, HasSource, HirDisplay, Layout, LayoutError, MethodViolationCode, Na...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/html.rs
src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/html.rs
//! Renders a bit of code as HTML. use hir::Semantics; use ide_db::MiniCore; use oorandom::Rand32; use stdx::format_to; use syntax::AstNode; use crate::{ FileId, RootDatabase, syntax_highlighting::{HighlightConfig, highlight}, }; pub(crate) fn highlight_as_html_with_config( db: &RootDatabase, config:...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/highlight.rs
src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/highlight.rs
//! Computes color for a single element. use std::ops::ControlFlow; use either::Either; use hir::{AsAssocItem, HasAttrs, HasVisibility, Semantics}; use ide_db::{ FxHashMap, RootDatabase, SymbolKind, defs::{Definition, IdentClass, NameClass, NameRefClass}, syntax_helpers::node_ext::walk_pat, }; use span::E...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/tests.rs
src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/tests.rs
use std::time::Instant; use expect_test::{ExpectFile, expect_file}; use ide_db::{MiniCore, SymbolKind}; use span::Edition; use test_utils::{AssertLinear, bench, bench_fixture, skip_slow_tests}; use crate::{FileRange, HighlightConfig, HlTag, TextRange, fixture}; const HL_CONFIG: HighlightConfig<'_> = HighlightConfig ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/inject.rs
src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/inject.rs
//! "Recursive" Syntax highlighting for code in doctests and fixtures. use hir::{EditionedFileId, HirFileId, InFile, Semantics}; use ide_db::{ SymbolKind, defs::Definition, documentation::Documentation, range_mapper::RangeMapper, rust_doc::is_rust_fence, }; use syntax::{ SyntaxNode, TextRange, TextSize, ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/highlights.rs
src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/highlights.rs
//! Collects a tree of highlighted ranges and flattens it. use std::iter; use stdx::equal_range_by; use syntax::TextRange; use crate::{HlRange, HlTag}; pub(super) struct Highlights { root: Node, } struct Node { hl_range: HlRange, nested: Vec<Node>, } impl Highlights { pub(super) fn new(range: TextR...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/format.rs
src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/format.rs
//! Syntax highlighting for format macro strings. use ide_db::{ SymbolKind, defs::Definition, syntax_helpers::format_string::{FormatSpecifier, is_format_string, lex_format_specifiers}, }; use span::Edition; use syntax::{AstToken, ast}; use crate::{ HlRange, HlTag, syntax_highlighting::{highlight::h...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/tags.rs
src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/tags.rs
//! Defines token tags we use for syntax highlighting. //! A tag is not unlike a CSS class. use std::{ fmt::{self, Write}, ops, }; use ide_db::SymbolKind; #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] pub struct Highlight { pub tag: HlTag, pub mods: HlMods, } #[derive(Default, ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/escape.rs
src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/escape.rs
//! Syntax highlighting for escape sequences use crate::syntax_highlighting::highlights::Highlights; use crate::{HlRange, HlTag}; use syntax::ast::{Byte, Char, IsString}; use syntax::{AstToken, TextRange, TextSize}; pub(super) fn highlight_escape_string<T: IsString>(stack: &mut Highlights, string: &T) { let text =...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/inlay_hints/ra_fixture.rs
src/tools/rust-analyzer/crates/ide/src/inlay_hints/ra_fixture.rs
//! Injected inlay hints for `#[rust_analyzer::rust_fixture]`. use hir::{EditionedFileId, Semantics}; use ide_db::{RootDatabase, impl_empty_upmap_from_ra_fixture, ra_fixture::UpmapFromRaFixture}; use syntax::{AstToken, ast}; use crate::{Analysis, InlayHint, InlayHintPosition, InlayHintsConfig, InlayKind, InlayTooltip...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/inlay_hints/chaining.rs
src/tools/rust-analyzer/crates/ide/src/inlay_hints/chaining.rs
//! Implementation of "chaining" inlay hints. use hir::DisplayTarget; use ide_db::famous_defs::FamousDefs; use syntax::{ Direction, NodeOrToken, SyntaxKind, T, ast::{self, AstNode}, }; use crate::{InlayHint, InlayHintPosition, InlayHintsConfig, InlayKind}; use super::label_of_ty; pub(super) fn hints( acc...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/inlay_hints/lifetime.rs
src/tools/rust-analyzer/crates/ide/src/inlay_hints/lifetime.rs
//! Implementation of "lifetime elision" inlay hints: //! ```no_run //! fn example/* <'0> */(a: &/* '0 */()) {} //! ``` use std::iter; use ide_db::{FxHashMap, famous_defs::FamousDefs, syntax_helpers::node_ext::walk_ty}; use itertools::Itertools; use syntax::{SmolStr, format_smolstr}; use syntax::{ SyntaxKind, Synt...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/inlay_hints/closure_captures.rs
src/tools/rust-analyzer/crates/ide/src/inlay_hints/closure_captures.rs
//! Implementation of "closure captures" inlay hints. //! //! Tests live in [`bind_pat`][super::bind_pat] module. use ide_db::famous_defs::FamousDefs; use ide_db::text_edit::{TextRange, TextSize}; use stdx::{TupleExt, never}; use syntax::ast::{self, AstNode}; use crate::{ InlayHint, InlayHintLabel, InlayHintLabelP...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/inlay_hints/closing_brace.rs
src/tools/rust-analyzer/crates/ide/src/inlay_hints/closing_brace.rs
//! Implementation of "closing brace" inlay hints: //! ```no_run //! fn g() { //! } /* fn g */ //! ``` use hir::{DisplayTarget, HirDisplay, InRealFile, Semantics}; use ide_db::{FileRange, RootDatabase}; use syntax::{ SyntaxKind, SyntaxNode, T, ast::{self, AstNode, HasLoopBody, HasName}, match_ast, }; use c...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/inlay_hints/implicit_static.rs
src/tools/rust-analyzer/crates/ide/src/inlay_hints/implicit_static.rs
//! Implementation of "implicit static" inlay hints: //! ```no_run //! static S: &/* 'static */str = ""; //! ``` use either::Either; use ide_db::famous_defs::FamousDefs; use ide_db::text_edit::TextEdit; use syntax::{ SyntaxKind, ast::{self, AstNode}, }; use crate::{InlayHint, InlayHintPosition, InlayHintsConfi...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/inlay_hints/bounds.rs
src/tools/rust-analyzer/crates/ide/src/inlay_hints/bounds.rs
//! Implementation of trait bound hints. //! //! Currently this renders the implied `Sized` bound. use ide_db::{FileRange, famous_defs::FamousDefs}; use syntax::ast::{self, AstNode, HasTypeBounds}; use crate::{ InlayHint, InlayHintLabel, InlayHintLabelPart, InlayHintPosition, InlayHintsConfig, InlayKind, TryT...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/inlay_hints/placeholders.rs
src/tools/rust-analyzer/crates/ide/src/inlay_hints/placeholders.rs
//! Implementation of type placeholder inlay hints: //! ```no_run //! let a = Vec<_> = vec![4]; //! //^ = i32 //! ``` use hir::DisplayTarget; use ide_db::famous_defs::FamousDefs; use syntax::{ AstNode, ast::{InferType, Type}, }; use crate::{InlayHint, InlayHintPosition, InlayHintsConfig, InlayKind, ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/inlay_hints/closure_ret.rs
src/tools/rust-analyzer/crates/ide/src/inlay_hints/closure_ret.rs
//! Implementation of "closure return type" inlay hints. //! //! Tests live in [`bind_pat`][super::bind_pat] module. use hir::DisplayTarget; use ide_db::{famous_defs::FamousDefs, text_edit::TextEditBuilder}; use syntax::ast::{self, AstNode}; use crate::{ ClosureReturnTypeHints, InlayHint, InlayHintPosition, InlayH...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/inlay_hints/implied_dyn_trait.rs
src/tools/rust-analyzer/crates/ide/src/inlay_hints/implied_dyn_trait.rs
//! Implementation of trait bound hints. //! //! Currently this renders the implied `Sized` bound. use either::Either; use ide_db::{famous_defs::FamousDefs, text_edit::TextEdit}; use syntax::ast::{self, AstNode}; use crate::{InlayHint, InlayHintLabel, InlayHintPosition, InlayHintsConfig, InlayKind}; pub(super) fn hi...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/inlay_hints/generic_param.rs
src/tools/rust-analyzer/crates/ide/src/inlay_hints/generic_param.rs
//! Implementation of inlay hints for generic parameters. use either::Either; use ide_db::{active_parameter::generic_def_for_node, famous_defs::FamousDefs}; use syntax::{ AstNode, ast::{self, AnyHasGenericArgs, HasGenericArgs, HasName}, }; use crate::{ InlayHint, InlayHintLabel, InlayHintsConfig, InlayKind...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/inlay_hints/bind_pat.rs
src/tools/rust-analyzer/crates/ide/src/inlay_hints/bind_pat.rs
//! Implementation of "type" inlay hints: //! ```no_run //! fn f(a: i32, b: i32) -> i32 { a + b } //! let _x /* i32 */= f(4, 4); //! ``` use hir::{DisplayTarget, Semantics}; use ide_db::{RootDatabase, famous_defs::FamousDefs}; use itertools::Itertools; use syntax::{ ast::{self, AstNode, HasGenericArgs, HasName}, ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/inlay_hints/range_exclusive.rs
src/tools/rust-analyzer/crates/ide/src/inlay_hints/range_exclusive.rs
//! Implementation of "range exclusive" inlay hints: //! ```ignore //! for i in 0../* < */10 {} //! if let ../* < */100 = 50 {} //! ``` use ide_db::famous_defs::FamousDefs; use syntax::{SyntaxToken, T, ast}; use crate::{InlayHint, InlayHintsConfig}; pub(super) fn hints( acc: &mut Vec<InlayHint>, FamousDefs(_s...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/inlay_hints/param_name.rs
src/tools/rust-analyzer/crates/ide/src/inlay_hints/param_name.rs
//! Implementation of "param name" inlay hints: //! ```no_run //! fn max(x: i32, y: i32) -> i32 { x + y } //! _ = max(/*x*/4, /*y*/4); //! ``` use std::iter::zip; use either::Either; use hir::{EditionedFileId, Semantics}; use ide_db::{RootDatabase, famous_defs::FamousDefs}; use stdx::to_lower_snake_case; use syntax:...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/inlay_hints/extern_block.rs
src/tools/rust-analyzer/crates/ide/src/inlay_hints/extern_block.rs
//! Extern block hints use ide_db::{famous_defs::FamousDefs, text_edit::TextEdit}; use syntax::{AstNode, SyntaxToken, ast}; use crate::{InlayHint, InlayHintsConfig}; pub(super) fn extern_block_hints( acc: &mut Vec<InlayHint>, FamousDefs(sema, _): &FamousDefs<'_, '_>, config: &InlayHintsConfig<'_>, ext...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/inlay_hints/discriminant.rs
src/tools/rust-analyzer/crates/ide/src/inlay_hints/discriminant.rs
//! Implementation of "enum variant discriminant" inlay hints: //! ```no_run //! enum Foo { //! Bar/* = 0*/, //! } //! ``` use hir::Semantics; use ide_db::text_edit::TextEdit; use ide_db::{RootDatabase, famous_defs::FamousDefs}; use syntax::ast::{self, AstNode, HasName}; use crate::{ DiscriminantHints, InlayHin...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/inlay_hints/implicit_drop.rs
src/tools/rust-analyzer/crates/ide/src/inlay_hints/implicit_drop.rs
//! Implementation of "implicit drop" inlay hints: //! ```ignore //! let x = vec![2]; //! if some_condition() { //! /* drop(x) */return; //! } //! ``` use hir::{ DefWithBody, db::{DefDatabase as _, HirDatabase as _}, mir::{MirSpan, TerminatorKind}, }; use ide_db::{FileRange, famous_defs::FamousDefs}; u...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/inlay_hints/binding_mode.rs
src/tools/rust-analyzer/crates/ide/src/inlay_hints/binding_mode.rs
//! Implementation of "binding mode" inlay hints: //! ```no_run //! let /* & */ (/* ref */ x,) = &(0,); //! ``` use std::mem; use hir::Mutability; use ide_db::famous_defs::FamousDefs; use ide_db::text_edit::TextEditBuilder; use syntax::ast::{self, AstNode}; use crate::{InlayHint, InlayHintLabel, InlayHintPosition, I...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/crates/ide/src/inlay_hints/adjustment.rs
src/tools/rust-analyzer/crates/ide/src/inlay_hints/adjustment.rs
//! Implementation of "adjustment" inlay hints: //! ```no_run //! let _: u32 = /* <never-to-any> */ loop {}; //! let _: &u32 = /* &* */ &mut 0; //! ``` use std::ops::Not; use either::Either; use hir::{ Adjust, Adjustment, AutoBorrow, DisplayTarget, HirDisplay, Mutability, OverloadedDeref, PointerCast, Safety,...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/xtask/src/publish.rs
src/tools/rust-analyzer/xtask/src/publish.rs
mod notes; use crate::flags; use anyhow::bail; use std::env; use xshell::{Shell, cmd}; impl flags::PublishReleaseNotes { pub(crate) fn run(self, sh: &Shell) -> anyhow::Result<()> { let asciidoc = sh.read_file(&self.changelog)?; let mut markdown = notes::convert_asciidoc_to_markdown(std::io::Cursor...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/xtask/src/flags.rs
src/tools/rust-analyzer/xtask/src/flags.rs
#![allow(unreachable_pub)] use std::{fmt, str::FromStr}; use crate::install::{ClientOpt, ProcMacroServerOpt, ServerOpt}; #[derive(Debug, Clone)] pub enum PgoTrainingCrate { // Use RA's own sources for PGO training RustAnalyzer, // Download a Rust crate from `https://github.com/{0}` and use it for PGO tra...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/xtask/src/install.rs
src/tools/rust-analyzer/xtask/src/install.rs
//! Installs rust-analyzer language server and/or editor plugin. use std::{env, path::PathBuf, str}; use anyhow::{Context, bail, format_err}; use xshell::{Shell, cmd}; use crate::{ flags::{self, Malloc, PgoTrainingCrate}, util::detect_target, }; impl flags::Install { pub(crate) fn run(self, sh: &Shell) ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/xtask/src/util.rs
src/tools/rust-analyzer/xtask/src/util.rs
use std::path::{Path, PathBuf}; use xshell::{Shell, cmd}; pub(crate) fn list_rust_files(dir: &Path) -> Vec<PathBuf> { let mut res = list_files(dir); res.retain(|it| { it.file_name().unwrap_or_default().to_str().unwrap_or_default().ends_with(".rs") }); res } pub(crate) fn list_files(dir: &Path...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/xtask/src/codegen.rs
src/tools/rust-analyzer/xtask/src/codegen.rs
use std::{ fmt, fs, mem, path::{Path, PathBuf}, }; use xshell::{Shell, cmd}; use crate::{ flags::{self, CodegenType}, project_root, }; pub(crate) mod assists_doc_tests; pub(crate) mod diagnostics_docs; pub(crate) mod feature_docs; mod grammar; mod lints; mod parser_inline_tests; impl flags::Codegen ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/xtask/src/pgo.rs
src/tools/rust-analyzer/xtask/src/pgo.rs
//! PGO (Profile-Guided Optimization) utilities. use anyhow::Context; use std::env::consts::EXE_EXTENSION; use std::ffi::OsStr; use std::path::{Path, PathBuf}; use xshell::{Cmd, Shell, cmd}; use crate::flags::PgoTrainingCrate; /// Decorates `ra_build_cmd` to add PGO instrumentation, and then runs the PGO instrumente...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/xtask/src/dist.rs
src/tools/rust-analyzer/xtask/src/dist.rs
use anyhow::Context; use flate2::{Compression, write::GzEncoder}; use std::{ fs::File, io::{self, BufWriter}, path::{Path, PathBuf}, }; use time::OffsetDateTime; use xshell::{Cmd, Shell, cmd}; use zip::{DateTime, ZipWriter, write::SimpleFileOptions}; use crate::{ date_iso, flags::{self, Malloc, Pgo...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/xtask/src/main.rs
src/tools/rust-analyzer/xtask/src/main.rs
//! See <https://github.com/matklad/cargo-xtask/>. //! //! This binary defines various auxiliary build commands, which are not //! expressible with just `cargo`. Notably, it provides tests via `cargo test -p xtask` //! for code generation and `cargo xtask install` for installation of //! rust-analyzer server and client...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/xtask/src/tidy.rs
src/tools/rust-analyzer/xtask/src/tidy.rs
#![allow(clippy::disallowed_types, clippy::print_stderr)] use std::{ collections::HashSet, path::{Path, PathBuf}, }; use itertools::Itertools; use xshell::Shell; use xshell::cmd; use crate::{flags::Tidy, project_root, util::list_files}; impl Tidy { pub(crate) fn run(&self, sh: &Shell) -> anyhow::Result<...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/xtask/src/metrics.rs
src/tools/rust-analyzer/xtask/src/metrics.rs
use std::{ collections::BTreeMap, fs, io::Write as _, path::Path, time::{Instant, SystemTime, UNIX_EPOCH}, }; use anyhow::format_err; use xshell::{Shell, cmd}; use crate::flags::{self, MeasurementType}; type Unit = String; impl flags::Metrics { pub(crate) fn run(self, sh: &Shell) -> anyhow::...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/xtask/src/release.rs
src/tools/rust-analyzer/xtask/src/release.rs
mod changelog; use xshell::{Shell, cmd}; use crate::{date_iso, flags, is_release_tag, project_root}; impl flags::Release { pub(crate) fn run(self, sh: &Shell) -> anyhow::Result<()> { if !self.dry_run { cmd!(sh, "git switch release").run()?; cmd!(sh, "git fetch upstream --tags --fo...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/xtask/src/release/changelog.rs
src/tools/rust-analyzer/xtask/src/release/changelog.rs
use std::fmt::Write; use std::{env, iter}; use anyhow::bail; use xshell::{Shell, cmd}; pub(crate) fn get_changelog( sh: &Shell, changelog_n: usize, commit: &str, prev_tag: &str, today: &str, ) -> anyhow::Result<String> { let token = match env::var("GITHUB_TOKEN") { Ok(token) => token, ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/xtask/src/publish/notes.rs
src/tools/rust-analyzer/xtask/src/publish/notes.rs
use anyhow::{anyhow, bail}; use std::{ borrow::Cow, io::{BufRead, Lines}, iter::Peekable, }; const LISTING_DELIMITER: &str = "----"; const IMAGE_BLOCK_PREFIX: &str = "image::"; const VIDEO_BLOCK_PREFIX: &str = "video::"; struct Converter<'a, 'b, R: BufRead> { iter: &'a mut Peekable<Lines<R>>, outp...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/xtask/src/codegen/grammar.rs
src/tools/rust-analyzer/xtask/src/codegen/grammar.rs
//! This module generates AST datatype used by rust-analyzer. //! //! Specifically, it generates the `SyntaxKind` enum and a number of newtype //! wrappers around `SyntaxNode` which implement `syntax::AstNode`. #![allow(clippy::disallowed_types)] use std::{ collections::{BTreeSet, HashSet}, fmt::Write, fs...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/xtask/src/codegen/diagnostics_docs.rs
src/tools/rust-analyzer/xtask/src/codegen/diagnostics_docs.rs
//! Generates `diagnostics_generated.md` documentation. use std::{fmt, fs, io, path::PathBuf}; use crate::{ codegen::{CommentBlock, Location, add_preamble}, project_root, util::list_rust_files, }; pub(crate) fn generate(check: bool) { let diagnostics = Diagnostic::collect().unwrap(); // Do not ge...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/xtask/src/codegen/parser_inline_tests.rs
src/tools/rust-analyzer/xtask/src/codegen/parser_inline_tests.rs
//! This module greps parser's code for specially formatted comments and turns //! them into tests. #![allow(clippy::disallowed_types, clippy::print_stdout)] use std::{ collections::HashMap, fs, iter, path::{Path, PathBuf}, time::SystemTime, }; use anyhow::Result; use itertools::Itertools as _; use c...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/xtask/src/codegen/assists_doc_tests.rs
src/tools/rust-analyzer/xtask/src/codegen/assists_doc_tests.rs
//! Generates `assists_generated.md` documentation. use std::{fmt, fs, path::Path}; use stdx::format_to_acc; use crate::{ codegen::{CommentBlock, Location, add_preamble, ensure_file_contents, reformat}, project_root, util::list_rust_files, }; pub(crate) fn generate(check: bool) { let assists = Assis...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/xtask/src/codegen/feature_docs.rs
src/tools/rust-analyzer/xtask/src/codegen/feature_docs.rs
//! Generates `features_generated.md` documentation. use std::{fmt, fs, io, path::PathBuf}; use crate::{ codegen::{CommentBlock, Location, add_preamble}, project_root, util::list_rust_files, }; pub(crate) fn generate(check: bool) { let features = Feature::collect().unwrap(); // Do not generate do...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/xtask/src/codegen/lints.rs
src/tools/rust-analyzer/xtask/src/codegen/lints.rs
//! Generates descriptor structures for unstable features from the unstable book //! and lints from rustc, rustdoc, and clippy. #![allow(clippy::disallowed_types)] use std::{ collections::{HashMap, hash_map}, fs, path::Path, str::FromStr, }; use edition::Edition; use stdx::format_to; use xshell::{Shel...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/xtask/src/codegen/grammar/ast_src.rs
src/tools/rust-analyzer/xtask/src/codegen/grammar/ast_src.rs
//! Defines input for code generation process. use quote::ToTokens; use crate::codegen::grammar::to_upper_snake_case; #[derive(Copy, Clone, Debug)] pub(crate) struct KindsSrc { pub(crate) punct: &'static [(&'static str, &'static str)], pub(crate) keywords: &'static [&'static str], pub(crate) contextual_k...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/lib/smol_str/src/borsh.rs
src/tools/rust-analyzer/lib/smol_str/src/borsh.rs
use crate::{INLINE_CAP, Repr, SmolStr}; use alloc::string::{String, ToString}; use borsh::{ BorshDeserialize, BorshSerialize, io::{Error, ErrorKind, Read, Write}, }; use core::mem::transmute; impl BorshSerialize for SmolStr { fn serialize<W: Write>(&self, writer: &mut W) -> borsh::io::Result<()> { ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/lib/smol_str/src/serde.rs
src/tools/rust-analyzer/lib/smol_str/src/serde.rs
use alloc::{string::String, vec::Vec}; use core::fmt; use serde::de::{Deserializer, Error, Unexpected, Visitor}; use serde_core as serde; use crate::SmolStr; // https://github.com/serde-rs/serde/blob/629802f2abfd1a54a6072992888fea7ca5bc209f/serde/src/private/de.rs#L56-L125 fn smol_str<'de: 'a, 'a, D>(deserializer: D...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/lib/smol_str/src/lib.rs
src/tools/rust-analyzer/lib/smol_str/src/lib.rs
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(docsrs, feature(doc_cfg))] #![debugger_visualizer(gdb_script_file = "gdb_smolstr_printer.py")] extern crate alloc; use alloc::{borrow::Cow, boxed::Box, string::String, sync::Arc}; use core::{ borrow::Borrow, cmp::{self, Ordering}, convert::Infallible,...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/lib/smol_str/tests/test.rs
src/tools/rust-analyzer/lib/smol_str/tests/test.rs
#![allow(clippy::disallowed_types)] use std::sync::Arc; #[cfg(not(miri))] use proptest::{prop_assert, prop_assert_eq, proptest}; use smol_str::{SmolStr, SmolStrBuilder}; #[test] #[cfg(target_pointer_width = "64")] fn smol_str_is_smol() { assert_eq!(::std::mem::size_of::<SmolStr>(), ::std::mem::size_of::<String>(...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/lib/smol_str/tests/tidy.rs
src/tools/rust-analyzer/lib/smol_str/tests/tidy.rs
#![allow(clippy::disallowed_methods, clippy::print_stdout)] #![cfg(not(miri))] use std::{ env, path::{Path, PathBuf}, process::{Command, Stdio}, }; fn project_root() -> PathBuf { PathBuf::from( env::var("CARGO_MANIFEST_DIR").unwrap_or_else(|_| env!("CARGO_MANIFEST_DIR").to_owned()), ) } fn...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/lib/smol_str/benches/bench.rs
src/tools/rust-analyzer/lib/smol_str/benches/bench.rs
use criterion::{Criterion, criterion_group, criterion_main}; use rand::distr::{Alphanumeric, SampleString}; use smol_str::{SmolStr, StrExt, ToSmolStr, format_smolstr}; use std::hint::black_box; /// 12: small (inline) /// 50: medium (heap) /// 1000: large (heap) const TEST_LENS: [usize; 3] = [12, 50, 1000]; fn format_...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/lib/text-size/src/lib.rs
src/tools/rust-analyzer/lib/text-size/src/lib.rs
//! Newtypes for working with text sizes/ranges in a more type-safe manner. //! //! This library can help with two things: //! * Reducing storage requirements for offsets and ranges, under the //! assumption that 32 bits is enough. //! * Providing standard vocabulary types for applications where text ranges //!...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/lib/text-size/src/range.rs
src/tools/rust-analyzer/lib/text-size/src/range.rs
use cmp::Ordering; use { crate::TextSize, std::{ cmp, fmt, ops::{Add, AddAssign, Bound, Index, IndexMut, Range, RangeBounds, Sub, SubAssign}, }, }; /// A range in text, represented as a pair of [`TextSize`][struct@TextSize]. /// /// It is a logic error for `start` to be greater than `end`....
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-analyzer/lib/text-size/src/traits.rs
src/tools/rust-analyzer/lib/text-size/src/traits.rs
use {crate::TextSize, std::convert::TryInto}; use priv_in_pub::Sealed; mod priv_in_pub { pub trait Sealed {} } /// Primitives with a textual length that can be passed to [`TextSize::of`]. pub trait TextLen: Copy + Sealed { /// The textual length of this primitive. fn text_len(self) -> TextSize; } impl Se...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false