mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
fixing stblib loading
This commit is contained in:
parent
795a1cbe89
commit
68aa20bb8a
1 changed files with 4 additions and 1 deletions
|
@ -80,6 +80,7 @@ export class RustDependenciesProvider implements vscode.TreeDataProvider<Depende
|
|||
const basePath = fspath.join(registryDir, fs.readdirSync(registryDir)[0]);
|
||||
const deps = await this.getDepsInCartoTree(basePath);
|
||||
const stdlib = await this.getStdLib();
|
||||
this.dependenciesMap[stdlib.dependencyPath.toLowerCase()] = stdlib;
|
||||
return [stdlib].concat(deps);
|
||||
}
|
||||
|
||||
|
@ -87,12 +88,14 @@ export class RustDependenciesProvider implements vscode.TreeDataProvider<Depende
|
|||
const toolchain = await activeToolchain();
|
||||
const rustVersion = await getRustcVersion(os.homedir());
|
||||
const stdlibPath = fspath.join(os.homedir(), '.rustup', 'toolchains', toolchain, 'lib', 'rustlib', 'src', 'rust', 'library');
|
||||
return new Dependency(
|
||||
const stdlib = new Dependency(
|
||||
"stdlib",
|
||||
rustVersion,
|
||||
stdlibPath,
|
||||
vscode.TreeItemCollapsibleState.Collapsed
|
||||
);
|
||||
|
||||
return stdlib;
|
||||
}
|
||||
|
||||
private async getDepsInCartoTree(basePath: string): Promise<Dependency[]> {
|
||||
|
|
Loading…
Reference in a new issue