Skip to content

Commit 112f8ba

Browse files
committed
don't use native-helper for debug adapter
VS Code can run the debug adapter using the built-in node runtime, so we don't need a platform-specific executable for this anymore.
1 parent 9640d98 commit 112f8ba

File tree

6 files changed

+8
-29
lines changed

6 files changed

+8
-29
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ All notable changes to the "ev3dev-browser" extension will be documented in this
44
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
55

66
## Unreleased
7+
### Changed
8+
- SSH shell no longer uses native executable on Linux and Mac.
79
### Fixed
810
- Fix debugger hanging when ev3dev Device Browser view is collapsed
911

package.json

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -183,18 +183,8 @@
183183
{
184184
"type": "ev3devBrowser",
185185
"label": "ev3dev",
186-
"linux": {
187-
"program": "./native/linux/helper"
188-
},
189-
"osx": {
190-
"program": "./native/darwin/helper"
191-
},
192-
"windows": {
193-
"program": "./native/win32/helper.exe"
194-
},
195-
"args": [
196-
"debugServer"
197-
],
186+
"program": "./out/native-helper/debugServer.js",
187+
"runtime": "node",
198188
"configurationAttributes": {
199189
"launch": {
200190
"required": [

src/device.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export class Device extends vscode.Disposable {
180180
ch.setWindow(rows, cols, 0, 0);
181181
}, data => {
182182
// dataIn callback
183-
ch.stdin.write(new Buffer(data, 'base64'));
183+
ch.stdin.write(Buffer.from(data, 'base64'));
184184
});
185185
});
186186
}

src/native-helper/debugServer.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,4 @@ class Ev3devBrowserDebugSession extends DebugSession {
4444
}
4545
}
4646

47-
/**
48-
* Run the debug server.
49-
*/
50-
export function run(): void {
51-
DebugSession.run(Ev3devBrowserDebugSession);
52-
}
53-
54-
if (require.main === module) {
55-
run();
56-
}
47+
DebugSession.run(Ev3devBrowserDebugSession);

src/native-helper/helper.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,11 @@
33
// use this extension. Since nexe creates a rather large executable for a simple
44
// program, we combine all of our helper programs into one executable.
55

6-
import { run as runDebugServer } from './debugServer';
76
import { run as runShell } from './shell';
87

98
const command = process.argv[1];
109

1110
switch(command) {
12-
case 'debugServer':
13-
runDebugServer();
14-
break;
1511
case 'shell':
1612
const port = parseInt(process.argv[2]);
1713
runShell(port);

src/native-helper/shell.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ export function run(port: number): void {
4040
term: process.env['TERM'] || 'xterm-256color'
4141
}, dataOut => {
4242
// dataOut callback
43-
process.stdout.write(new Buffer(dataOut, 'base64'));
43+
process.stdout.write(Buffer.from(dataOut, 'base64'));
4444
}, dataErr => {
4545
// dataErr callback
46-
process.stderr.write(new Buffer(dataErr, 'base64'));
46+
process.stderr.write(Buffer.from(dataErr, 'base64'));
4747
}, (resize, dataIn) => {
4848
// ready callback
4949
process.stdout.on('resize', () => {

0 commit comments

Comments
 (0)