Microsoft/vscode

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

Open

#228.781 aberto em 16 de set. de 2024

Ver no GitHub
 (0 comments) (0 reactions) (1 assignee)TypeScript (10.221 forks)batch import
feature-requesthelp wantedremote

Métricas do repositório

Stars
 (74.848 stars)
Métricas de merge de PR
 (Mesclagem média 11h 43m) (1.000 fundiu PRs em 30d)

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.

Guia do colaborador