Skip to content

Commit 2d5f2a4

Browse files
committed
chore: format
1 parent 3675c61 commit 2d5f2a4

File tree

2 files changed

+71
-99
lines changed

2 files changed

+71
-99
lines changed

.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ coverage
77
build
88
dist
99
lib
10-
VenodrLib
10+
VendorLib

src/debugger/node/main.js

Lines changed: 70 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,167 +1,139 @@
1-
import type {
2-
AutoGenConfig,
3-
NuclideDebuggerProvider,
4-
} from '@atom-ide-community/nuclide-debugger-common/types';
5-
import * as React from 'react';
6-
import path from 'path';
7-
import {AutoGenLaunchAttachProvider} from '@atom-ide-community/nuclide-debugger-common/AutoGenLaunchAttachProvider';
1+
import type { AutoGenConfig, NuclideDebuggerProvider } from "@atom-ide-community/nuclide-debugger-common/types"
2+
import * as React from "react"
3+
import path from "path"
4+
import { AutoGenLaunchAttachProvider } from "@atom-ide-community/nuclide-debugger-common/AutoGenLaunchAttachProvider"
85

96
export function createNodeDebuggerProvider(): NuclideDebuggerProvider {
107
return {
11-
type: 'node',
12-
getLaunchAttachProvider: connection => {
13-
return new AutoGenLaunchAttachProvider(
14-
'Node',
15-
connection,
16-
getNodeConfig(),
17-
);
8+
type: "node",
9+
getLaunchAttachProvider: (connection) => {
10+
return new AutoGenLaunchAttachProvider("Node", connection, getNodeConfig())
1811
},
19-
};
12+
}
2013
}
2114

2215
function getNodeConfig(): AutoGenConfig {
2316
const program = {
24-
name: 'program',
25-
type: 'string',
26-
description: 'Absolute path to the program.',
17+
name: "program",
18+
type: "string",
19+
description: "Absolute path to the program.",
2720
required: true,
2821
visible: true,
29-
};
22+
}
3023
const cwd = {
31-
name: 'cwd',
32-
type: 'string',
33-
description:
34-
'Absolute path to the working directory of the program being debugged.',
24+
name: "cwd",
25+
type: "string",
26+
description: "Absolute path to the working directory of the program being debugged.",
3527
required: true,
3628
visible: true,
37-
};
29+
}
3830
const stopOnEntry = {
39-
name: 'stopOnEntry',
40-
type: 'boolean',
41-
description: 'Automatically stop program after launch.',
31+
name: "stopOnEntry",
32+
type: "boolean",
33+
description: "Automatically stop program after launch.",
4234
defaultValue: false,
4335
required: false,
4436
visible: true,
45-
};
37+
}
4638

4739
const args = {
48-
name: 'args',
49-
type: 'array',
50-
itemType: 'string',
51-
description: 'Command line arguments passed to the program.',
40+
name: "args",
41+
type: "array",
42+
itemType: "string",
43+
description: "Command line arguments passed to the program.",
5244
defaultValue: [],
5345
required: false,
5446
visible: true,
55-
};
47+
}
5648
const runtimeExecutable = {
57-
name: 'runtimeExecutable',
58-
type: 'string',
59-
description:
60-
'(Optional) Runtime to use, an absolute path or the name of a runtime available on PATH',
49+
name: "runtimeExecutable",
50+
type: "string",
51+
description: "(Optional) Runtime to use, an absolute path or the name of a runtime available on PATH",
6152
required: false,
6253
visible: true,
63-
};
54+
}
6455
const env = {
65-
name: 'env',
66-
type: 'object',
67-
description:
68-
'(Optional) Environment variables (e.g. SHELL=/bin/bash PATH=/bin)',
56+
name: "env",
57+
type: "object",
58+
description: "(Optional) Environment variables (e.g. SHELL=/bin/bash PATH=/bin)",
6959
defaultValue: {},
7060
required: false,
7161
visible: true,
72-
};
62+
}
7363
const outFiles = {
74-
name: 'outFiles',
75-
type: 'array',
76-
itemType: 'string',
77-
description:
78-
'(Optional) When source maps are enabled, these glob patterns specify the generated JavaScript files',
64+
name: "outFiles",
65+
type: "array",
66+
itemType: "string",
67+
description: "(Optional) When source maps are enabled, these glob patterns specify the generated JavaScript files",
7968
defaultValue: [],
8069
required: false,
8170
visible: true,
82-
};
71+
}
8372
const protocol = {
84-
name: 'protocol',
85-
type: 'string',
86-
description: '',
87-
defaultValue: 'inspector',
73+
name: "protocol",
74+
type: "string",
75+
description: "",
76+
defaultValue: "inspector",
8877
required: false,
8978
visible: false,
90-
};
79+
}
9180

