You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class TreeSection extends ViewSection_1.ViewSection {
async openItem(...path) {
let items = [];
for (let i = 0; i < path.length; i += 1) {
const item = await this.findItem(path[i], i + 1);
if (await item?.hasChildren() && !await item?.isExpanded()) {
await item?.expand();
}
}
let currentItem = await this.findItem(path[0], 1);
for (let i = 0; i < path.length; i += 1) {
.
.
.
Here, path is ['test'], and in the first loop, when findItem() is called:
const item = await this.findItem(path[i], i + 1);
...i is 0, and path[0] is "test", this.findItem(path[i], i + 1) succeeds, and then the node is expanded in VS Code's UI.
But next, immediately after the first for loop, findItem() is called again:
let currentItem = await this.findItem(path[0], 1);
path[0] is still "test", but since the node was expanded, and it has nested empty folders, and explorer.compactFolders is true by default, the text of the node is now "test / two / three", and currentItem returned from this.findItem(path[0], 1) is undefined.
The text was updated successfully, but these errors were encountered:
TreeSection.openItem() doesn't work with compacted (empty) folders.
Let's say I have the following folder structure:
...and let's say that in my e2e test, I have /src/project open. When
/src/project
is opened, VS Code displays just:If /project/test is expanded, because VS Code has the
explorer.compactFolders
setting set to true by default, what we see is:(/project/test only has one folder, "two", and project/test/two only has one folder, "three", and so they are compacted)
OK, next write a test and add:
The implementation of
openItem()
is:Here, path is ['test'], and in the first loop, when findItem() is called:
...i is 0, and path[0] is "test", this.findItem(path[i], i + 1) succeeds, and then the node is expanded in VS Code's UI.
But next, immediately after the first for loop, findItem() is called again:
path[0]
is still "test", but since the node was expanded, and it has nested empty folders, and explorer.compactFolders is true by default, the text of the node is now "test / two / three", andcurrentItem
returned fromthis.findItem(path[0], 1)
is undefined.The text was updated successfully, but these errors were encountered: