Fixing naming from graph to list

This commit is contained in:
Bruno Ortiz 2023-04-04 13:47:01 -03:00
parent e2535926e9
commit 1b8288ff96
7 changed files with 52 additions and 48 deletions

View file

@ -3,13 +3,12 @@ import * as fspath from "path";
import * as fs from "fs";
import { CtxInit } from "./ctx";
import * as ra from "./lsp_ext";
import { FetchDependencyGraphResult } from "./lsp_ext";
import { FetchDependencyListResult } from "./lsp_ext";
import { Ctx } from "./ctx";
import { setFlagsFromString } from "v8";
import * as ra from "./lsp_ext";
export class RustDependenciesProvider
implements vscode.TreeDataProvider<Dependency | DependencyFile>
{
@ -82,8 +81,8 @@ export class RustDependenciesProvider
private async getRootDependencies(): Promise<Dependency[]> {
const crates = await this.ctx.client.sendRequest(ra.fetchDependencyGraph, {});
const dependenciesResult: FetchDependencyGraphResult = await this.ctx.client.sendRequest(
ra.fetchDependencyGraph,
const dependenciesResult: FetchDependencyListResult = await this.ctx.client.sendRequest(
ra.fetchDependencyList,
{}
);
const crates = dependenciesResult.crates;
@ -97,7 +96,6 @@ export class RustDependenciesProvider
}
private toDep(moduleName: string, version: string, path: string): Dependency {
// const cratePath = fspath.join(basePath, `${moduleName}-${version}`);
return new Dependency(moduleName, version, path, vscode.TreeItemCollapsibleState.Collapsed);
}
}

View file

@ -70,9 +70,9 @@ export const viewItemTree = new lc.RequestType<ViewItemTreeParams, string, void>
export type AnalyzerStatusParams = { textDocument?: lc.TextDocumentIdentifier };
export interface FetchDependencyGraphParams {}
export interface FetchDependencyListParams {}
export interface FetchDependencyGraphResult {
export interface FetchDependencyListResult {
crates: {
name: string;
version: string;
@ -80,11 +80,11 @@ export interface FetchDependencyGraphResult {
}[];
}
export const fetchDependencyGraph = new lc.RequestType<
FetchDependencyGraphParams,
FetchDependencyGraphResult,
export const fetchDependencyList = new lc.RequestType<
FetchDependencyListParams,
FetchDependencyListResult,
void
>("rust-analyzer/fetchDependencyGraph");
>("rust-analyzer/fetchDependencyList");
export interface FetchDependencyGraphParams {}