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-assists/src/handlers/fix_visibility.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/fix_visibility.rs
use hir::{HasSource, HasVisibility, ModuleDef, PathResolution, ScopeDef, db::HirDatabase}; use ide_db::FileId; use syntax::{ AstNode, TextRange, ast::{self, HasVisibility as _, edit_in_place::HasVisibilityEdit, make}, }; use crate::{AssistContext, AssistId, Assists}; // Assist: fix_visibility // // Note that ...
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-assists/src/handlers/generate_default_from_enum_variant.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_default_from_enum_variant.rs
use ide_db::{RootDatabase, famous_defs::FamousDefs}; use syntax::ast::{self, AstNode, HasName}; use crate::{AssistContext, AssistId, Assists}; // Assist: generate_default_from_enum_variant // // Adds a Default impl for an enum using a variant. // // ``` // enum Version { // Undefined, // Minor$0, // Major, // } //...
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-assists/src/handlers/normalize_import.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/normalize_import.rs
use ide_db::imports::merge_imports::try_normalize_import; use syntax::{AstNode, ast}; use crate::{ AssistId, assist_context::{AssistContext, Assists}, }; // Assist: normalize_import // // Normalizes an import. // // ``` // use$0 std::{io, {fmt::Formatter}}; // ``` // -> // ``` // use std::{fmt::Formatter, io}...
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-assists/src/handlers/move_bounds.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/move_bounds.rs
use either::Either; use syntax::{ ast::{ self, AstNode, HasName, HasTypeBounds, edit_in_place::{GenericParamsOwnerEdit, Removable}, make, }, match_ast, }; use crate::{AssistContext, AssistId, Assists}; // Assist: move_bounds_to_where_clause // // Moves inline type bounds to a where...
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-assists/src/handlers/add_return_type.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/add_return_type.rs
use either::Either; use hir::HirDisplay; use syntax::{AstNode, SyntaxKind, SyntaxToken, TextRange, TextSize, ast, match_ast}; use crate::{AssistContext, AssistId, Assists}; // Assist: add_return_type // // Adds the return type to a function or closure inferred from its tail expression if it doesn't have a return // t...
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-assists/src/handlers/generate_blanket_trait_impl.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_blanket_trait_impl.rs
use crate::{ AssistConfig, assist_context::{AssistContext, Assists}, }; use hir::{HasCrate, Semantics}; use ide_db::{ RootDatabase, assists::{AssistId, AssistKind, ExprFillDefaultMode}, famous_defs::FamousDefs, syntax_helpers::suggest_name, }; use syntax::{ AstNode, ast::{ self, ...
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-assists/src/handlers/inline_const_as_literal.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/inline_const_as_literal.rs
use hir::HasCrate; use syntax::{AstNode, ast}; use crate::{AssistContext, AssistId, Assists}; // Assist: inline_const_as_literal // // Evaluate and inline const variable as literal. // // ``` // const STRING: &str = "Hello, World!"; // // fn something() -> &'static str { // STRING$0 // } // ``` // -> // ``` // co...
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-assists/src/handlers/convert_char_literal.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/convert_char_literal.rs
use syntax::{AstToken, ast}; use crate::{AssistContext, AssistId, Assists, GroupLabel}; // Assist: convert_char_literal // // Converts character literals between different representations. Currently supports normal character -> ASCII / Unicode escape. // ``` // const _: char = 'a'$0; // ``` // -> // ``` // const _: 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-assists/src/handlers/unqualify_method_call.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/unqualify_method_call.rs
use hir::AsAssocItem; use syntax::{ TextRange, ast::{self, AstNode, HasArgList, prec::ExprPrecedence}, }; use crate::{AssistContext, AssistId, Assists}; // Assist: unqualify_method_call // // Transforms universal function call syntax into a method call. // // ``` // fn main() { // std::ops::Add::add$0(1, ...
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-assists/src/handlers/remove_underscore.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/remove_underscore.rs
use ide_db::{ assists::AssistId, defs::{Definition, NameClass, NameRefClass}, rename::RenameDefinition, }; use syntax::{AstNode, ast}; use crate::{AssistContext, Assists}; // Assist: remove_underscore_from_used_variables // // Removes underscore from used variables. // // ``` // fn main() { // let mut...
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-assists/src/handlers/generate_trait_from_impl.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_trait_from_impl.rs
use crate::assist_context::{AssistContext, Assists}; use ide_db::assists::AssistId; use syntax::{ AstNode, SyntaxKind, T, ast::{self, HasGenericParams, HasName, HasVisibility, edit_in_place::Indent, make}, syntax_editor::{Position, SyntaxEditor}, }; // NOTES : // We generate erroneous code if a function is...
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-assists/src/handlers/extract_function.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/extract_function.rs
use std::{iter, ops::RangeInclusive}; use ast::make; use either::Either; use hir::{ HasSource, HirDisplay, InFile, Local, LocalSource, ModuleDef, PathResolution, Semantics, TypeInfo, TypeParam, }; use ide_db::{ FxIndexSet, RootDatabase, assists::GroupLabel, defs::Definition, famous_defs::Famous...
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-assists/src/handlers/merge_nested_if.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/merge_nested_if.rs
use syntax::{ T, ast::{self, AstNode, BinaryOp, edit::AstNodeEdit}, }; use crate::{ AssistId, assist_context::{AssistContext, Assists}, }; // Assist: merge_nested_if // // This transforms if expressions of the form `if x { if y {A} }` into `if x && y {A}` // This assist can only be applied with the cur...
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-assists/src/handlers/add_turbo_fish.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/add_turbo_fish.rs
use either::Either; use ide_db::defs::{Definition, NameRefClass}; use syntax::{ AstNode, ast::{self, HasArgList, HasGenericArgs, make, syntax_factory::SyntaxFactory}, syntax_editor::Position, }; use crate::{ AssistId, assist_context::{AssistContext, Assists}, }; // Assist: add_turbo_fish // // Add...
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-assists/src/handlers/remove_unused_imports.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/remove_unused_imports.rs
use std::collections::hash_map::Entry; use hir::{ FileRange, InFile, InRealFile, Module, ModuleDef, ModuleSource, PathResolution, PathResolutionPerNs, }; use ide_db::text_edit::TextRange; use ide_db::{ FxHashMap, RootDatabase, defs::Definition, search::{FileReference, ReferenceCategory, SearchScope...
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-assists/src/handlers/convert_closure_to_fn.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/convert_closure_to_fn.rs
use either::Either; use hir::{CaptureKind, ClosureCapture, FileRangeWrapper, HirDisplay}; use ide_db::{ FxHashSet, assists::AssistId, base_db::SourceDatabase, defs::Definition, search::FileReferenceNode, source_change::SourceChangeBuilder, }; use stdx::format_to; use syntax::{ AstNode, Direction, SyntaxKind...
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-assists/src/handlers/flip_binexpr.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/flip_binexpr.rs
use syntax::{ SyntaxKind, T, ast::{self, AstNode, BinExpr, RangeItem, syntax_factory::SyntaxFactory}, syntax_editor::Position, }; use crate::{AssistContext, AssistId, Assists}; // Assist: flip_binexpr // // Flips operands of a binary expression. // // ``` // fn main() { // let _ = 90 +$0 2; // } // ``...
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-assists/src/handlers/generate_deref.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_deref.rs
use std::fmt::Display; use hir::{ModPath, ModuleDef}; use ide_db::{RootDatabase, famous_defs::FamousDefs}; use syntax::{ AstNode, Edition, SyntaxNode, ast::{self, HasName}, }; use crate::{ AssistId, assist_context::{AssistContext, Assists, SourceChangeBuilder}, utils::generate_trait_impl_text_intr...
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-assists/src/handlers/sort_items.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/sort_items.rs
use std::cmp::Ordering; use itertools::Itertools; use syntax::{ AstNode, SyntaxNode, ast::{self, HasName}, }; use crate::{AssistContext, AssistId, Assists, utils::get_methods}; // Assist: sort_items // // Sorts item members alphabetically: fields, enum variants and methods. // // ``` // struct $0Foo$0 { sec...
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-assists/src/handlers/expand_rest_pattern.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/expand_rest_pattern.rs
use hir::{PathResolution, StructKind}; use ide_db::syntax_helpers::suggest_name::NameGenerator; use syntax::{ AstNode, ToSmolStr, ast::{self, syntax_factory::SyntaxFactory}, match_ast, }; use crate::{AssistContext, AssistId, Assists}; // Assist: expand_record_rest_pattern // // Fills fields by replacing r...
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-assists/src/handlers/convert_range_for_to_while.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/convert_range_for_to_while.rs
use ide_db::assists::AssistId; use itertools::Itertools; use syntax::{ AstNode, T, algo::previous_non_trivia_token, ast::{ self, HasArgList, HasLoopBody, HasName, RangeItem, edit::AstNodeEdit, make, syntax_factory::SyntaxFactory, }, syntax_editor::{Element, Position}, }; use 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-assists/src/handlers/convert_two_arm_bool_match_to_matches_macro.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/convert_two_arm_bool_match_to_matches_macro.rs
use hir::Semantics; use ide_db::RootDatabase; use stdx::format_to; use syntax::ast::{self, AstNode}; use crate::{AssistContext, AssistId, Assists}; // Assist: convert_two_arm_bool_match_to_matches_macro // // Convert 2-arm match that evaluates to a boolean into the equivalent matches! invocation. // // ``` // fn main...
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-assists/src/handlers/convert_let_else_to_match.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/convert_let_else_to_match.rs
use syntax::T; use syntax::ast::RangeItem; use syntax::ast::edit::IndentLevel; use syntax::ast::edit_in_place::Indent; use syntax::ast::syntax_factory::SyntaxFactory; use syntax::ast::{self, AstNode, HasName, LetStmt, Pat}; use crate::{AssistContext, AssistId, Assists}; // Assist: convert_let_else_to_match // // Conv...
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-assists/src/handlers/invert_if.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/invert_if.rs
use ide_db::syntax_helpers::node_ext::is_pattern_cond; use syntax::{ T, ast::{self, AstNode}, }; use crate::{ AssistId, assist_context::{AssistContext, Assists}, utils::invert_boolean_expression_legacy, }; // Assist: invert_if // // This transforms if expressions of the form `if !x {A} else {B}` 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-assists/src/handlers/replace_arith_op.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/replace_arith_op.rs
use ide_db::assists::{AssistId, GroupLabel}; use syntax::{ AstNode, ast::{self, ArithOp, BinaryOp, syntax_factory::SyntaxFactory}, }; use crate::assist_context::{AssistContext, Assists}; // Assist: replace_arith_with_checked // // Replaces arithmetic on integers with the `checked_*` equivalent. // // ``` // 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-assists/src/handlers/convert_integer_literal.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/convert_integer_literal.rs
use syntax::{AstToken, ast, ast::Radix}; use crate::{AssistContext, AssistId, Assists, GroupLabel}; // Assist: convert_integer_literal // // Converts the base of integer literals to other bases. // // ``` // const _: i32 = 10$0; // ``` // -> // ``` // const _: i32 = 0b1010; // ``` pub(crate) fn convert_integer_litera...
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-assists/src/handlers/generate_delegate_trait.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_delegate_trait.rs
use std::ops::Not; use crate::{ assist_context::{AssistContext, Assists}, utils::convert_param_list_to_arg_list, }; use either::Either; use hir::{HasVisibility, db::HirDatabase}; use ide_db::{ FxHashMap, FxHashSet, assists::{AssistId, GroupLabel}, path_transform::PathTransform, syntax_helpers::...
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-assists/src/handlers/generate_documentation_template.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_documentation_template.rs
use hir::{AsAssocItem, HasVisibility, ModuleDef, Visibility}; use ide_db::assists::AssistId; use itertools::Itertools; use stdx::{format_to, to_lower_snake_case}; use syntax::{ AstNode, AstToken, Edition, algo::skip_whitespace_token, ast::{self, HasDocComments, HasGenericArgs, HasName, edit::IndentLevel}, ...
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-assists/src/handlers/destructure_tuple_binding.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/destructure_tuple_binding.rs
use ide_db::{ assists::AssistId, defs::Definition, search::{FileReference, SearchScope}, syntax_helpers::suggest_name, text_edit::TextRange, }; use itertools::Itertools; use syntax::{ T, ast::{self, AstNode, FieldExpr, HasName, IdentPat, make}, ted, }; use crate::{ assist_context::{...
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-assists/src/handlers/add_explicit_enum_discriminant.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/add_explicit_enum_discriminant.rs
use hir::Semantics; use ide_db::{RootDatabase, assists::AssistId, source_change::SourceChangeBuilder}; use syntax::{ AstNode, ast::{self, Radix}, }; use crate::{AssistContext, Assists, utils::add_group_separators}; // Assist: add_explicit_enum_discriminant // // Adds explicit discriminant to all enum variants...
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-assists/src/handlers/inline_type_alias.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/inline_type_alias.rs
// Some ideas for future improvements: // - Support replacing aliases which are used in expressions, e.g. `A::new()`. // - Remove unused aliases if there are no longer any users, see inline_call.rs. use hir::{HasSource, PathResolution}; use ide_db::FxHashMap; use ide_db::{ defs::Definition, imports::insert_use::as...
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-assists/src/handlers/add_lifetime_to_type.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/add_lifetime_to_type.rs
use syntax::ast::{self, AstNode, HasGenericParams, HasName}; use crate::{AssistContext, AssistId, Assists}; // Assist: add_lifetime_to_type // // Adds a new lifetime to a struct, enum or union. // // ``` // struct Point { // x: &$0u32, // y: u32, // } // ``` // -> // ``` // struct Point<'a> { // x: &'a u3...
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-assists/src/handlers/term_search.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/term_search.rs
//! Term search assist use hir::term_search::{TermSearchConfig, TermSearchCtx}; use ide_db::{ assists::{AssistId, GroupLabel}, famous_defs::FamousDefs, }; use itertools::Itertools; use syntax::{AstNode, ast}; use crate::assist_context::{AssistContext, Assists}; pub(crate) fn term_search(acc: &mut Assists, ct...
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-assists/src/handlers/apply_demorgan.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/apply_demorgan.rs
use std::collections::VecDeque; use ide_db::{ assists::GroupLabel, famous_defs::FamousDefs, syntax_helpers::node_ext::{for_each_tail_expr, walk_expr}, }; use syntax::{ NodeOrToken, SyntaxKind, T, ast::{ self, AstNode, Expr::BinExpr, HasArgList, prec::{ExprPrecedence,...
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-assists/src/handlers/toggle_ignore.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/toggle_ignore.rs
use syntax::{ AstNode, AstToken, ast::{self, HasAttrs, edit::AstNodeEdit}, }; use crate::{AssistContext, AssistId, Assists, utils::test_related_attribute_syn}; // Assist: toggle_ignore // // Adds `#[ignore]` attribute to the test. // // ``` // $0#[test] // fn arithmetics { // assert_eq!(2 + 2, 5); // } //...
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-assists/src/handlers/auto_import.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/auto_import.rs
use std::cmp::Reverse; use either::Either; use hir::{Module, Type, db::HirDatabase}; use ide_db::{ active_parameter::ActiveParameter, helpers::mod_path_to_ast, imports::{ import_assets::{ImportAssets, ImportCandidate, LocatedImport}, insert_use::{ImportScope, insert_use, insert_use_as_alias...
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-assists/src/handlers/merge_imports.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/merge_imports.rs
use either::Either; use ide_db::imports::{ insert_use::{ImportGranularity, InsertUseConfig}, merge_imports::{MergeBehavior, try_merge_imports, try_merge_trees}, }; use syntax::{ AstNode, SyntaxElement, SyntaxNode, algo::neighbor, ast::{self, syntax_factory::SyntaxFactory}, match_ast, 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-assists/src/handlers/introduce_named_lifetime.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/introduce_named_lifetime.rs
use ide_db::FxHashSet; use syntax::{ AstNode, TextRange, ast::{self, HasGenericParams, edit_in_place::GenericParamsOwnerEdit, make}, ted::{self, Position}, }; use crate::{AssistContext, AssistId, Assists, assist_context::SourceChangeBuilder}; static ASSIST_NAME: &str = "introduce_named_lifetime"; static A...
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-assists/src/handlers/expand_glob_import.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/expand_glob_import.rs
use either::Either; use hir::{AssocItem, Enum, HasVisibility, Module, ModuleDef, Name, PathResolution, ScopeDef}; use ide_db::{ defs::{Definition, NameRefClass}, search::SearchScope, source_change::SourceChangeBuilder, }; use stdx::never; use syntax::{ AstNode, Direction, SyntaxNode, SyntaxToken, T, ...
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-assists/src/handlers/convert_bool_to_enum.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/convert_bool_to_enum.rs
use either::Either; use hir::ModuleDef; use ide_db::text_edit::TextRange; use ide_db::{ FxHashSet, assists::AssistId, defs::Definition, helpers::mod_path_to_ast, imports::insert_use::{ImportScope, insert_use}, search::{FileReference, UsageSearchResult}, source_change::SourceChangeBuilder, };...
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-assists/src/handlers/convert_nested_function_to_closure.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/convert_nested_function_to_closure.rs
use ide_db::assists::AssistId; use syntax::ast::{self, HasGenericParams, HasName}; use syntax::{AstNode, SyntaxKind}; use crate::assist_context::{AssistContext, Assists}; // Assist: convert_nested_function_to_closure // // Converts a function that is defined within the body of another function into a closure. // // `...
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-assists/src/handlers/convert_while_to_loop.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/convert_while_to_loop.rs
use std::iter; use ide_db::syntax_helpers::node_ext::is_pattern_cond; use syntax::{ AstNode, T, ast::{ self, HasLoopBody, edit::{AstNodeEdit, IndentLevel}, make, }, syntax_editor::{Element, Position}, }; use crate::{ AssistId, assist_context::{AssistContext, Assists}, ...
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-assists/src/handlers/move_guard.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/move_guard.rs
use syntax::{ SyntaxKind::WHITESPACE, ast::{AstNode, BlockExpr, ElseBranch, Expr, IfExpr, MatchArm, Pat, edit::AstNodeEdit, make}, }; use crate::{AssistContext, AssistId, Assists}; // Assist: move_guard_to_arm_body // // Moves match guard into match arm body. // // ``` // enum Action { Move { distance: u32 },...
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-assists/src/handlers/extract_module.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/extract_module.rs
use std::{iter::once, ops::RangeInclusive}; use hir::{HasSource, ModuleSource}; use ide_db::{ FileId, FxHashMap, FxHashSet, assists::AssistId, defs::{Definition, NameClass, NameRefClass}, search::{FileReference, SearchScope}, }; use itertools::Itertools; use smallvec::SmallVec; use syntax::{ AstNod...
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-assists/src/handlers/replace_named_generic_with_impl.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/replace_named_generic_with_impl.rs
use hir::{FileRange, Semantics}; use ide_db::text_edit::TextRange; use ide_db::{ EditionedFileId, RootDatabase, defs::Definition, search::{SearchScope, UsageSearchResult}, }; use syntax::{ AstNode, ast::{self, HasGenericParams, HasName, HasTypeBounds, Name, NameLike, PathType, make}, match_ast, ...
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-assists/src/handlers/convert_iter_for_each_to_for.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/convert_iter_for_each_to_for.rs
use hir::{Name, sym}; use ide_db::famous_defs::FamousDefs; use stdx::format_to; use syntax::{ AstNode, ast::{self, HasArgList, HasLoopBody, edit::AstNodeEdit, syntax_factory::SyntaxFactory}, }; use crate::{AssistContext, AssistId, Assists}; // Assist: convert_iter_for_each_to_for // // Converts an Iterator::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-assists/src/handlers/generate_impl.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_impl.rs
use syntax::{ ast::{self, AstNode, HasGenericParams, HasName, edit_in_place::Indent, make}, syntax_editor::{Position, SyntaxEditor}, }; use crate::{ AssistContext, AssistId, Assists, utils::{self, DefaultMethods, IgnoreAssocItems}, }; fn insert_impl(editor: &mut SyntaxEditor, impl_: &ast::Impl, nomina...
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-assists/src/handlers/convert_named_struct_to_tuple_struct.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/convert_named_struct_to_tuple_struct.rs
use either::Either; use ide_db::{defs::Definition, search::FileReference}; use itertools::Itertools; use syntax::{ SyntaxKind, ast::{self, AstNode, HasAttrs, HasGenericParams, HasVisibility}, match_ast, syntax_editor::{Position, SyntaxEditor}, }; use crate::{AssistContext, AssistId, Assists, assist_con...
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-assists/src/handlers/convert_comment_block.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/convert_comment_block.rs
use itertools::Itertools; use syntax::{ AstToken, Direction, SyntaxElement, TextRange, ast::{self, Comment, CommentKind, CommentShape, Whitespace, edit::IndentLevel}, }; use crate::{AssistContext, AssistId, Assists}; // Assist: line_to_block // // Converts comments between block and single-line form. // // ``...
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-assists/src/handlers/generate_derive.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_derive.rs
use syntax::{ SyntaxKind::{ATTR, COMMENT, WHITESPACE}, T, ast::{self, AstNode, HasAttrs, edit::IndentLevel, make}, syntax_editor::{Element, Position}, }; use crate::{AssistContext, AssistId, Assists}; // Assist: generate_derive // // Adds a new `#[derive()]` clause to a struct or enum. // // ``` // st...
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-assists/src/handlers/remove_mut.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/remove_mut.rs
use syntax::{SyntaxKind, T}; use crate::{AssistContext, AssistId, Assists}; // Assist: remove_mut // // Removes the `mut` keyword. // // ``` // impl Walrus { // fn feed(&mut$0 self, amount: u32) {} // } // ``` // -> // ``` // impl Walrus { // fn feed(&self, amount: u32) {} // } // ``` pub(crate) fn remove_mut...
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-assists/src/handlers/toggle_async_sugar.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/toggle_async_sugar.rs
use hir::ModuleDef; use ide_db::{assists::AssistId, famous_defs::FamousDefs}; use syntax::{ AstNode, NodeOrToken, SyntaxKind, SyntaxNode, SyntaxToken, TextRange, ast::{self, HasGenericArgs, HasVisibility}, }; use crate::{AssistContext, Assists}; // Assist: sugar_impl_future_into_async // // Rewrites asynchron...
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-assists/src/handlers/generate_enum_projection_method.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/generate_enum_projection_method.rs
use ide_db::assists::GroupLabel; use itertools::Itertools; use stdx::to_lower_snake_case; use syntax::ast::HasVisibility; use syntax::ast::{self, AstNode, HasName}; use crate::{ AssistContext, AssistId, Assists, utils::{add_method_to_adt, find_struct_impl, is_selected}, }; // Assist: generate_enum_try_into_me...
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-assists/src/handlers/inline_macro.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/inline_macro.rs
use hir::db::ExpandDatabase; use ide_db::syntax_helpers::prettify_macro_expansion; use syntax::ast::{self, AstNode}; use crate::{AssistContext, AssistId, Assists}; // Assist: inline_macro // // Takes a macro and inlines it one step. // // ``` // macro_rules! num { // (+$($t:tt)+) => (1 + num!($($t )+)); // (-...
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-assists/src/handlers/add_missing_match_arms.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/add_missing_match_arms.rs
use std::iter::{self, Peekable}; use either::Either; use hir::{Adt, AsAssocItem, Crate, FindPathConfig, HasAttrs, ModuleDef, Semantics}; use ide_db::RootDatabase; use ide_db::assists::ExprFillDefaultMode; use ide_db::syntax_helpers::suggest_name; use ide_db::{famous_defs::FamousDefs, helpers::mod_path_to_ast}; use ite...
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-assists/src/handlers/convert_to_guarded_return.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/convert_to_guarded_return.rs
use std::iter::once; use either::Either; use hir::{Semantics, TypeInfo}; use ide_db::{RootDatabase, ty_filter::TryEnum}; use syntax::{ AstNode, SyntaxKind::{CLOSURE_EXPR, FN, FOR_EXPR, LOOP_EXPR, WHILE_EXPR, WHITESPACE}, SyntaxNode, T, ast::{ self, edit::{AstNodeEdit, IndentLevel}, ...
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-assists/src/handlers/unnecessary_async.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/unnecessary_async.rs
use ide_db::{ EditionedFileId, assists::AssistId, defs::Definition, search::{FileReference, FileReferenceNode}, syntax_helpers::node_ext::full_path_of_name_ref, }; use syntax::{ AstNode, SyntaxKind, TextRange, ast::{self, NameRef}, }; use crate::{AssistContext, Assists}; // FIXME: This oug...
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-assists/src/handlers/desugar_doc_comment.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/desugar_doc_comment.rs
use either::Either; use itertools::Itertools; use syntax::{ AstToken, TextRange, ast::{self, CommentPlacement, Whitespace, edit::IndentLevel}, }; use crate::{ AssistContext, AssistId, Assists, handlers::convert_comment_block::{line_comment_text, relevant_line_comments}, utils::required_hashes, }; ...
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-assists/src/handlers/unmerge_imports.rs
src/tools/rust-analyzer/crates/ide-assists/src/handlers/unmerge_imports.rs
use syntax::{ AstNode, SyntaxKind, ast::{self, HasAttrs, HasVisibility, edit::IndentLevel, make, syntax_factory::SyntaxFactory}, syntax_editor::{Element, Position, Removable}, }; use crate::{ AssistId, assist_context::{AssistContext, Assists}, }; // Assist: unmerge_imports // // Extracts a use ite...
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/mbe/src/lib.rs
src/tools/rust-analyzer/crates/mbe/src/lib.rs
//! `mbe` (short for Macro By Example) crate contains code for handling //! `macro_rules` macros. It uses `TokenTree` (from `tt` package) as the //! interface, although it contains some code to bridge `SyntaxNode`s and //! `TokenTree`s as well! //! //! The tests for this functionality live in another crate: //! `hir_de...
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/mbe/src/benchmark.rs
src/tools/rust-analyzer/crates/mbe/src/benchmark.rs
//! This module add real world mbe example for benchmark tests use intern::Symbol; use rustc_hash::FxHashMap; use stdx::itertools::Itertools; use syntax::{ AstNode, ast::{self, HasName}, }; use syntax_bridge::{ DocCommentDesugarMode, dummy_test_span_utils::{DUMMY, DummyTestSpanMap}, syntax_node_to_...
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/mbe/src/tests.rs
src/tools/rust-analyzer/crates/mbe/src/tests.rs
//! Tests specific to declarative macros, aka macros by example. This covers //! both stable `macro_rules!` macros as well as unstable `macro` macros. // FIXME: Move more of the nameres independent tests from // crates\hir-def\src\macro_expansion_tests\mod.rs to this use expect_test::expect; use span::{ Edition, Ed...
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/mbe/src/parser.rs
src/tools/rust-analyzer/crates/mbe/src/parser.rs
//! Parser recognizes special macro syntax, `$var` and `$(repeat)*`, in token //! trees. use std::sync::Arc; use arrayvec::ArrayVec; use intern::{Symbol, sym}; use span::{Edition, Span, SyntaxContext}; use tt::{ MAX_GLUED_PUNCT_LEN, iter::{TtElement, TtIter}, }; use crate::{MacroCallStyle, ParseError}; pub(...
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/mbe/src/macro_call_style.rs
src/tools/rust-analyzer/crates/mbe/src/macro_call_style.rs
//! Types representing the three basic "styles" of macro calls in Rust source: //! - Function-like macros ("bang macros"), e.g. `foo!(...)` //! - Attribute macros, e.g. `#[foo]` //! - Derive macros, e.g. `#[derive(Foo)]` #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum MacroCallStyle { FnLike, Attr, 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/crates/mbe/src/expander.rs
src/tools/rust-analyzer/crates/mbe/src/expander.rs
//! This module takes a (parsed) definition of `macro_rules` invocation, a //! `tt::TokenTree` representing an argument of macro invocation, and produces a //! `tt::TokenTree` for the result of the expansion. mod matcher; mod transcriber; use intern::Symbol; use rustc_hash::FxHashMap; use span::Span; use 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/mbe/src/expander/matcher.rs
src/tools/rust-analyzer/crates/mbe/src/expander/matcher.rs
//! An NFA-based parser, which is porting from rustc mbe parsing code //! //! See <https://github.com/rust-lang/rust/blob/70b18bc2cbac4712020019f5bf57c00905373205/compiler/rustc_expand/src/mbe/macro_parser.rs> //! Here is a quick intro to how the parser works, copied from rustc: //! //! A 'position' is a dot in the mid...
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/mbe/src/expander/transcriber.rs
src/tools/rust-analyzer/crates/mbe/src/expander/transcriber.rs
//! Transcriber takes a template, like `fn $ident() {}`, a set of bindings like //! `$ident => foo`, interpolates variables in the template, to get `fn foo() {}` use intern::{Symbol, sym}; use span::{Edition, Span}; use stdx::itertools::Itertools; use tt::{Delimiter, TopSubtreeBuilder, iter::TtElement}; use super::To...
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/test-utils/src/lib.rs
src/tools/rust-analyzer/crates/test-utils/src/lib.rs
//! Assorted testing utilities. //! //! Most notable things are: //! //! * Rich text comparison, which outputs a diff. //! * Extracting markup (mainly, `$0` markers) out of fixture strings. //! * marks (see the eponymous module). #![allow(clippy::print_stderr)] mod assert_linear; pub mod bench_fixture; mod 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/test-utils/src/minicore.rs
src/tools/rust-analyzer/crates/test-utils/src/minicore.rs
//! This is a fixture we use for tests that need lang items. //! //! We want to include the minimal subset of core for each test, so this file //! supports "conditional compilation". Tests use the following syntax to include minicore: //! //! //- minicore: flag1, flag2 //! //! We then strip all the code marked with ot...
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/test-utils/src/bench_fixture.rs
src/tools/rust-analyzer/crates/test-utils/src/bench_fixture.rs
//! Generates large snippets of Rust code for usage in the benchmarks. use std::fs; use stdx::format_to; use crate::project_root; pub fn big_struct() -> String { let n = 1_000; big_struct_n(n) } pub fn big_struct_n(n: u32) -> String { let mut buf = "pub struct RegisterBlock {".to_owned(); for i in ...
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/test-utils/src/fixture.rs
src/tools/rust-analyzer/crates/test-utils/src/fixture.rs
//! Defines `Fixture` -- a convenient way to describe the initial state of //! rust-analyzer database from a single string. //! //! Fixtures are strings containing rust source code with optional metadata. //! A fixture without metadata is parsed into a single source file. //! Use this to test functionality local to one...
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/test-utils/src/assert_linear.rs
src/tools/rust-analyzer/crates/test-utils/src/assert_linear.rs
//! Checks that a set of measurements looks like a linear function rather than //! like a quadratic function. Algorithm: //! //! 1. Linearly scale input to be in [0; 1) //! 2. Using linear regression, compute the best linear function approximating //! the input. //! 3. Compute RMSE and maximal absolute error. //! 4...
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/rust-analyzer/build.rs
src/tools/rust-analyzer/crates/rust-analyzer/build.rs
//! Construct version in the `commit-hash date channel` format use std::{env, path::PathBuf, process::Command}; fn main() { set_rerun(); set_commit_info(); if option_env!("CFG_RELEASE").is_none() { println!("cargo:rustc-env=POKE_RA_DEVS=1"); } } fn set_rerun() { println!("cargo:rerun-if-e...
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/rust-analyzer/src/config.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs
//! Config used by the language server. //! //! Of particular interest is the `feature_flags` hash map: while other fields //! configure the server itself, feature flags are passed into analysis, and //! tweak things like automatic insertion of `()` in completions. use std::{env, fmt, iter, ops::Not, sync::OnceLock}; ...
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/rust-analyzer/src/global_state.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/global_state.rs
//! The context or environment in which the language server functions. In our //! server implementation this is know as the `WorldState`. //! //! Each tick provides an immutable snapshot of the state as `WorldSnapshot`. use std::{ ops::Not as _, panic::AssertUnwindSafe, time::{Duration, Instant}, }; use c...
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/rust-analyzer/src/reload.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/reload.rs
//! Project loading & configuration updates. //! //! This is quite tricky. The main problem is time and changes -- there's no //! fixed "project" rust-analyzer is working with, "current project" is itself //! mutable state. For example, when the user edits `Cargo.toml` by adding a new //! dependency, project model chan...
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/rust-analyzer/src/diagnostics.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/diagnostics.rs
//! Book keeping for keeping diagnostics easily in sync with the client. pub(crate) mod flycheck_to_proto; use std::mem; use cargo_metadata::PackageId; use ide::FileId; use ide_db::{FxHashMap, base_db::DbPanicContext}; use itertools::Itertools; use rustc_hash::FxHashSet; use smallvec::SmallVec; use stdx::iter_eq_by; ...
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/rust-analyzer/src/lib.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/lib.rs
//! Implementation of the LSP for rust-analyzer. //! //! This crate takes Rust-specific analysis results from ide and translates //! into LSP types. //! //! It also is the root of all state. `world` module defines the bulk of the //! state, and `main_loop` module defines the rules for modifying it. //! //! The `cli` su...
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/rust-analyzer/src/command.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/command.rs
//! Utilities for running a cargo command like `cargo check` or `cargo test` in a separate thread //! and parse its stdout/stderr. use std::{ ffi::OsString, fmt, io::{self, BufWriter, Write}, marker::PhantomData, path::PathBuf, process::{ChildStderr, ChildStdout, Command, Stdio}, }; use crossb...
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/rust-analyzer/src/version.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/version.rs
//! Code for representing rust-analyzer's release version number. use std::fmt; /// Information about the git repository where rust-analyzer was built from. pub struct CommitInfo { pub short_commit_hash: &'static str, pub commit_hash: &'static str, pub commit_date: &'static str, } /// Cargo's version. pu...
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/rust-analyzer/src/discover.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/discover.rs
//! Infrastructure for lazy project discovery. Currently only support rust-project.json discovery //! via a custom discover command. use std::{io, path::Path}; use crossbeam_channel::Sender; use ide_db::FxHashMap; use paths::{AbsPathBuf, Utf8Path, Utf8PathBuf}; use project_model::ProjectJsonData; use serde::{Deseriali...
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/rust-analyzer/src/cli.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/cli.rs
//! Various batch processing tasks, intended primarily for debugging. #![allow(clippy::print_stdout, clippy::print_stderr)] mod analysis_stats; mod diagnostics; pub mod flags; mod highlight; mod lsif; mod parse; mod prime_caches; mod run_tests; mod rustc_tests; mod scip; mod ssr; mod symbols; mod unresolved_reference...
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/rust-analyzer/src/line_index.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/line_index.rs
//! Enhances `ide::LineIndex` with additional info required to convert offsets //! into lsp positions. //! //! We maintain invariant that all internal strings use `\n` as line separator. //! This module does line ending conversion and detection (so that we can //! convert back to `\r\n` on the way out). use ide_db::li...
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/rust-analyzer/src/lsp.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/lsp.rs
//! Custom LSP definitions and protocol conversions. use core::fmt; use hir::Mutability; use ide::{CompletionItem, CompletionItemRefMode, CompletionRelevance}; use tenthash::TentHash; pub mod ext; pub(crate) mod capabilities; pub(crate) mod from_proto; pub(crate) mod semantic_tokens; pub(crate) mod to_proto; pub(cr...
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/rust-analyzer/src/op_queue.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/op_queue.rs
//! Bookkeeping to make sure only one long-running operation is being executed //! at a time. pub(crate) type Cause = String; /// A single-item queue that allows callers to request an operation to /// be performed later. /// /// ```ignore /// let queue = OpQueue::default(); /// /// // Request work to be done. /// que...
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/rust-analyzer/src/task_pool.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/task_pool.rs
//! A thin wrapper around [`stdx::thread::Pool`] which threads a sender through spawned jobs. //! It is used in [`crate::global_state::GlobalState`] throughout the main loop. use std::panic::UnwindSafe; use crossbeam_channel::Sender; use stdx::thread::{Pool, ThreadIntent}; use crate::main_loop::DeferredTask; pub(cr...
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/rust-analyzer/src/target_spec.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/target_spec.rs
//! See `TargetSpec` use std::mem; use cargo_metadata::PackageId; use cfg::{CfgAtom, CfgExpr}; use hir::sym; use ide::{Cancellable, Crate, FileId, RunnableKind, TestId}; use project_model::project_json::Runnable; use project_model::{CargoFeatures, ManifestPath, TargetKind}; use rustc_hash::FxHashSet; use triomphe::Ar...
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/rust-analyzer/src/mem_docs.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/mem_docs.rs
//! In-memory document information. use std::mem; use rustc_hash::FxHashMap; use vfs::VfsPath; /// Holds the set of in-memory documents. /// /// For these document, their true contents is maintained by the client. It /// might be different from what's on disk. #[derive(Default, Clone)] pub(crate) struct MemDocs { ...
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/rust-analyzer/src/main_loop.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/main_loop.rs
//! The main loop of `rust-analyzer` responsible for dispatching LSP //! requests/replies and notifications back to the client. use std::{ fmt, ops::Div as _, panic::AssertUnwindSafe, time::{Duration, Instant}, }; use crossbeam_channel::{Receiver, never, select}; use ide_db::base_db::{SourceDatabase, ...
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/rust-analyzer/src/test_runner.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/test_runner.rs
//! This module provides the functionality needed to run `cargo test` in a background //! thread and report the result of each test in a channel. use crossbeam_channel::Sender; use paths::{AbsPath, Utf8Path}; use project_model::TargetKind; use serde::Deserialize as _; use serde_derive::Deserialize; use toolchain::Tool...
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/rust-analyzer/src/flycheck.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/flycheck.rs
//! Flycheck provides the functionality needed to run `cargo check` to provide //! LSP diagnostics based on the output of the command. use std::{ fmt, io, process::Command, sync::atomic::{AtomicUsize, Ordering}, time::Duration, }; use cargo_metadata::PackageId; use crossbeam_channel::{Receiver, Sender...
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/rust-analyzer/src/integrated_benchmarks.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/integrated_benchmarks.rs
//! Fully integrated benchmarks for rust-analyzer, which load real cargo //! projects. //! //! The benchmark here is used to debug specific performance regressions. If you //! notice that, eg, completion is slow in some specific case, you can modify //! code here exercise this specific completion, and thus have a fast...
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/rust-analyzer/src/lsp/to_proto.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/to_proto.rs
//! Conversion of rust-analyzer specific types to lsp_types equivalents. use std::{ iter::once, mem, ops::Not as _, sync::atomic::{AtomicU32, Ordering}, }; use base64::{Engine, prelude::BASE64_STANDARD}; use ide::{ Annotation, AnnotationKind, Assist, AssistKind, Cancellable, CompletionFieldsToResol...
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/rust-analyzer/src/lsp/ext.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/ext.rs
//! rust-analyzer extensions to the LSP. // Note when adding new resolve payloads, add a #[serde(default)] on boolean fields as some clients // might strip `false` values from the JSON payload due to their reserialization logic turning false // into null which will then cause them to be omitted in the resolve request....
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/rust-analyzer/src/lsp/semantic_tokens.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/semantic_tokens.rs
//! Semantic Tokens helpers use std::ops; use lsp_types::{ Range, SemanticToken, SemanticTokenModifier, SemanticTokenType, SemanticTokens, SemanticTokensEdit, }; macro_rules! define_semantic_token_types { ( standard { $($standard:ident),*$(,)? } custom { $(...
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/rust-analyzer/src/lsp/utils.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/utils.rs
//! Utilities for LSP-related boilerplate code. use std::{mem, ops::Range}; use lsp_server::Notification; use lsp_types::request::Request; use triomphe::Arc; use crate::{ global_state::GlobalState, line_index::{LineEndings, LineIndex, PositionEncoding}, lsp::{LspError, from_proto}, lsp_ext, }; pub(cr...
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/rust-analyzer/src/lsp/from_proto.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/from_proto.rs
//! Conversion lsp_types types to rust-analyzer specific ones. use anyhow::format_err; use ide::{Annotation, AnnotationKind, AssistKind, LineCol}; use ide_db::{FileId, FilePosition, FileRange, line_index::WideLineCol}; use paths::Utf8PathBuf; use syntax::{TextRange, TextSize}; use vfs::AbsPathBuf; use crate::{ glo...
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/rust-analyzer/src/lsp/capabilities.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/capabilities.rs
//! Advertises the capabilities of the LSP Server. use ide::{CompletionFieldsToResolve, InlayFieldsToResolve}; use ide_db::{FxHashSet, line_index::WideEncoding}; use lsp_types::{ CallHierarchyServerCapability, CodeActionKind, CodeActionOptions, CodeActionProviderCapability, CodeLensOptions, CompletionOptions, 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/rust-analyzer/src/tracing/config.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/tracing/config.rs
//! Simple logger that logs either to stderr or to a file, using `tracing_subscriber` //! filter syntax and `tracing_appender` for non blocking output. use std::io::{self}; use anyhow::Context; use tracing::level_filters::LevelFilter; use tracing_subscriber::{ Layer, Registry, filter::{Targets, filter_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/crates/rust-analyzer/src/tracing/json.rs
src/tools/rust-analyzer/crates/rust-analyzer/src/tracing/json.rs
//! A [tracing_subscriber::layer::Layer] that exports new-line delinated JSON. //! //! Usage: //! //! ```ignore //! # use tracing_subscriber::Registry; //! let layer = json::TimingLayer::new(std::io::stderr); //! Registry::default().with(layer).init(); //! ``` use std::{io::Write as _, marker::PhantomData, time::Insta...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false