@lvce-editor/quick-pick-worker 4.19.0 → 4.19.2
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 +26 -8
- package/package.json +1 -1
|
@@ -3351,13 +3351,26 @@ const getRecentlyOpened = async () => {
|
|
|
3351
3351
|
return uniq(recentlyOpened);
|
|
3352
3352
|
};
|
|
3353
3353
|
|
|
3354
|
+
const fileScheme = 'file://';
|
|
3355
|
+
const remoteSshScheme = 'remote-ssh://';
|
|
3356
|
+
const decodePath = path => {
|
|
3357
|
+
try {
|
|
3358
|
+
return decodeURIComponent(path);
|
|
3359
|
+
} catch {
|
|
3360
|
+
return path;
|
|
3361
|
+
}
|
|
3362
|
+
};
|
|
3363
|
+
const getRemoteSshPathStart = uri => {
|
|
3364
|
+
return uri.indexOf('/', remoteSshScheme.length);
|
|
3365
|
+
};
|
|
3354
3366
|
const getPath = uri => {
|
|
3355
|
-
if (uri.startsWith(
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3367
|
+
if (uri.startsWith(fileScheme)) {
|
|
3368
|
+
return decodePath(uri.slice(fileScheme.length));
|
|
3369
|
+
}
|
|
3370
|
+
if (uri.startsWith(remoteSshScheme)) {
|
|
3371
|
+
const pathStart = getRemoteSshPathStart(uri);
|
|
3372
|
+
if (pathStart !== -1) {
|
|
3373
|
+
return decodePath(uri.slice(pathStart));
|
|
3361
3374
|
}
|
|
3362
3375
|
}
|
|
3363
3376
|
return uri;
|
|
@@ -3372,7 +3385,12 @@ const getLabel = uri => {
|
|
|
3372
3385
|
const getDescription = uri => {
|
|
3373
3386
|
const path = getPath(uri);
|
|
3374
3387
|
if (path.startsWith('/')) {
|
|
3375
|
-
|
|
3388
|
+
const directory = pathDirName(path);
|
|
3389
|
+
if (uri.startsWith(remoteSshScheme)) {
|
|
3390
|
+
const pathStart = getRemoteSshPathStart(uri);
|
|
3391
|
+
return `${uri.slice(0, pathStart)}${directory}`;
|
|
3392
|
+
}
|
|
3393
|
+
return directory;
|
|
3376
3394
|
}
|
|
3377
3395
|
return '';
|
|
3378
3396
|
};
|
|
@@ -4090,7 +4108,7 @@ const shouldCloseBeforeSelect = (subId, pick) => {
|
|
|
4090
4108
|
const {
|
|
4091
4109
|
id
|
|
4092
4110
|
} = pick;
|
|
4093
|
-
return typeof id === 'string' && id.startsWith('ext.');
|
|
4111
|
+
return typeof id === 'string' && (id.startsWith('ext.') || id === 'Main.openKeyBindings');
|
|
4094
4112
|
};
|
|
4095
4113
|
const selectIndex = async (state, index, button = /* left */0) => {
|
|
4096
4114
|
const {
|