Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add VSCode Hello World extension #6463

Merged
merged 3 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion openhands/runtime/utils/runtime_templates/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

Expand Down
16 changes: 16 additions & 0 deletions openhands/runtime/utils/vscode-extensions/hello-world/extension.js
Original file line number Diff line number Diff line change
@@ -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
}
23 changes: 23 additions & 0 deletions openhands/runtime/utils/vscode-extensions/hello-world/package.json
Original file line number Diff line number Diff line change
@@ -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"
}]
}
}
Loading