Add VSCode Hello World extension (#6463)

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
This commit is contained in:
Robert Brennan
2025-01-31 11:48:59 -05:00
committed by GitHub
parent 0c84fe58dd
commit 7f4b5476dc
3 changed files with 45 additions and 2 deletions

View File

@@ -63,7 +63,10 @@ RUN if [ -z "${RELEASE_TAG}" ]; then \
tar -xzf ${RELEASE_TAG}-linux-${arch}.tar.gz && \
mv -f ${RELEASE_TAG}-linux-${arch} ${OPENVSCODE_SERVER_ROOT} && \
cp ${OPENVSCODE_SERVER_ROOT}/bin/remote-cli/openvscode-server ${OPENVSCODE_SERVER_ROOT}/bin/remote-cli/code && \
rm -f ${RELEASE_TAG}-linux-${arch}.tar.gz
rm -f ${RELEASE_TAG}-linux-${arch}.tar.gz && \
# Install our custom extension
mkdir -p ${OPENVSCODE_SERVER_ROOT}/extensions/openhands-hello-world && \
cp -r /openhands/code/openhands/runtime/utils/vscode-extensions/hello-world/* ${OPENVSCODE_SERVER_ROOT}/extensions/openhands-hello-world/
{% endmacro %}
@@ -102,7 +105,6 @@ RUN \
# rather than the current OpenHands release
{{ setup_base_system() }}
{{ setup_vscode_server() }}
# Install micromamba
RUN mkdir -p /openhands/micromamba/bin && \
@@ -137,6 +139,8 @@ COPY ./code/pyproject.toml ./code/poetry.lock /openhands/code/
COPY ./code/openhands /openhands/code/openhands
RUN chmod a+rwx /openhands/code/openhands/__init__.py
{{ setup_vscode_server() }}
# ================================================================
# END: Build from versioned image
# ================================================================

View File

@@ -0,0 +1,16 @@
const vscode = require('vscode');
function activate(context) {
let disposable = vscode.commands.registerCommand('openhands-hello-world.helloWorld', function () {
vscode.window.showInformationMessage('Hello from OpenHands!');
});
context.subscriptions.push(disposable);
}
function deactivate() {}
module.exports = {
activate,
deactivate
}

View File

@@ -0,0 +1,23 @@
{
"name": "openhands-hello-world",
"displayName": "OpenHands Hello World",
"description": "A simple hello world extension for OpenHands",
"version": "0.0.1",
"publisher": "openhands",
"engines": {
"vscode": "^1.94.0"
},
"categories": [
"Other"
],
"activationEvents": [
"onCommand:openhands-hello-world.helloWorld"
],
"main": "./extension.js",
"contributes": {
"commands": [{
"command": "openhands-hello-world.helloWorld",
"title": "Hello World from OpenHands"
}]
}
}