vscode-angular-snippets icon indicating copy to clipboard operation
vscode-angular-snippets copied to clipboard

Enable Angular Snippets to run on VS Code on the web

Open digitarald opened this issue 4 years ago • 5 comments

👋 I'm Harald, a PM from the VS Code team, and we recently announced VS Code for the Web at https://vscode.dev/, which provides a free, zero-install Microsoft Visual Studio Code experience running entirely in your browser. You can learn more here.

We'd like to ensure that Angular Snippets can run in the web, and we have a guide for enabling extensions for the web here. As a couple of highlights:

  • In VS Code for the Web, both the UI and extension host run inside the browser.
  • A web extension is structured like a regular extension, but with a different main file: it's defined by the browser property
  • Access to workspace files needs to go through the VS Code file system API accessible at vscode.workspace.fs
  • There are currently three ways to test a web extension

Feel free to reach out to me if you have questions or if I can help somehow. Thank you

digitarald avatar Nov 23 '21 18:11 digitarald

How do you enable an extension for the web, when the extension is just snippets? There is no "web" folder in my out / dist folder.

The docs say I need this setting, but I see other snippet extensions are available in vscode.dev but they do not have the "browser" set in their package.json files

Any help is appreciated

johnpapa avatar Jan 31 '22 15:01 johnpapa

Thanks for looking into this, @johnpapa!

@aeschli @tanhakabir do you have insights into John's question above?

bamurtaugh avatar Mar 09 '22 00:03 bamurtaugh

I believe other snippet extensions don't contain code but you have the command "angular.configureExpressServer" which contains code and some of it is not web friendly like your usage of fs in packageJson.ts

tanhakabir avatar Mar 09 '22 07:03 tanhakabir

ah. I had forgotten that I have code to create a file in here. I can remove that, thanks.

My original question remains:

How do you enable an extension for the web, when the extension is just snippets? There is no "web" folder in my out / dist folder. The docs say I need this setting, but I see other snippet extensions are available in vscode.dev but they do not have the "browser" set in their package.json files

johnpapa avatar Mar 09 '22 13:03 johnpapa

If the extension has only snippets (using the contribution point contributes.snippets) (or other declarative contributions) it works as both a web and node extension, no changes needed. If the extension has code (a main entry point in package.json) it also needs a browser entry point to work in a web extension host. It can also point to an empty stub.

aeschli avatar Mar 09 '22 16:03 aeschli

done

johnpapa avatar Jun 16 '23 01:06 johnpapa