Skip to content

Commit 8cc94b6

Browse files
Copilotgarrytrinder
andcommitted
Remove config picker, use active config file like existing start command
Co-authored-by: garrytrinder <11563347+garrytrinder@users.noreply.github.com>
1 parent 3799c1c commit 8cc94b6

1 file changed

Lines changed: 15 additions & 34 deletions

File tree

src/commands/proxy.ts

Lines changed: 15 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -59,33 +59,14 @@ async function startDevProxy(
5959
async function startDevProxyWithOptions(devProxyExe: string): Promise<void> {
6060
const args: string[] = [];
6161

62-
// Config file
63-
const configFiles = await vscode.workspace.findFiles(
64-
'**/devproxyrc.{json,jsonc}',
65-
'**/node_modules/**'
66-
);
67-
const configItems: vscode.QuickPickItem[] = [
68-
{ label: '$(remove) None', description: 'Use default configuration' },
69-
...configFiles.map(f => ({
70-
label: vscode.workspace.asRelativePath(f),
71-
description: f.fsPath,
72-
})),
73-
];
74-
75-
const selectedConfig = await vscode.window.showQuickPick(configItems, {
76-
title: 'Start with Options (1/13): Config file',
77-
placeHolder: 'Select a config file',
78-
});
79-
if (selectedConfig === undefined) {
80-
return;
81-
}
82-
if (selectedConfig.description && selectedConfig.description !== 'Use default configuration') {
83-
args.push('--config-file', `"${selectedConfig.description}"`);
62+
const configFilePath = getActiveConfigFilePath();
63+
if (configFilePath) {
64+
args.push('--config-file', `"${configFilePath}"`);
8465
}
8566

8667
// Port
8768
const port = await vscode.window.showInputBox({
88-
title: 'Start with Options (2/13): Port',
69+
title: 'Start with Options (1/12): Port',
8970
prompt: 'Enter the proxy port number',
9071
value: '8000',
9172
validateInput: validatePortNumber,
@@ -99,7 +80,7 @@ async function startDevProxyWithOptions(devProxyExe: string): Promise<void> {
9980

10081
// API port
10182
const apiPort = await vscode.window.showInputBox({
102-
title: 'Start with Options (3/13): API port',
83+
title: 'Start with Options (2/12): API port',
10384
prompt: 'Enter the API port number',
10485
value: '8897',
10586
validateInput: validatePortNumber,
@@ -113,7 +94,7 @@ async function startDevProxyWithOptions(devProxyExe: string): Promise<void> {
11394

11495
// IP address
11596
const ipAddress = await vscode.window.showInputBox({
116-
title: 'Start with Options (4/13): IP address',
97+
title: 'Start with Options (3/12): IP address',
11798
prompt: 'Enter the IP address to listen on',
11899
value: '127.0.0.1',
119100
validateInput: validateIpAddress,
@@ -132,7 +113,7 @@ async function startDevProxyWithOptions(devProxyExe: string): Promise<void> {
132113
{ label: 'No', description: 'Do not register as system proxy' },
133114
],
134115
{
135-
title: 'Start with Options (5/13): As system proxy',
116+
title: 'Start with Options (4/12): As system proxy',
136117
placeHolder: 'Register Dev Proxy as a system proxy?',
137118
}
138119
);
@@ -150,7 +131,7 @@ async function startDevProxyWithOptions(devProxyExe: string): Promise<void> {
150131
{ label: 'No', description: 'Do not install certificate' },
151132
],
152133
{
153-
title: 'Start with Options (6/13): Install certificate',
134+
title: 'Start with Options (5/12): Install certificate',
154135
placeHolder: 'Install the root certificate?',
155136
}
156137
);
@@ -165,7 +146,7 @@ async function startDevProxyWithOptions(devProxyExe: string): Promise<void> {
165146
const logLevel = await vscode.window.showQuickPick(
166147
['trace', 'debug', 'information', 'warning', 'error'],
167148
{
168-
title: 'Start with Options (7/13): Log level',
149+
title: 'Start with Options (6/12): Log level',
169150
placeHolder: 'Select a log level',
170151
}
171152
);
@@ -178,7 +159,7 @@ async function startDevProxyWithOptions(devProxyExe: string): Promise<void> {
178159

179160
// Failure rate
180161
const failureRate = await vscode.window.showInputBox({
181-
title: 'Start with Options (8/13): Failure rate',
162+
title: 'Start with Options (7/12): Failure rate',
182163
prompt: 'Enter the failure rate (0-100)',
183164
value: '50',
184165
validateInput: validateFailureRate,
@@ -192,7 +173,7 @@ async function startDevProxyWithOptions(devProxyExe: string): Promise<void> {
192173

193174
// URLs to watch
194175
const urlsToWatch = await vscode.window.showInputBox({
195-
title: 'Start with Options (9/13): URLs to watch',
176+
title: 'Start with Options (8/12): URLs to watch',
196177
prompt: 'Enter URLs to watch (space separated). Leave empty to use config file values.',
197178
placeHolder: 'https://api.example.com/* https://graph.microsoft.com/v1.0/*',
198179
value: '',
@@ -211,7 +192,7 @@ async function startDevProxyWithOptions(devProxyExe: string): Promise<void> {
211192
{ label: 'Yes', description: 'Start recording immediately' },
212193
],
213194
{
214-
title: 'Start with Options (10/13): Record',
195+
title: 'Start with Options (9/12): Record',
215196
placeHolder: 'Start recording on launch?',
216197
}
217198
);
@@ -229,7 +210,7 @@ async function startDevProxyWithOptions(devProxyExe: string): Promise<void> {
229210
{ label: 'Yes', description: 'Skip first run experience' },
230211
],
231212
{
232-
title: 'Start with Options (11/13): No first run',
213+
title: 'Start with Options (10/12): No first run',
233214
placeHolder: 'Skip the first run experience?',
234215
}
235216
);
@@ -242,7 +223,7 @@ async function startDevProxyWithOptions(devProxyExe: string): Promise<void> {
242223

243224
// Timeout
244225
const timeout = await vscode.window.showInputBox({
245-
title: 'Start with Options (12/13): Timeout',
226+
title: 'Start with Options (11/12): Timeout',
246227
prompt: 'Enter timeout in seconds. Leave empty for no timeout.',
247228
value: '',
248229
validateInput: validateTimeout,
@@ -256,7 +237,7 @@ async function startDevProxyWithOptions(devProxyExe: string): Promise<void> {
256237

257238
// Watch PIDs
258239
const watchPids = await vscode.window.showInputBox({
259-
title: 'Start with Options (13/13): Watch PIDs',
240+
title: 'Start with Options (12/12): Watch PIDs',
260241
prompt: 'Enter process IDs to watch (space separated). Leave empty to skip.',
261242
placeHolder: '1234 5678',
262243
value: '',

0 commit comments

Comments
 (0)