9281
const consoleEnum = {
93-
name: 'console',
94-
type: 'enum',
95-
enums: ['internalConsole', 'integratedTerminal'],
82+
name: "console",
83+
type: "enum",
84+
enums: ["internalConsole", "integratedTerminal"],
9685
description:
97-
'Integrated Terminal means that it will run in a terminal that can interact with standard input and output.',
98-
defaultValue: 'internalConsole',
86+
"Integrated Terminal means that it will run in a terminal that can interact with standard input and output.",
87+
defaultValue: "internalConsole",
9988
required: true,
10089
visible: true,
101-
};
90+
}
10291

10392
const port = {
104-
name: 'port',
105-
type: 'number',
106-
description: 'Port',
93+
name: "port",
94+
type: "number",
95+
description: "Port",
10796
required: true,
10897
visible: true,
109-
};
98+
}
11099

111100
const adapterExecutable = {
112-
command: 'node',
113-
args: [
114-
path.resolve(path.join(__dirname, 'VendorLib/vscode-node-debug2/out/src/nodeDebug.js'))
115-
],
101+
command: "node",
102+
args: [path.resolve(path.join(__dirname, "VendorLib/vscode-node-debug2/out/src/nodeDebug.js"))],
116103
}
117-
const adapterRoot = path.resolve(path.join(__dirname, 'VendorLib/vscode-node-debug2'))
104+
const adapterRoot = path.resolve(path.join(__dirname, "VendorLib/vscode-node-debug2"))
118105

119106
return {
120107
launch: {
121108
launch: true,
122-
vsAdapterType: 'node',
109+
vsAdapterType: "node",
123110
adapterExecutable,
124111
adapterRoot,
125-
properties: [
126-
program,
127-
cwd,
128-
stopOnEntry,
129-
args,
130-
runtimeExecutable,
131-
env,
132-
outFiles,
133-
protocol,
134-
consoleEnum,
135-
],
136-
scriptPropertyName: 'program',
137-
cwdPropertyName: 'cwd',
138-
scriptExtension: '.js',
139-
header: (
140-
<p>This is intended to debug node.js files (for node version 6.3+).</p>
141-
),
112+
properties: [program, cwd, stopOnEntry, args, runtimeExecutable, env, outFiles, protocol, consoleEnum],
113+
scriptPropertyName: "program",
114+
cwdPropertyName: "cwd",
115+
scriptExtension: ".js",
116+
header: <p>This is intended to debug node.js files (for node version 6.3+).</p>,
142117
getProcessName(values) {
143-
let processName = values.program;
144-
const lastSlash = processName.lastIndexOf('/');
118+
let processName = values.program
119+
const lastSlash = processName.lastIndexOf("/")
145120
if (lastSlash >= 0) {
146-
processName = processName.substring(
147-
lastSlash + 1,
148-
processName.length,
149-
);
121+
processName = processName.substring(lastSlash + 1, processName.length)
150122
}
151-
return processName + ' (Node)';
123+
return processName + " (Node)"
152124
},
153125
},
154126
attach: {
155127
launch: false,
156-
vsAdapterType: 'node',
128+
vsAdapterType: "node",
157129
adapterExecutable,
158130
adapterRoot,
159131
properties: [port],
160-
scriptExtension: '.js',
132+
scriptExtension: ".js",
161133
header: <p>Attach to a running node.js process</p>,
162134
getProcessName(values) {
163-
return 'Port: ' + values.port + ' (Node attach)';
135+
return "Port: " + values.port + " (Node attach)"
164136
},
165137
},
166-
};
138+
}
167139
}

0 commit comments

Comments
 (0)