mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-02 12:59:12 +00:00
fix: Stabilize sort order of runnables
This commit is contained in:
parent
fb8bc313ff
commit
e0d1fba739
2 changed files with 45 additions and 33 deletions
|
|
@ -13,7 +13,7 @@ use ide_db::{
|
|||
documentation::docs_from_attrs,
|
||||
helpers::visit_file_defs,
|
||||
search::{FileReferenceNode, SearchScope},
|
||||
FilePosition, FxHashMap, FxHashSet, RootDatabase, SymbolKind,
|
||||
FilePosition, FxHashMap, FxHashSet, FxIndexMap, RootDatabase, SymbolKind,
|
||||
};
|
||||
use itertools::Itertools;
|
||||
use smallvec::SmallVec;
|
||||
|
|
@ -130,7 +130,7 @@ pub(crate) fn runnables(db: &RootDatabase, file_id: FileId) -> Vec<Runnable> {
|
|||
let mut res = Vec::new();
|
||||
// Record all runnables that come from macro expansions here instead.
|
||||
// In case an expansion creates multiple runnables we want to name them to avoid emitting a bunch of equally named runnables.
|
||||
let mut in_macro_expansion = FxHashMap::<hir::HirFileId, Vec<Runnable>>::default();
|
||||
let mut in_macro_expansion = FxIndexMap::<hir::HirFileId, Vec<Runnable>>::default();
|
||||
let mut add_opt = |runnable: Option<Runnable>, def| {
|
||||
if let Some(runnable) = runnable.filter(|runnable| runnable.nav.file_id == file_id) {
|
||||
if let Some(def) = def {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue