dev: add Definition::file_id (#1626)

This commit is contained in:
Myriad-Dreamin 2025-04-04 16:08:38 +08:00 committed by GitHub
parent ec5be5d2b0
commit 04c013f3a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 21 additions and 17 deletions

View file

@ -44,7 +44,7 @@ impl StatefulRequest for RenameRequest {
let def = ctx.def_of_syntax(&source, doc, syntax.clone())?;
prepare_renaming(ctx, &syntax, &def)?;
prepare_renaming(&syntax, &def)?;
match syntax {
// todo: abs path
@ -56,7 +56,7 @@ impl StatefulRequest for RenameRequest {
self.new_name
};
let def_fid = def.location(ctx.shared())?.0;
let def_fid = def.file_id()?;
// todo: rename in untitled files
let old_path = ctx.path_for_id(def_fid).ok()?.to_err().ok()?;