mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-17 18:57:04 +00:00
Rename dependency tree view and dependency provider
This commit is contained in:
parent
bfb81275fb
commit
c0eaff7dd1
2 changed files with 18 additions and 18 deletions
|
|
@ -288,13 +288,13 @@ export function openCargoToml(ctx: CtxInit): Cmd {
|
|||
|
||||
export function revealDependency(ctx: CtxInit): Cmd {
|
||||
return async (editor: RustEditor) => {
|
||||
if (!ctx.dependencies?.isInitialized()) {
|
||||
if (!ctx.dependenciesProvider?.isInitialized()) {
|
||||
return;
|
||||
}
|
||||
const documentPath = editor.document.uri.fsPath;
|
||||
const dep = ctx.dependencies?.getDependency(documentPath);
|
||||
const dep = ctx.dependenciesProvider?.getDependency(documentPath);
|
||||
if (dep) {
|
||||
await ctx.treeView?.reveal(dep, { select: true, expand: true });
|
||||
await ctx.dependencyTreeView?.reveal(dep, { select: true, expand: true });
|
||||
} else {
|
||||
await revealParentChain(editor.document, ctx);
|
||||
}
|
||||
|
|
@ -340,10 +340,10 @@ async function revealParentChain(document: RustDocument, ctx: CtxInit) {
|
|||
// a open file referencing the old version
|
||||
return;
|
||||
}
|
||||
} while (!ctx.dependencies?.contains(documentPath));
|
||||
} while (!ctx.dependenciesProvider?.contains(documentPath));
|
||||
parentChain.reverse();
|
||||
for (const idx in parentChain) {
|
||||
const treeView = ctx.treeView;
|
||||
const treeView = ctx.dependencyTreeView;
|
||||
if (!treeView) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue