Skip to content

Commit

Permalink
Examples for #12721
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-fleck-at committed Jul 27, 2023
1 parent 8410bd6 commit 35ce594
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"--app-project-path=${workspaceFolder}/examples/electron",
"--remote-debugging-port=9222",
"--no-app-auto-install",
"--plugins=local-dir:../../plugins",
"--plugins=local-dir:../../sample-plugins/sample-namespace",
"--ovsx-router-config=${workspaceFolder}/examples/ovsx-router-config.json"
],
"env": {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@
"yargs": "^15.3.1"
},
"scripts": {
"all": "yarn -s install && yarn -s lint && yarn -s build",
"all": "yarn -s install && yarn -s build",
"browser": "yarn -s --cwd examples/browser",
"build": "yarn -s compile && yarn -s build:examples",
"build:examples": "yarn browser build && yarn electron build",
"build:examples": "yarn electron build",
"clean": "yarn -s rebuild:clean && yarn -s lint:clean && node scripts/run-reverse-topo.js yarn -s clean",
"compile": "echo Compiling TypeScript sources... && yarn -s compile:clean && yarn -s compile:tsc",
"compile:clean": "ts-clean dev-packages/* packages/*",
Expand Down
50 changes: 50 additions & 0 deletions sample-plugins/sample-namespace/plugin-a/customTaskProvider.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions sample-plugins/sample-namespace/plugin-a/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,19 @@
// *****************************************************************************

const vscode = require('vscode');
const customTaskProvider_1 = require("./customTaskProvider");

let customTaskProvider;

exports.activate = function (context) {
context.subscriptions.push(vscode.commands.registerCommand('plugin-a.hello', () => {
vscode.window.showInformationMessage('Hello from plugin-a!');
customTaskProvider = vscode.tasks.registerTaskProvider(customTaskProvider_1.CustomTaskProvider.type, new customTaskProvider_1.CustomTaskProvider());
}));
}

exports.deactivate = function deactivate() {
if (customTaskProvider) {
customTaskProvider.dispose();
}
};
5 changes: 5 additions & 0 deletions sample-plugins/sample-namespace/plugin-a/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
"command": "plugin-a.hello",
"title": "Hello from plugin-a"
}
],
"taskDefinitions": [
{
"type": "mytasktype"
}
]
}
}

0 comments on commit 35ce594

Please sign in to comment.