Skip to content

Commit 6e3efa9

Browse files
authored
Merge branch 'microsoft:main' into simple-dialog-current-directory
2 parents 9dd4c4b + f20fe4d commit 6e3efa9

File tree

5 files changed

+14
-9
lines changed

5 files changed

+14
-9
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@echo off
22
setlocal
33
SET VSCODE_PATH=%~dp0..\..\..\..
4+
SET VSCODE_DEV=1
45
FOR /F "tokens=* USEBACKQ" %%g IN (`where /r "%VSCODE_PATH%\.build\node" node.exe`) do (SET "NODE=%%g")
56
call "%NODE%" "%VSCODE_PATH%\out\server-cli.js" "Code Server - Dev" "" "" "code.cmd" %*
67
endlocal

resources/server/bin-dev/remote-cli/code.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ else
1010
VSCODE_PATH=$(dirname $(dirname $(dirname $(dirname $(dirname $(readlink -f $0))))))
1111
fi
1212

13+
export VSCODE_DEV=1
14+
1315
PROD_NAME="Code Server - Dev"
1416
VERSION=""
1517
COMMIT=""

src/server-cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ if (process.env['VSCODE_DEV']) {
3030
await bootstrapESM();
3131

3232
// Load Server
33-
await import('./vs/server/node/server.cli');
33+
await import('./vs/server/node/server.cli.js');

src/vs/server/node/server.cli.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export async function main(desc: ProductDescription, args: string[]): Promise<vo
154154
}
155155
if (cliPipe) {
156156
if (parsedArgs['openExternal']) {
157-
openInBrowser(parsedArgs['_'], verbose);
157+
await openInBrowser(parsedArgs['_'], verbose);
158158
return;
159159
}
160160
}
@@ -294,7 +294,7 @@ export async function main(desc: ProductDescription, args: string[]): Promise<vo
294294
}
295295
} else {
296296
if (parsedArgs.status) {
297-
sendToPipe({
297+
await sendToPipe({
298298
type: 'status'
299299
}, verbose).then((res: string) => {
300300
console.log(res);
@@ -305,7 +305,7 @@ export async function main(desc: ProductDescription, args: string[]): Promise<vo
305305
}
306306

307307
if (parsedArgs['install-extension'] !== undefined || parsedArgs['uninstall-extension'] !== undefined || parsedArgs['list-extensions'] || parsedArgs['update-extensions']) {
308-
sendToPipe({
308+
await sendToPipe({
309309
type: 'extensionManagement',
310310
list: parsedArgs['list-extensions'] ? { showVersions: parsedArgs['show-versions'], category: parsedArgs['category'] } : undefined,
311311
install: asExtensionIdOrVSIX(parsedArgs['install-extension']),
@@ -328,7 +328,7 @@ export async function main(desc: ProductDescription, args: string[]): Promise<vo
328328
waitMarkerFilePath = createWaitMarkerFileSync(verbose);
329329
}
330330

331-
sendToPipe({
331+
await sendToPipe({
332332
type: 'open',
333333
fileURIs,
334334
folderURIs,
@@ -345,7 +345,7 @@ export async function main(desc: ProductDescription, args: string[]): Promise<vo
345345
});
346346

347347
if (waitMarkerFilePath) {
348-
waitForFileDeleted(waitMarkerFilePath);
348+
await waitForFileDeleted(waitMarkerFilePath);
349349
}
350350

351351
if (readFromStdinPromise) {
@@ -371,7 +371,7 @@ async function waitForFileDeleted(path: string) {
371371
}
372372
}
373373

374-
function openInBrowser(args: string[], verbose: boolean) {
374+
async function openInBrowser(args: string[], verbose: boolean) {
375375
const uris: string[] = [];
376376
for (const location of args) {
377377
try {
@@ -385,7 +385,7 @@ function openInBrowser(args: string[], verbose: boolean) {
385385
}
386386
}
387387
if (uris.length) {
388-
sendToPipe({
388+
await sendToPipe({
389389
type: 'openExternal',
390390
uris
391391
}, verbose).catch(e => {

src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,8 @@ export class SimpleFileDialog extends Disposable implements ISimpleFileDialog {
862862
private async updateItems(newFolder: URI, force: boolean = false, trailing?: string): Promise<boolean> {
863863
this.busy = true;
864864
this.autoCompletePathSegment = '';
865+
const wasDotDot = trailing === '..';
866+
trailing = wasDotDot ? undefined : trailing;
865867
const isSave = !!trailing;
866868
let result = false;
867869

@@ -892,7 +894,7 @@ export class SimpleFileDialog extends Disposable implements ISimpleFileDialog {
892894
this.filePickBox.items = items;
893895

894896
// the user might have continued typing while we were updating. Only update the input box if it doesn't match the directory.
895-
if (!equalsIgnoreCase(this.filePickBox.value, newValue) && force) {
897+
if (!equalsIgnoreCase(this.filePickBox.value, newValue) && (force || wasDotDot)) {
896898
this.filePickBox.valueSelection = [0, this.filePickBox.value.length];
897899
this.insertText(newValue, newValue);
898900
}

0 commit comments

Comments
 (0)