Skip to content

Commit de16ef3

Browse files
feat: support --enable-proposed-api
1 parent e1d9017 commit de16ef3

File tree

5 files changed

+39
-0
lines changed

5 files changed

+39
-0
lines changed

src/code-server/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ VS Code in the browser
2727
| disableTelemetry | Disable telemetry reporting. | boolean | false |
2828
| disableUpdateCheck | Disable update check. Without this flag, code-server checks every 6 hours against the latest GitHub release and notifies once a week when updates are available. | boolean | false |
2929
| disableWorkspaceTrust | Disable Workspace Trust feature. This only affects the current session. | boolean | false |
30+
| enableProposedAPI | Comma-separated list of VS Code extension IDs to enable proposed API features for. | string | - |
3031
| extensions | Comma-separated list of VS Code extensions to install. Format: 'publisher.extension[@version]' (e.g., 'ms-python.python,ms-azuretools.vscode-docker'). | string | - |
3132
| host | The address to bind to for the code-server. Use '0.0.0.0' to listen on all interfaces. | string | 127.0.0.1 |
3233
| locale | Set VS Code display language and language shown on the login page. Format should be an IETF language tag (e.g., 'en', 'fr', 'zh-CN'). | string | - |

src/code-server/devcontainer-feature.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@
6565
"default": false,
6666
"description": "Disable Workspace Trust feature. This only affects the current session."
6767
},
68+
"enableProposedAPI": {
69+
"type": "string",
70+
"default": "",
71+
"description": "Comma-separated list of VS Code extension IDs to enable proposed API features for."
72+
},
6873
"extensions": {
6974
"type": "string",
7075
"default": "",

src/code-server/install.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ for trusted_origin in "${trusted_origins[@]}"; do
9898
FLAGS+=(--trusted-origins "$trusted_origin")
9999
done
100100

101+
IFS=',' read -ra proposed_api_extensions <<<"$ENABLEPROPOSEDAPI"
102+
declare -p proposed_api_extensions
103+
104+
for extension in "${proposed_api_extensions[@]}"; do
105+
FLAGS+=(--enable-proposed-api "$extension")
106+
done
107+
101108
cat > /usr/local/bin/code-server-entrypoint <<EOF
102109
#!/usr/bin/env bash
103110
set -e
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Optional: Import test library bundled with the devcontainer CLI
5+
source dev-container-features-test-lib
6+
7+
# Feature-specific tests
8+
check "code-server version" code-server --version
9+
check "code-server running" pgrep -f 'code-server/lib/node.*/code-server'
10+
check "code-server listening" lsof -i "@127.0.0.1:8080"
11+
12+
check "code-server enable-proposed-api" grep '"--enable-proposed-api".*"rust-lang.rust-analyzer".*"--enable-proposed-api".*"ms-python.python"' < /usr/local/bin/code-server-entrypoint
13+
14+
# Report results
15+
reportResults

test/code-server/scenarios.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,5 +208,16 @@
208208
"trustedOrigins": ["dev.coder.com", "coder.com"]
209209
}
210210
}
211+
},
212+
"code-server-enable-proposed-api": {
213+
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
214+
"features": {
215+
"code-server": {
216+
"enableProposedAPI": [
217+
"rust-lang.rust-analyzer",
218+
"ms-python.python"
219+
]
220+
}
221+
}
211222
}
212223
}

0 commit comments

Comments
 (0)