Skip to content

Commit 1ec44c3

Browse files
committed
Already not depending on args.cwd to be passed to the debug adapter by VS Code
1 parent ef1eb8e commit 1ec44c3

File tree

3 files changed

+9
-21
lines changed

3 files changed

+9
-21
lines changed

package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"type": "nativescript",
8888
"platform": "ios",
8989
"request": "launch",
90-
"appRoot": ".",
90+
"appRoot": "${workspaceRoot}",
9191
"sourceMaps": true,
9292
"diagnosticLogging": false,
9393
"emulator": false
@@ -97,7 +97,7 @@
9797
"type": "nativescript",
9898
"platform": "ios",
9999
"request": "attach",
100-
"appRoot": ".",
100+
"appRoot": "${workspaceRoot}",
101101
"sourceMaps": true,
102102
"diagnosticLogging": false,
103103
"emulator": false
@@ -107,7 +107,7 @@
107107
"type": "nativescript",
108108
"platform": "ios",
109109
"request": "launch",
110-
"appRoot": ".",
110+
"appRoot": "${workspaceRoot}",
111111
"sourceMaps": true,
112112
"diagnosticLogging": false,
113113
"emulator": true
@@ -117,7 +117,7 @@
117117
"type": "nativescript",
118118
"platform": "ios",
119119
"request": "attach",
120-
"appRoot": ".",
120+
"appRoot": "${workspaceRoot}",
121121
"sourceMaps": true,
122122
"diagnosticLogging": false,
123123
"emulator": true
@@ -127,7 +127,7 @@
127127
"type": "nativescript",
128128
"platform": "android",
129129
"request": "launch",
130-
"appRoot": ".",
130+
"appRoot": "${workspaceRoot}",
131131
"sourceMaps": true,
132132
"diagnosticLogging": false,
133133
"emulator": false
@@ -137,7 +137,7 @@
137137
"type": "nativescript",
138138
"platform": "android",
139139
"request": "launch",
140-
"appRoot": ".",
140+
"appRoot": "${workspaceRoot}",
141141
"sourceMaps": true,
142142
"diagnosticLogging": false,
143143
"emulator": true
@@ -147,7 +147,7 @@
147147
"type": "nativescript",
148148
"platform": "android",
149149
"request": "attach",
150-
"appRoot": ".",
150+
"appRoot": "${workspaceRoot}",
151151
"sourceMaps": false,
152152
"diagnosticLogging": false,
153153
"emulator": false
@@ -157,7 +157,7 @@
157157
"type": "nativescript",
158158
"platform": "android",
159159
"request": "attach",
160-
"appRoot": ".",
160+
"appRoot": "${workspaceRoot}",
161161
"sourceMaps": false,
162162
"diagnosticLogging": false,
163163
"emulator": true

webkit/utilities.ts

+1-11
Original file line numberDiff line numberDiff line change
@@ -399,17 +399,7 @@ export function errP(msg: any): Promise<any> {
399399
* Calculates the appRoot from a launch/attach request. The appRoot is the root directory of the NativeScript app.
400400
*/
401401
export function getAppRoot(args: ILaunchRequestArgs | IAttachRequestArgs): string {
402-
let appRoot: string;
403-
if (args.appRoot) {
404-
appRoot = args.appRoot;
405-
if (!path.isAbsolute(appRoot)) {
406-
appRoot = path.resolve(args.cwd, appRoot);
407-
}
408-
} else {
409-
appRoot = args.cwd;
410-
}
411-
412-
return appRoot;
402+
return (args.appRoot && path.isAbsolute(args.appRoot)) ? args.appRoot : '';
413403
}
414404

415405
/**

webkit/webKitAdapterInterfaces.d.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {DebugProtocol} from 'vscode-debugprotocol';
22

33
export interface ILaunchRequestArgs extends DebugProtocol.LaunchRequestArguments {
4-
cwd: string; /* Automatically set by VS Code to the currently opened folder */
54
platform: string;
65
appRoot?: string;
76
runtimeArgs?: string[];
@@ -15,7 +14,6 @@ export interface ILaunchRequestArgs extends DebugProtocol.LaunchRequestArguments
1514
}
1615

1716
export interface IAttachRequestArgs extends DebugProtocol.AttachRequestArguments {
18-
cwd: string; /* Automatically set by VS Code to the currently opened folder */
1917
platform: string;
2018
appRoot?: string;
2119
sourceMaps?: boolean;

0 commit comments

Comments
 (0)