mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-22 12:34:39 +00:00
dev: refactor def and use cache for improving definition (#179)
* chore: add a notes to do. * dev: cache def and use information * dev: move signature cache to analysis level * dev: refactor a bit for improving definition * dev: more appropriate definition discover * fix: clippy error
This commit is contained in:
parent
ebed95cbcd
commit
c22f70b49e
31 changed files with 1109 additions and 667 deletions
|
|
@ -2,7 +2,7 @@ use log::debug;
|
|||
use lsp_types::TextEdit;
|
||||
|
||||
use crate::{
|
||||
find_definition, find_references, prelude::*, syntax::get_deref_target,
|
||||
analysis::find_definition, find_references, prelude::*, syntax::get_deref_target,
|
||||
validate_renaming_definition, SemanticRequest,
|
||||
};
|
||||
|
||||
|
|
@ -44,10 +44,12 @@ impl SemanticRequest for RenameRequest {
|
|||
|
||||
let mut editions = HashMap::new();
|
||||
|
||||
let def_loc = {
|
||||
let def_source = ctx.source_by_id(lnk.fid).ok()?;
|
||||
let (fid, _def_range) = lnk.def_at?;
|
||||
|
||||
let span_path = ctx.path_for_id(lnk.fid).ok()?;
|
||||
let def_loc = {
|
||||
let def_source = ctx.source_by_id(fid).ok()?;
|
||||
|
||||
let span_path = ctx.path_for_id(fid).ok()?;
|
||||
let uri = path_to_url(&span_path).ok()?;
|
||||
|
||||
let Some(range) = lnk.name_range else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue