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

Express configuration support requires workspace access - breaks extensionKind 'ui' #111

Closed
egamma opened this issue Feb 13, 2020 · 1 comment

Comments

@egamma
Copy link
Contributor

egamma commented Feb 13, 2020

The extension is currently defined as a 'ui' extension. This is correct when it comes to snippets, they run fine in the UI extension host only.

However, the extension also provides a command that configures an express setup "Add Node.js express file to workspace". This command writes files to the workspace

fs.writeFileSync(workspacePath, writerFunction(port, folderToServe), {
. This will fail when run in a remote setup, since the extension runs in the UI extension host where there is no access to the workspace.

There are several options:

  • change the extensionKind to be a "workspace" extension only ("extensionKind": ["workspace"]). This means the user will have to install the extension into a remote container.
  • change the implementation of the express configuration support so that it doesn't access the filesystem directly using the fs module but uses the vscode workspace file system API (vscode.workspace.fs). With this implementation change the extension can be run both as a 'ui' and a 'workspace' extension.
  • provide the express configuration support in a separate extension that has the extensionkind workspace ("extensionKind": ["workspace"]).

In general we prefer that customizations like themes and snippets are have the following "extensionKind": ["ui", "workspace"].

@johnpapa
Copy link
Owner

johnpapa commented Mar 9, 2020

thanks for the details and options.

given your recommendation on making this a ui and workspace, i'll merge that PR and close this issue. fixed in 9.1.2

@johnpapa johnpapa closed this as completed Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants