Skip to content

Commit 0fa074f

Browse files
authored
Merge pull request #49 from junron/master
Fix extension host crash when used with GitHub Copilot
2 parents 555970d + 099047a commit 0fa074f

5 files changed

Lines changed: 21 additions & 21 deletions

File tree

idacode/CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,8 @@
3636
### 0.3.0
3737

3838
- Fixed Python 2 support (PR #17)
39-
- Fixed issue where debugpy would attempt to spawn the current process (Issue #23)
39+
- Fixed issue where debugpy would attempt to spawn the current process (Issue #23)
40+
41+
### 0.3.1
42+
43+
- Fixed unnecessary global prototype pollution that broke other extensions (eg GitHub Copilot)

idacode/README.md

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

7575
- Fixed Python 2 support (PR #17)
76-
- Fixed issue where debugpy would attempt to spawn the current process (Issue #23)
76+
- Fixed issue where debugpy would attempt to spawn the current process (Issue #23)
77+
78+
### 0.3.1
79+
80+
- Fixed unnecessary global prototype pollution that broke other extensions (eg GitHub Copilot)

idacode/package.json

Lines changed: 1 addition & 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.3.0",
6+
"version": "0.3.1",
77
"publisher": "Layle",
88
"license": "SEE LICENSE IN LICENSE.md",
99
"preview": true,

idacode/src/extension.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import * as vscode from 'vscode';
22
import * as path from 'path';
33
import * as WebSocket from 'ws';
44
import { Event } from './utils/events';
5-
import './utils/extensions';
65

76
var socket: WebSocket;
87

@@ -15,13 +14,17 @@ function getCurrentDocument(): string {
1514
return vscode.window.activeTextEditor?.document.uri.fsPath as string;
1615
}
1716

17+
function toBuffer(obj: Object): Buffer {
18+
return Buffer.from(JSON.stringify(obj));
19+
}
20+
1821
function executeScriptInIDA() {
1922
const currentDocument = getCurrentDocument();
2023
const name = path.parse(currentDocument).base;
21-
socket.send({
24+
socket.send(toBuffer({
2225
event: Event.ExecuteScript,
2326
path: currentDocument
24-
}.toBuffer());
27+
}));
2528
vscode.window.showInformationMessage(`Sent ${name} to IDA`);
2629
}
2730

@@ -47,10 +50,10 @@ function connectToIDA() {
4750
prompt: 'Enter the path to the folder containing the script',
4851
value: currentFolder
4952
});
50-
socket.send({
53+
socket.send(toBuffer({
5154
event: Event.SetWorkspace,
5255
path: workspaceFolder
53-
}.toBuffer());
56+
}));
5457
vscode.window.showInformationMessage(`Set workspace folder to ${workspaceFolder}`);
5558
resolve();
5659
});
@@ -81,9 +84,9 @@ function connectToIDA() {
8184
}
8285

8386
function attachToIDA() {
84-
socket.send({
87+
socket.send(toBuffer({
8588
event: Event.AttachDebugger
86-
}.toBuffer());
89+
}));
8790
}
8891

8992
function connectAndAttachToIDA() {

idacode/src/utils/extensions.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)