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

WorkspaceFolders can't be changed while testing #78740

Closed
manuth opened this issue Aug 8, 2019 · 9 comments
Closed

WorkspaceFolders can't be changed while testing #78740

manuth opened this issue Aug 8, 2019 · 9 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@manuth
Copy link
Contributor

manuth commented Aug 8, 2019

Info

  • VSCode Version: 1.37.0
  • OS Version: Windows 10 Build 1903

Steps to Reproduce:

  1. Create an extension using vscode-generator-code
  2. In a test-file open up a workspace-folder using vscode.workspace.updateWorkspaceFolders

Does this issue occur when all extensions are disabled?: Yes

Feel free to clone my repo https://github.com/manuth/MarkdownConverter/ and checkout the testrunner-issue to reproduce the error.

Expected Behavior

The workspace-folders should be changed.

Actual Behavior

An error-message occurs in the extension developement host:

Extension 'Markdown Converter' failed to update workspace folders: {1}
@vscodebot vscodebot bot added the new release label Aug 8, 2019
@manuth manuth changed the title WorkspaceFolders can't be changed WorkspaceFolders can't be changed while testing Aug 9, 2019
@bpasero
Copy link
Member

bpasero commented Aug 9, 2019

@manuth please try to distill an isolated minimal test case to reproduce via the yo generator for me to run

@bpasero bpasero added the info-needed Issue requires more information from poster label Aug 9, 2019
@manuth
Copy link
Contributor Author

manuth commented Aug 9, 2019

Alright - there you go: https://github.com/manuth/TestExtension
Thanks for the rapid answer! 😄

@manuth
Copy link
Contributor Author

manuth commented Aug 9, 2019

I also verified that when updating workspace-folders from a command via vscode.commands.executeCommand causes said issue, too.

  • Manually changing the opened folder (which is what I was trying to reach using updateWorkspaceFolder in the first place) via File => Open Folder is working just fine
  • Manually adding a folder to the workspace does not work (nothing happens)
  • Manually adding a folder to the workspace after opening a folder (File => Open Folder) works but stops the debugger

In my test-scenario I try to verify whether my settings are handled correctly in File/Folder/Workspace-mode so opening a folder, closing a folder and opening a workspace are important key-functions to me.

@bpasero
Copy link
Member

bpasero commented Aug 9, 2019

@manuth adding a folder to an otherwise empty workspace or changing the first folder in that workspace currently requires us to restart the extension host. So it is currently not possible to test this, is that what you see?

@manuth
Copy link
Contributor Author

manuth commented Aug 9, 2019

I'm not sure about that.
As manually opening a folder in the extension development host ( File => Open Folder) is working without breaking the debugger I don't guess that the fact that the extension host needs to be restarted should cause any trouble.

Sadly I do not know how to debug the extension host itself.

To me it looks like this piece of code is getting triggered:

this._proxy.$updateWorkspaceFolders(extName, index, deleteCount, validatedDistinctWorkspaceFoldersToAdd).then(undefined, error => {
// in case of an error, make sure to clear out the unconfirmed workspace
// because we cannot expect the acknowledgement from the main side for this
this._unconfirmedWorkspace = undefined;
// show error to user
this._messageService.$showMessage(Severity.Error, localize('updateerror', "Extension '{0}' failed to update workspace folders: {1}", extName, error), { extension }, []);
});

@bpasero
Copy link
Member

bpasero commented Aug 9, 2019

@aeschli looks like this is coming from you via this change:

eee10d2

But yeah, we currently do not support to test a workspace folder change because we require the extension host to restart in that case.

@manuth
Copy link
Contributor Author

manuth commented Aug 9, 2019

@bpasero should I open up a feature request or is this noted already?

@bpasero
Copy link
Member

bpasero commented Aug 9, 2019

#69335

@manuth
Copy link
Contributor Author

manuth commented Aug 31, 2019

@bpasero do I understand correctly that after this change you still won't be able to change the currently opened folder in vscode but only to manipulate the currently opened vscode-workspace?

@vscodebot vscodebot bot locked and limited conversation to collaborators Sep 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants