Skip to content

Commit 1ba5ea3

Browse files
authored
Merge pull request #167 from NativeScript/iiivanov/fix-ts-breakpoint-windows-2
Fixing typescript breakpoints on windows
2 parents 53fa7e8 + 0211173 commit 1ba5ea3

File tree

5 files changed

+22
-15
lines changed

5 files changed

+22
-15
lines changed

.vscode/launch.json

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"args": [ "--server=4712" ],
1111
"stopOnEntry": false,
1212
"sourceMaps": true,
13-
"outDir": "${workspaceRoot}/out",
14-
"cwd": "${workspaceRoot}"
13+
"outFiles": [ "${workspaceFolder}/out/**/*.js" ],
14+
"cwd": "${workspaceFolder}"
1515
},
1616
{
1717
"name": "launch in extension host",
@@ -22,10 +22,9 @@
2222
"args": [
2323
"--extensionDevelopmentPath=${workspaceRoot}"
2424
],
25-
"stopOnEntry": true,
26-
"sourceMaps": true,
27-
"outDir": "${workspaceRoot}/out",
28-
"cwd": "${workspaceRoot}"
25+
"stopOnEntry": false,
26+
"sourceMaps": true,
27+
"outFiles": [ "${workspaceFolder}/out/**/*.js" ],
2928
},
3029
{
3130
"name": "run tests on mac",
@@ -75,5 +74,11 @@
7574
"outDir": "${workspaceRoot}/out",
7675
"cwd": "${workspaceRoot}"
7776
}
78-
]
77+
],
78+
"compounds": [
79+
{
80+
"name": "Extension + Server",
81+
"configurations": [ "launch in extension host", "launch as server" ]
82+
}
83+
]
7984
}

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nativescript",
3-
"version": "0.7.3",
3+
"version": "0.7.4",
44
"minNativescriptCliVersion": "2.5.0",
55
"icon": "images/icon.png",
66
"displayName": "NativeScript",
@@ -25,13 +25,14 @@
2525
],
2626
"license": "SEE LICENSE IN LICENSE.txt",
2727
"dependencies": {
28-
"vscode-chrome-debug-core": "~3.9.0",
2928
"node-ipc": "8.10.3",
3029
"source-map": "0.6.1",
31-
"xmlhttprequest": "https://github.com/telerik/node-XMLHttpRequest/tarball/master",
30+
"tree-kill": "^1.2.0",
3231
"universal-analytics": "0.4.13",
32+
"vscode-chrome-debug-core": "~3.9.0",
3333
"vscode-debugadapter": "1.26.0",
34-
"vscode-debugprotocol": "1.26.0"
34+
"vscode-debugprotocol": "1.26.0",
35+
"xmlhttprequest": "https://github.com/telerik/node-XMLHttpRequest/tarball/master"
3536
},
3637
"devDependencies": {
3738
"@types/mocha": "2.2.41",

src/debug-adapter/adapter/sourceMaps/sourceMapTransformer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class SourceMapTransformer implements DebugProtocol.IDebugTransformer {
5757
public setBreakpoints(args: DebugProtocol.ISetBreakpointsArgs, requestSeq: number): Promise<void> {
5858
return new Promise<void>((resolve, reject) => {
5959
if (this._sourceMaps && args.source.path && path.extname(args.source.path) !== ".js") {
60-
const argsPath = args.source.path;
60+
const argsPath = utils.fixDriveLetterAndSlashes(args.source.path);
6161
const mappedPath = this._sourceMaps.MapPathFromSource(argsPath);
6262
if (mappedPath) {
6363
Services.logger().log(`SourceMaps.setBP: Mapped ${argsPath} to ${mappedPath}`);

src/debug-adapter/webKitDebugAdapter.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {formatConsoleMessage} from './consoleHelper';
1616
import {Services} from '../services/debugAdapterServices';
1717
import {LoggerHandler, Handlers, Tags} from '../common/logger';
1818
import {DebugRequest} from './debugRequest';
19+
import * as kill from 'tree-kill';
1920

2021
interface IScopeVarHandle {
2122
objectId: string;
@@ -357,7 +358,7 @@ export class WebKitDebugAdapter implements DebugProtocol.IDebugAdapter {
357358
public disconnect(): Promise<void> {
358359
this.clearEverything();
359360
if (this._tnsProcess) {
360-
this._tnsProcess.kill('SIGQUIT');
361+
kill(this._tnsProcess.pid, 'SIGQUIT')
361362
this._tnsProcess = null;
362363
}
363364
if (this._webKitConnection) {

src/project/androidProject.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ export class AndroidProject extends Project {
4747
debugPort = parseInt((<string>match.matches[0]).match("(?:debug port: )([\\d]{5})")[1]);
4848
if (attach) {
4949
// wait a little before trying to connect, this gives a chance for adb to be able to connect to the debug socket
50-
setTimeout(() => { eventEmitter.emit('readyForConnection', debugPort); }, 500);
50+
setTimeout(() => { eventEmitter.emit('readyForConnection', debugPort); }, 1000);
5151
}
5252
});
5353
if (!attach) {
5454
new scanner.StringMatchingScanner(readableStream).onEveryMatch('# NativeScript Debugger started #', (match: scanner.MatchFound) => {
5555
// wait a little before trying to connect, this gives a chance for adb to be able to connect to the debug socket
56-
setTimeout(() => { eventEmitter.emit('readyForConnection', debugPort); }, 500);
56+
setTimeout(() => { eventEmitter.emit('readyForConnection', debugPort); }, 1000);
5757
});
5858
}
5959
}

0 commit comments

Comments
 (0)