Skip to content
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

viewsWelcome behavior does not match VSCode's #9361

Open
clovis-dugue opened this issue Apr 15, 2021 · 4 comments
Open

viewsWelcome behavior does not match VSCode's #9361

clovis-dugue opened this issue Apr 15, 2021 · 4 comments
Labels
help wanted issues meant to be picked up, require help vscode issues related to VSCode compatibility

Comments

@clovis-dugue
Copy link

clovis-dugue commented Apr 15, 2021

Bug Description:

ViewsWelcome content does not show on a standard VSCode extension.
It shows on the one provided in PR #8678

Steps to Reproduce:

See https://github.com/clovis-dugue/theia-viewswelcome-issue

Additional Information

@vince-fugnitto vince-fugnitto added help wanted issues meant to be picked up, require help vscode issues related to VSCode compatibility labels Apr 15, 2021
@xcariba
Copy link
Contributor

xcariba commented Jul 4, 2021

I've investigated this issue a little bit. It seems that viewsWelcome will not show up until getChildren() promise is resolved. If promise returns empty array it shows up. Theia tries to load welcome widget, but it cannot find it - it cannot find it by key "{"factoryId":"plugin-view-data","options":{"id":"myExtensionId"}}". Seems that it is registered only after root model is fetched.

@clovis-dugue
Copy link
Author

Thanks for the input! I don't really have time for this right now but I will be sure to use it when coming back to it.

@davide-sergi
Copy link

You need to register a TreeDataProvider which return an empty tree. This is not required for vscode environment.
You can keep same package.json.

I solved with following code:


import * as vscode from 'vscode';

export async function activate(context: vscode.ExtensionContext) { 
  vscode.window.registerTreeDataProvider(
	  "my-view-id",
	  new EmptyTreeDataProvider()
  );
}

export function deactivate() {}

export class EmptyTreeDataProvider implements vscode.TreeDataProvider<any> {
	constructor() {}

	getTreeItem(element: any): vscode.TreeItem {
		return {};
	}

	getChildren(element?: any): Thenable<any[]> {
		return new Promise((resolve) => resolve([]));
	}
}



@jcortell68
Copy link
Contributor

@davide-sergi Your workaround worked for me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted issues meant to be picked up, require help vscode issues related to VSCode compatibility
Projects
None yet
Development

No branches or pull requests

5 participants