Skip to content

Commit de66d66

Browse files
committed
fixing stblib loading
1 parent a05b95d commit de66d66

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

editors/code/src/dependencies_provider.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,22 @@ export class RustDependenciesProvider implements vscode.TreeDataProvider<Depende
8080
const basePath = fspath.join(registryDir, fs.readdirSync(registryDir)[0]);
8181
const deps = await this.getDepsInCartoTree(basePath);
8282
const stdlib = await this.getStdLib();
83+
this.dependenciesMap[stdlib.dependencyPath.toLowerCase()] = stdlib;
8384
return [stdlib].concat(deps);
8485
}
8586

8687
private async getStdLib(): Promise<Dependency> {
8788
const toolchain = await activeToolchain();
8889
const rustVersion = await getRustcVersion(os.homedir());
8990
const stdlibPath = fspath.join(os.homedir(), '.rustup', 'toolchains', toolchain, 'lib', 'rustlib', 'src', 'rust', 'library');
90-
return new Dependency(
91+
const stdlib = new Dependency(
9192
"stdlib",
9293
rustVersion,
9394
stdlibPath,
9495
vscode.TreeItemCollapsibleState.Collapsed
9596
);
97+
98+
return stdlib;
9699
}
97100

98101
private async getDepsInCartoTree(basePath: string): Promise<Dependency[]> {

0 commit comments

Comments
 (0)