Merge pull request #19704 from Veykril/push-wrvznvvpvtvp

Add expression fill mode variant for filling with underscore expressions
This commit is contained in:
Lukas Wirth 2025-04-28 09:45:04 +00:00 committed by GitHub
commit 0fee71065b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
31 changed files with 172 additions and 125 deletions

View file

@ -599,7 +599,7 @@ fn filename_and_frag_for_def(
Some(name) => {
match m.attrs(db).by_key(sym::doc).find_string_value_in_tt(sym::keyword) {
Some(kw) => {
format!("keyword.{}.html", kw)
format!("keyword.{kw}.html")
}
None => format!("{}/index.html", name.as_str()),
}

View file

@ -123,9 +123,9 @@ pub use ide_completion::{
CallableSnippets, CompletionConfig, CompletionFieldsToResolve, CompletionItem,
CompletionItemKind, CompletionItemRefMode, CompletionRelevance, Snippet, SnippetScope,
};
pub use ide_db::text_edit::{Indel, TextEdit};
pub use ide_db::{
FileId, FilePosition, FileRange, RootDatabase, Severity, SymbolKind,
assists::ExprFillDefaultMode,
base_db::{Crate, CrateGraphBuilder, FileChange, SourceRoot, SourceRootId},
documentation::Documentation,
label::Label,
@ -134,8 +134,9 @@ pub use ide_db::{
search::{ReferenceCategory, SearchScope},
source_change::{FileSystemEdit, SnippetEdit, SourceChange},
symbol_index::Query,
text_edit::{Indel, TextEdit},
};
pub use ide_diagnostics::{Diagnostic, DiagnosticCode, DiagnosticsConfig, ExprFillDefaultMode};
pub use ide_diagnostics::{Diagnostic, DiagnosticCode, DiagnosticsConfig};
pub use ide_ssr::SsrError;
pub use span::Edition;
pub use syntax::{TextRange, TextSize};

View file

@ -451,7 +451,7 @@ mod tests {
assert_eq!(x.len(), 1);
match x.into_iter().next().unwrap() {
MonikerResult::Local { enclosing_moniker } => {
panic!("Unexpected local enclosed in {:?}", enclosing_moniker);
panic!("Unexpected local enclosed in {enclosing_moniker:?}");
}
MonikerResult::Moniker(x) => {
assert_eq!(identifier, x.identifier.to_string());

View file

@ -51,8 +51,8 @@ pub(crate) fn status(db: &RootDatabase, file_id: Option<FileId>) -> String {
buf,
"Crate: {}\n",
match display_name {
Some(it) => format!("{it}({:?})", crate_id),
None => format!("{:?}", crate_id),
Some(it) => format!("{it}({crate_id:?})"),
None => format!("{crate_id:?}"),
}
);
format_to!(buf, " Root module file id: {}\n", root_file_id.index());

View file

@ -80,7 +80,7 @@ impl<'a> dot::Labeller<'a, Crate, Edge<'a>> for DotCrateGraph<'_> {
fn node_id(&'a self, n: &Crate) -> Id<'a> {
let id = n.as_id().as_u32();
Id::new(format!("_{:?}", id)).unwrap()
Id::new(format!("_{id:?}")).unwrap()
}
fn node_shape(&'a self, _node: &Crate) -> Option<LabelText<'a>> {