Skip to content

Commit 74cbfec

Browse files
committed
Support multiple workspaces for library tree
1 parent ece8781 commit 74cbfec

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/TreeDataProvider.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export class FileTreeItemLibraryTree extends TreeItem{
112112
super(uri, vscode.TreeItemCollapsibleState.Expanded);
113113
this.moduleNode = moduleNode;
114114
this.uri = uri;
115-
let name = uri.fsPath.slice(gWorkspacePath.length + 1);
115+
let name = vscode.workspace.asRelativePath(uri);
116116
this.description = name;
117117
this.label = path.basename(uri.fsPath);
118118
this.iconPath = new vscode.ThemeIcon("file");

src/contextState/cmds.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -372,13 +372,14 @@ import { EdkSymbolInfLibrary } from "../symbols/infSymbols";
372372
const sectionRange = libraries[0].parent?.range.start;
373373
if(sectionRange===undefined){continue;}
374374
let moduleNode = new FileTreeItemLibraryTree(fileUri, sectionRange,null);
375+
moduleNode.description = wp.platformName;
375376
edkLensTreeDetailProvider.addChildren(moduleNode);
376377
for (const library of libraries) {
377378
let libDefinitions = await wp.getLibDeclarationModule(fileUri, library.name);
378379
for (const libDefinition of libDefinitions) {
379380
let filePaths = await gPathFind.findPath(libDefinition.path);
380381
for (const path of filePaths) {
381-
let libNode = new FileTreeItemLibraryTree(path.uri, new vscode.Position(0,0),moduleNode);
382+
let libNode = new FileTreeItemLibraryTree(path.uri, libDefinition.location.range.start,moduleNode);
382383
moduleNode.addChildren(libNode);
383384
}
384385
}

0 commit comments

Comments
 (0)