Skip to content

Commit 15b9672

Browse files
authored
Merge pull request #9 from Plutoberth/saveOnExecute
Save files on execution with a config setting
2 parents f0e64b0 + 975ac74 commit 15b9672

File tree

7 files changed

+29
-7
lines changed

7 files changed

+29
-7
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,5 @@ It is also important that attaching a debugger will create a new debugger instan
6666

6767
## Contributors
6868
* [mrexodia](https://github.com/mrexodia)
69-
* [MeitarR](https://github.com/MeitarR)
69+
* [MeitarR](https://github.com/MeitarR)
70+
* [Plutoberth](https://github.com/Plutoberth)

ida/idacode_utils/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import idacode_utils.settings as settings
1111
from idacode_utils.socket_handler import SocketHandler
1212

13-
VERSION = "0.1.3"
13+
VERSION = "0.1.4"
1414
initialized = False
1515

1616
def setup_patches():

idacode/CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@
1717

1818
### 0.1.3
1919

20-
- Added support for Python 2
20+
- Added support for Python 2
21+
22+
### 0.1.4
23+
24+
- Added "Save on execute" support in settings

idacode/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,8 @@ IDACode doesn't support host to VM communication unless the VM uses a shared vol
5454

5555
### 0.1.3
5656

57-
- Added support for Python 2
57+
- Added support for Python 2
58+
59+
### 0.1.4
60+
61+
- Added "Save on execute" support in settings

idacode/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

idacode/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "IDACode",
44
"description": "Run and debug your IDA scripts from VS Code",
55
"icon": "images/icon.png",
6-
"version": "0.1.3",
6+
"version": "0.1.4",
77
"publisher": "Layle",
88
"license": "SEE LICENSE IN LICENSE.md",
99
"preview": true,
@@ -71,6 +71,11 @@
7171
"type": "integer",
7272
"default": 7066,
7373
"description": "The port the IDA debug server is listening on."
74+
},
75+
"IDACode.saveOnExecute": {
76+
"type": "boolean",
77+
"default": true,
78+
"description": "Save all open editors when executing."
7479
}
7580
}
7681
}

idacode/src/extension.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function getCurrentDocument(): string {
1515
return vscode.window.activeTextEditor?.document.uri.fsPath as string;
1616
}
1717

18-
function executeScript() {
18+
function executeScriptInIDA() {
1919
const currentDocument = getCurrentDocument();
2020
const name = path.parse(currentDocument).base;
2121
socket.send({
@@ -25,6 +25,14 @@ function executeScript() {
2525
vscode.window.showInformationMessage(`Sent ${name} to IDA`);
2626
}
2727

28+
function executeScript() {
29+
if (getConfig<boolean>('saveOnExecute')) {
30+
vscode.workspace.saveAll().then(executeScriptInIDA);
31+
} else {
32+
executeScriptInIDA();
33+
}
34+
}
35+
2836
function connectToIDA() {
2937
return new Promise((resolve, reject) => {
3038
const host = getConfig<string>('host');

0 commit comments

Comments
 (0)