You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 10, 2019. It is now read-only.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,10 @@
1
1
# Change Log (vs-script-commands)
2
2
3
+
## 2.0.0 (April 11th, 2017; improved execution of scripts)
4
+
5
+
* the behavior of executing scripts has been improved ... if you come from version 1.x, have a look at the [wiki](https://github.com/mkloubert/vs-script-commands/wiki#since-version-2x-) first
6
+
* if you have problems, you can open an [issue](https://github.com/mkloubert/vs-script-commands/issues) and/or download a version 1.x branch from [here](https://github.com/mkloubert/vs-script-commands/releases)
7
+
3
8
## 1.12.0 (April 10th, 2017; REST API)
4
9
5
10
* added `startApi()` and `stopApi()` methods to [ScriptCommandExecutorArguments](https://mkloubert.github.io/vs-script-commands/interfaces/_contracts_.scriptcommandexecutorarguments.html) interface, which make use of commands provided by extensions like [vs-rest-api](https://github.com/mkloubert/vs-rest-api)
Copy file name to clipboardExpand all lines: README.md
+24-4Lines changed: 24 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@ Adds additional commands to [Visual Studio Code](https://code.visualstudio.com/)
12
12
13
13
1.[Install](#install-)
14
14
2.[How to use](#how-to-use-)
15
+
*[Changes](#changes-)
15
16
*[Settings](#settings-)
16
17
*[Commands](#commands-)
17
18
*[Key bindinds](#key-bindinds-)
@@ -33,6 +34,10 @@ Or search for things like `vs-script-commands` in your editor:
33
34
34
35
## How to use [[↑](#table-of-contents)]
35
36
37
+
### Changes [[↑](#how-to-use-)]
38
+
39
+
* if you come from version 1.x, you should take a look at the [wiki](https://github.com/mkloubert/vs-script-commands/wiki#since-version-2x-) first ... if you have problems, you can open an [issue](https://github.com/mkloubert/vs-script-commands/issues) and/or download a version 1.x branch from [here](https://github.com/mkloubert/vs-script-commands/releases)
40
+
36
41
### Settings [[↑](#how-to-use-)]
37
42
38
43
Open (or create) your `settings.json` in your `.vscode` subfolder of your workspace.
@@ -55,7 +60,7 @@ Add a `script.commands` section:
55
60
56
61
#### Commands [[↑](#settings-)]
57
62
58
-
Define one or more command, by defining its `id` and the script file (relative to your workspace) which should be executed:
63
+
Define one or more command, by defining its `id` and the script file, which should be executed:
59
64
60
65
```json
61
66
{
@@ -133,7 +138,7 @@ exports.execute = function (args) {
133
138
var scriptFile =path.basename(__filename);
134
139
135
140
// open HTML document in new tab (for reports e.g.)
136
-
args.openHtml('Hello from my extension: '+ scriptFile, 'My HTML document').then(function() {
141
+
args.openHtml('<html>Hello from my extension: '+ scriptFile+'</html>', 'My HTML document').then(function() {
137
142
// HTML opened
138
143
}, function(err) {
139
144
// opening HTML document failed
@@ -148,12 +153,27 @@ exports.execute = function (args) {
148
153
});
149
154
150
155
vscode.window.showInformationMessage('Hello from my extension: '+ scriptFile);
156
+
157
+
// you also can return a Promise
158
+
// if your command is executed async
159
+
return666;
151
160
}
152
161
```
153
162
154
163
The `args` parameter uses the [ScriptCommandExecutorArguments](https://mkloubert.github.io/vs-script-commands/interfaces/_contracts_.scriptcommandexecutorarguments.html) interface.
155
164
156
-
You can return a number (sync execution), a [Promise](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise) or nothing (default exit code `0`).
165
+
You can now execute the command by anything that uses the [Visual Studio Code API](https://code.visualstudio.com/docs/extensionAPI/vscode-api#_commands):
0 commit comments