-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Tree provider uniqueness #930
base: develop
Are you sure you want to change the base?
Conversation
AppMap collections / sub-groups are non-unique due to lack of a defined id, and therefore replicated across all projects in a workspace. This PR groups appmaps uniquely within tree items.
const lightChangedIcon = join(__dirname, '../images/modified-file-icon-dark.svg'); | ||
const darkChangedIcon = join(__dirname, '../images/modified-file-icon-light.svg'); | ||
// const lightChangedIcon = join(__dirname, '../images/modified-file-icon-dark.svg'); | ||
// const darkChangedIcon = join(__dirname, '../images/modified-file-icon-light.svg'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is WIP, I will add this back in.
const listItems = this.appmaps | ||
.appMaps() | ||
.filter((appMap) => | ||
isDeepStrictEqual(AppMapTreeDataProvider.appMapFolderItems(appMap), folderProperties) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method doesn't distinguish AppMaps by what project they are in. It collects all AppMaps that have the same "folderProperties", but the project in which the AppMap is defined is not one of those properties. Therefore, AppMaps get duplicated across workspace projects in the tree view.
src/tree/appMapTreeDataProvider.ts
Outdated
} | ||
} | ||
|
||
private getTopLevelTreeItems() { | ||
const projects = vscode.workspace.workspaceFolders; | ||
if (!projects || this.appmaps.appMaps().length === 0) return []; | ||
|
||
const appmapsByProject = new Map<vscode.WorkspaceFolder, AppMapLoader[]>(); | ||
const projectsWithAppMaps = this.appmaps.allAppMaps().reduce((projectsWithAppMaps, appmap) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Should be appmaps.appMaps()
, no?
7de7272
to
a1da37e
Compare
I still haven't gotten around to fixing this. It affects VSCode users with multi-project workspaces. |
Problem
Note the inclusion of the same AppMaps in two different projects:
Solution
AppMaps no longer replicated across projects: