Microsoft/vscode

`code serve-web` ignores the `--enable-proposed-api` flag

Open

#228.781 aperta il 16 set 2024

Vedi su GitHub
 (0 commenti) (0 reazioni) (1 assegnatario)TypeScript (10.221 fork)batch import
feature-requesthelp wantedremote

Metriche repository

Star
 (74.848 star)
Metriche merge PR
 (Merge medio 11h 43m) (1000 PR mergiate in 30 g)

Descrizione

Does this issue occur when all extensions are disabled?: N/A, this requires an extension with proposed APIs enable to occur.

  • VS Code Version: code 1.93.1 (commit 38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40)
  • OS Version: Debian 11

Steps to Reproduce:

  1. Create an extension that declares enabledApiProposals in its package.json file, e.g.:
<...>
"name": "myextension",
"publisher": "publisher",
"enabledApiProposals": [
    "chatParticipantPrivate"
],
<...>
  1. Launch serve-web with the --enable-proposed-api option enabling proposed APIs for your extension:
code --enable-proposed-api="publisher.myextension" \
  serve-web \
  --port "11001" \
  --host "0.0.0.0" \
  --without-connection-token \
  --accept-server-license-terms
  1. Observe developer tools console:
    • Expected: The extension is allowed to call into the proposed API.
    • Actual:
mainThreadExtensionService.ts:107 Activating extension 'publisher.myextension' failed: Extension 'publisher.myextension' CANNOT use API proposal: chatParticipantPrivate.
Its package.json#enabledApiProposals-property declares:  but NOT chatParticipantPrivate.
The missing proposal MUST be added and you must start in extension development mode or use the following command line switch: --enable-proposed-api publisher.myextension.

The flag does work if code is launched locally and serve-web is not invoked. However the web IDE enabled by serve-web ignores the flag.

Guida contributor