Microsoft/vscode

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

Open

#228 781 ouverte le 16 sept. 2024

Voir sur GitHub
 (0 commentaires) (0 réactions) (1 assigné)TypeScript (10 221 forks)batch import
feature-requesthelp wantedremote

Métriques du dépôt

Stars
 (74 848 stars)
Métriques de merge PR
 (Merge moyen 11h 43m) (1 000 PRs mergées en 30 j)

Description

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.

Guide contributeur