How can I add vscode-builtin-* plugins within my own extension?

I’m trying to enable HTML syntax while developing my custom extension. Starting with the generator-theia-extension “hello world” template, I tried adding this to dependencies in theia-hello/theia-hello/package.json:

"@theia/vscode-builtin-html": "latest",
"@theia/vscode-builtin-html-language-features": "latest"

However, after running yarn in the root dir to rebuild, and restarting the server, .html files are not highlighted. Should these plugins be specified in a different place?

[EDIT]
I did a bit more digging, and found out that plugins need to be added to package.json theiaPlugins. I also thought maybe these should be added in browser-app/package.json. I updated browser-app/package.json to include the following:

  "theiaPluginsDir": "plugins",
  "theiaPlugins": {
      "vscode-builtin-html": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/html-1.39.1-prel.vsix",
      "vscode-builtin-html-language-features": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/html-language-features-1.39.1-prel.vsix",
      "vscode-builtin-css": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/css-1.39.1-prel.vsix",
      "vscode-builtin-css-language-features": "https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/css-language-features-1.39.1-prel.vsix"
  }

I then ran yarn theia download:plugins, which downloaded the plugins to browser-app/plugins. Then I ran cd browser-app && yarn theia start --plugins=local-dir:$(pwd)/plugins. Then I see the following output:

$ yarn theia start --plugins=local-dir:$(pwd)/plugins
yarn run v1.22.4
$ /tmp/theia-test/node_modules/.bin/theia start --plugins=local-dir:/tmp/theia-test/browser-app/plugins
root INFO Configuration directory URI: 'file:///home/ben/.theia'
root INFO Configuring to accept webviews on '.+.webview..+' hostname.
root INFO Theia app listening on http://localhost:3000.
root INFO PluginTheiaDirectoryHandler: accepting plugin with path /home/ben/.theia/plugins/vscode-builtin-css
root INFO PluginTheiaDirectoryHandler: accepting plugin with path /home/ben/.theia/plugins/vscode-builtin-css-language-features
root INFO PluginTheiaDirectoryHandler: accepting plugin with path /home/ben/.theia/plugins/vscode-builtin-html
root INFO PluginTheiaDirectoryHandler: accepting plugin with path /home/ben/.theia/plugins/vscode-builtin-html-language-features
root INFO PluginTheiaDirectoryHandler: accepting plugin with path /tmp/theia-test/browser-app/plugins/vscode-builtin-css
root INFO PluginTheiaDirectoryHandler: accepting plugin with path /tmp/theia-test/browser-app/plugins/vscode-builtin-css-language-features
root INFO PluginTheiaDirectoryHandler: accepting plugin with path /tmp/theia-test/browser-app/plugins/vscode-builtin-html
root INFO PluginTheiaDirectoryHandler: accepting plugin with path /tmp/theia-test/browser-app/plugins/vscode-builtin-html-language-features
root ERROR Failed to load plugin dependencies from '/home/ben/.theia/plugins/vscode-builtin-css' path Error: ENOENT: no such file or directory, open '/home/ben/.theia/plugins/vscode-builtin-css/package.json'
root ERROR Failed to load plugin dependencies from '/tmp/theia-test/browser-app/plugins/vscode-builtin-css' path Error: ENOENT: no such file or directory, open '/tmp/theia-test/browser-app/plugins/vscode-builtin-css/package.json'
root ERROR Failed to load plugin dependencies from '/home/ben/.theia/plugins/vscode-builtin-css-language-features' path Error: ENOENT: no such file or directory, open '/home/ben/.theia/plugins/vscode-builtin-css-language-features/package.json'
root ERROR Failed to load plugin dependencies from '/tmp/theia-test/browser-app/plugins/vscode-builtin-css-language-features' path Error: ENOENT: no such file or directory, open '/tmp/theia-test/browser-app/plugins/vscode-builtin-css-language-features/package.json'
root ERROR Failed to load plugin dependencies from '/home/ben/.theia/plugins/vscode-builtin-html' path Error: ENOENT: no such file or directory, open '/home/ben/.theia/plugins/vscode-builtin-html/package.json'
root ERROR Failed to load plugin dependencies from '/tmp/theia-test/browser-app/plugins/vscode-builtin-html' path Error: ENOENT: no such file or directory, open '/tmp/theia-test/browser-app/plugins/vscode-builtin-html/package.json'
root ERROR Failed to load plugin dependencies from '/home/ben/.theia/plugins/vscode-builtin-html-language-features' path Error: ENOENT: no such file or directory, open '/home/ben/.theia/plugins/vscode-builtin-html-language-features/package.json'
root ERROR Failed to load plugin dependencies from '/tmp/theia-test/browser-app/plugins/vscode-builtin-html-language-features' path Error: ENOENT: no such file or directory, open '/tmp/theia-test/browser-app/plugins/vscode-builtin-html-language-features/package.json'

In the IDE, if I look at >Toggle Plugins View, I see:
image

I’m not sure why it’s looking for package.json in the plugin root dir – it seems like it should be looking in the extension/ dir within the plugin.

Ok, I finally figured it out. I needed to add @theia/plugin-ext and @theia/plugin-ext-vscode to dependencies in browser-app/package.json. After that, the plugins loaded successfully.