@lvce-editor/quick-pick-worker 4.22.2 → 4.22.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/quickPickWorkerMain.js +21 -22
- package/package.json +1 -1
|
@@ -3419,6 +3419,10 @@ const decodePath = path => {
|
|
|
3419
3419
|
const getRemoteSshPathStart = uri => {
|
|
3420
3420
|
return uri.indexOf('/', remoteSshScheme.length);
|
|
3421
3421
|
};
|
|
3422
|
+
const getRemoteSshAuthority = uri => {
|
|
3423
|
+
const pathStart = getRemoteSshPathStart(uri);
|
|
3424
|
+
return uri.slice(remoteSshScheme.length, pathStart === -1 ? uri.length : pathStart);
|
|
3425
|
+
};
|
|
3422
3426
|
const getPath = uri => {
|
|
3423
3427
|
if (uri.startsWith(fileScheme)) {
|
|
3424
3428
|
return decodePath(uri.slice(fileScheme.length));
|
|
@@ -3437,37 +3441,32 @@ const getPath = uri => {
|
|
|
3437
3441
|
}
|
|
3438
3442
|
return uri;
|
|
3439
3443
|
};
|
|
3440
|
-
const
|
|
3444
|
+
const toProtoVisibleItem = uri => {
|
|
3441
3445
|
const path = getPath(uri);
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
}
|
|
3446
|
+
const isRemoteSsh = uri.startsWith(remoteSshScheme);
|
|
3447
|
+
const authority = isRemoteSsh ? getRemoteSshAuthority(uri) : '';
|
|
3448
|
+
let folderName = path;
|
|
3446
3449
|
if (path.startsWith('/')) {
|
|
3447
|
-
|
|
3450
|
+
folderName = pathBaseName(path);
|
|
3448
3451
|
}
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3452
|
+
if (path === '/' && isRemoteSsh) {
|
|
3453
|
+
folderName = authority;
|
|
3454
|
+
}
|
|
3455
|
+
let description = '';
|
|
3453
3456
|
if (path.startsWith('/')) {
|
|
3454
|
-
|
|
3455
|
-
if (uri.startsWith(remoteSshScheme)) {
|
|
3456
|
-
const pathStart = getRemoteSshPathStart(uri);
|
|
3457
|
-
const authority = pathStart === -1 ? uri : uri.slice(0, pathStart);
|
|
3458
|
-
return `${authority}${path === '/' ? '/' : directory}`;
|
|
3459
|
-
}
|
|
3460
|
-
return directory;
|
|
3457
|
+
description = pathDirName(path);
|
|
3461
3458
|
}
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3459
|
+
if (path === '/' && isRemoteSsh) {
|
|
3460
|
+
description = '/';
|
|
3461
|
+
}
|
|
3462
|
+
const label = isRemoteSsh ? `${folderName} [SSH: ${authority}]` : folderName;
|
|
3465
3463
|
return {
|
|
3466
|
-
description
|
|
3464
|
+
description,
|
|
3467
3465
|
direntType: Directory,
|
|
3468
3466
|
fileIcon: '',
|
|
3469
3467
|
icon: '',
|
|
3470
|
-
|
|
3468
|
+
iconName: isRemoteSsh ? folderName : undefined,
|
|
3469
|
+
label,
|
|
3471
3470
|
matches: [],
|
|
3472
3471
|
uri
|
|
3473
3472
|
};
|