mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-20 03:49:51 +00:00
internal: don't panic when the crate graph isn't ready #19351
This commit is contained in:
parent
3fc655b239
commit
788232b355
14 changed files with 50 additions and 30 deletions
|
|
@ -83,7 +83,7 @@ pub(crate) fn view_memory_layout(
|
|||
) -> Option<RecursiveMemoryLayout> {
|
||||
let sema = Semantics::new(db);
|
||||
let file = sema.parse_guess_edition(position.file_id);
|
||||
let display_target = sema.first_crate_or_default(position.file_id).to_display_target(db);
|
||||
let display_target = sema.first_crate(position.file_id)?.to_display_target(db);
|
||||
let token =
|
||||
pick_best_token(file.syntax().token_at_offset(position.offset), |kind| match kind {
|
||||
SyntaxKind::IDENT => 3,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue