-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Custom view (TreeDataProvider) broken in 1.19.0 #40357
Comments
@letmaik Is it possible to provide a sample that can reproduce this issue? It will be helpful to diagnose the issue correctly rather than doing some guess works. |
Extracting a minimal example will take some effort (I can do it but currently I'm quite busy), I was hoping you guys have some debugger kung fu which would expose the root of the exception easily. In the mean time I was trying to debug the exception under a source-built VS Code (and then simply loading my extension into it via a .vsix file), but I got stuck at the boundary of some extension host proxy for the tree view. Let me know if you'd still like a minimal example, then I'll try to create one within the next weeks. |
@letmaik This error can happen due to various reasons. I also have couple of variety of examples which cannot reproduce this. Hence, asking for the sample. |
I also get that error. I have a tree provider that is refreshed whenever the active editor changes and shows only for certain file types. This is the relevant code: getChildren(element?: Import): Thenable<Import[]> {
if (!element) {
let editor = window.activeTextEditor;
if (editor && editor.document.languageId === "antlr") {
let dependencies = this.backend.getDependencies(editor.document.fileName);
let imports: Import[] = [];
for (let dep of dependencies) {
imports.push(new Import(dep, TreeItemCollapsibleState.None));
}
return new Promise(resolve => {
resolve(imports);
});
}
}
return Promise.resolve([]);
} It all works nicely until the line |
@mike-lischke Thanks for the snippet. I will use it to reproduce and fix it. |
@letmaik @mike-lischke Unfortunately, I could not reproduce this bug with any of the tree samples I have, even after using the partial sample from @mike-lischke I pushed an hypothetical fix which will be available in tomorrows insiders. Can you please verify your issue using that? Thanks |
@sandy081 I just pulled from master and ran vs code from there, it's fixed :) If you want to figure out why it's fixed you could install my extension https://github.com/letmaik/vscode-git-tree-compare and see what the behaviour is in the last vs code release vs master (look at the console where an exception will be if you open a git managed folder) |
Thanks @letmaik |
I think this bug is not fully solved and your fix only hides the problem. I see the same behaviour as back then. Like in the past this issue appears randomly and not always, but it's quite reproducible. |
@letmaik Can you please provide steps to reproduce? |
Yes, it's not minimal but it's very suitable for debugging:
|
@letmaik Thanks for the steps. Since this issue was closed, opened a new issue with the steps described by you. |
I updated to 1.19.0 on several systems (all Windows) and on all of them my extension https://github.com/letmaik/vscode-git-tree-compare suddenly doesn't work anymore and I see a weird error in the console log:
I couldn't find anything in the changelog which was related to breaking changes related to views.
The error message seems to come from https://github.com/Microsoft/vscode/blob/23affbd2b825e0782fc5e6c6a93db47db5511d49/src/vs/base/parts/tree/browser/treeModel.ts#L475 which calls the
getChildren()
method of the provider, but I always return an array, so I'm a bit confused what's going on. I'm also not sure how to debug directly into VS Code source code liketreeModel.ts
, which would help analyze this problem.The text was updated successfully, but these errors were encountered: