Skip to content

Commit cd1a68d

Browse files
committed
Cleanup the default debug configurations. Remove emulator option. Don't pass --debug-brk by default.
1 parent 8afc419 commit cd1a68d

File tree

3 files changed

+22
-56
lines changed

3 files changed

+22
-56
lines changed

package.json

Lines changed: 17 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -111,81 +111,58 @@
111111
{
112112
"name": "Sync on iOS",
113113
"type": "nativescript",
114-
"platform": "ios",
115114
"request": "launch",
115+
"platform": "ios",
116116
"appRoot": "${workspaceRoot}",
117-
"sourceMaps": true,
118-
"diagnosticLogging": false,
119-
"emulator": false,
120-
"rebuild": false,
121-
"syncAllFiles": false
117+
"sourceMaps": true
122118
},
123119
{
124120
"name": "Launch on iOS",
125121
"type": "nativescript",
126-
"platform": "ios",
127122
"request": "launch",
123+
"platform": "ios",
128124
"appRoot": "${workspaceRoot}",
129125
"sourceMaps": true,
130-
"diagnosticLogging": false,
131-
"emulator": false,
132126
"rebuild": true
133127
},
134128
{
135129
"name": "Attach on iOS",
136130
"type": "nativescript",
137-
"platform": "ios",
138131
"request": "attach",
132+
"platform": "ios",
139133
"appRoot": "${workspaceRoot}",
140-
"sourceMaps": true,
141-
"diagnosticLogging": false,
142-
"emulator": false
134+
"sourceMaps": true
143135
},
144136
{
145137
"name": "Sync on Android",
146138
"type": "nativescript",
147-
"platform": "android",
148139
"request": "launch",
140+
"platform": "android",
149141
"appRoot": "${workspaceRoot}",
150-
"sourceMaps": true,
151-
"diagnosticLogging": false,
152-
"emulator": false,
153-
"rebuild": false
142+
"sourceMaps": true
154143
},
155144
{
156145
"name": "Launch on Android",
157146
"type": "nativescript",
158-
"platform": "android",
159147
"request": "launch",
148+
"platform": "android",
160149
"appRoot": "${workspaceRoot}",
161150
"sourceMaps": true,
162-
"diagnosticLogging": false,
163-
"emulator": false,
164151
"rebuild": true
165152
},
166153
{
167154
"name": "Attach on Android",
168155
"type": "nativescript",
169-
"platform": "android",
170156
"request": "attach",
157+
"platform": "android",
171158
"appRoot": "${workspaceRoot}",
172-
"sourceMaps": true,
173-
"diagnosticLogging": false,
174-
"emulator": false
159+
"sourceMaps": true
175160
}
176161
],
177162
"configurationAttributes": {
178163
"launch": {
179164
"required": [],
180165
"properties": {
181-
"runtimeArgs": {
182-
"type": "array",
183-
"description": "Optional arguments passed to the runtime executable.",
184-
"items": {
185-
"type": "string"
186-
},
187-
"default": []
188-
},
189166
"tnsArgs": {
190167
"type": "array",
191168
"description": "Optional arguments passed to the NativeScript CLI executable.",
@@ -219,9 +196,14 @@
219196
"description": "NativeScript platform",
220197
"default": null
221198
},
222-
"emulator": {
199+
"stopOnEntry": {
223200
"type": "boolean",
224-
"description": "Whether the app to run in emulator or on a physical device.",
201+
"description": "Automatically stop on the first line after lauch",
202+
"default": false
203+
},
204+
"noDebug": {
205+
"type": "boolean",
206+
"description": "If true the launch request will launch the program without enabling debugging",
225207
"default": false
226208
},
227209
"rebuild": {
@@ -244,14 +226,6 @@
244226
"attach": {
245227
"required": [],
246228
"properties": {
247-
"runtimeArgs": {
248-
"type": "array",
249-
"description": "Optional arguments passed to the runtime executable.",
250-
"items": {
251-
"type": "string"
252-
},
253-
"default": []
254-
},
255229
"tnsArgs": {
256230
"type": "array",
257231
"description": "Optional arguments passed to the NativeScript CLI executable.",
@@ -285,11 +259,6 @@
285259
"description": "NativeScript platform",
286260
"default": null
287261
},
288-
"emulator": {
289-
"type": "boolean",
290-
"description": "Whether the app to run in emulator or on a physical device.",
291-
"default": false
292-
},
293262
"nativescriptCliPath": {
294263
"type": "string",
295264
"description": "Path to the nativescript CLI to be used by the NativeScript extension.",

src/custom-typings/debugProtocolExtensions.d.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import {DebugProtocol} from 'vscode-debugprotocol';
22

33
declare module 'vscode-debugprotocol' {
44
namespace DebugProtocol {
5+
6+
type RequestArguments = LaunchRequestArguments | AttachRequestArguments;
7+
58
interface ILaunchRequestArgs extends DebugProtocol.LaunchRequestArguments {
69
platform: string;
710
appRoot?: string;
8-
runtimeArgs?: string[];
9-
runtimeExecutable?: string;
1011
stopOnEntry?: boolean;
1112
sourceMaps?: boolean;
1213
diagnosticLogging?: boolean;
13-
emulator?:boolean;
1414
request: string;
1515
tnsArgs?: string[];
1616
tnsOutput?: string;
@@ -24,7 +24,6 @@ declare module 'vscode-debugprotocol' {
2424
appRoot?: string;
2525
sourceMaps?: boolean;
2626
diagnosticLogging?: boolean;
27-
emulator?:boolean;
2827
request: string;
2928
tnsArgs?: string[];
3029
tnsOutput?: string;

src/services/NsCliService.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,8 @@ export class IosProject extends NSProject {
133133
let command = new CommandBuilder(args.nativescriptCliPath)
134134
.appendParam("debug")
135135
.appendParam(this.platform())
136-
.appendParamIf("--emulator", args.emulator)
137136
.appendParamIf("--start", args.request === "attach")
138-
.appendParamIf("--debug-brk", args.request === "launch")
137+
.appendParamIf("--debug-brk", args.request === "launch" && (args as DebugProtocol.ILaunchRequestArgs).stopOnEntry)
139138
.appendParamIf("--no-rebuild", !rebuild)
140139
.appendParamIf("--syncAllFiles", args.request === "launch" && !rebuild && (args as DebugProtocol.ILaunchRequestArgs).syncAllFiles)
141140
.appendParam("--no-client")
@@ -225,9 +224,8 @@ export class AndroidProject extends NSProject {
225224
let command = new CommandBuilder(args.nativescriptCliPath)
226225
.appendParam("debug")
227226
.appendParam(this.platform())
228-
.appendParamIf("--emulator", args.emulator)
229227
.appendParamIf("--no-rebuild", args.rebuild !== true)
230-
.appendParam("--debug-brk")
228+
.appendParamIf("--debug-brk", args.stopOnEntry)
231229
.appendParam("--no-client")
232230
.appendParams(args.tnsArgs)
233231
.build();

0 commit comments

Comments
 (0)