1
0
mirror of https://git.tuxpa.in/a/code-server.git synced 2024-12-27 04:35:25 +00:00

Restore old folder query parameter behavior

Fixes #1351.
This commit is contained in:
Asher 2020-03-11 16:05:38 -05:00
parent 253cf1c438
commit 26647c54c9
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A

View File

@ -196,10 +196,39 @@ index 2c64061da7..c0ef8faedd 100644
// Do nothing. If we can't read the file we have no // Do nothing. If we can't read the file we have no
// language pack config. // language pack config.
diff --git a/src/vs/code/browser/workbench/workbench.ts b/src/vs/code/browser/workbench/workbench.ts diff --git a/src/vs/code/browser/workbench/workbench.ts b/src/vs/code/browser/workbench/workbench.ts
index a599f5a7eb..ec7ccd43f8 100644 index a599f5a7eb..d988288ffe 100644
--- a/src/vs/code/browser/workbench/workbench.ts --- a/src/vs/code/browser/workbench/workbench.ts
+++ b/src/vs/code/browser/workbench/workbench.ts +++ b/src/vs/code/browser/workbench/workbench.ts
@@ -298,35 +298,6 @@ class WorkspaceProvider implements IWorkspaceProvider { @@ -12,6 +12,7 @@ import { request } from 'vs/base/parts/request/browser/request';
import { isFolderToOpen, isWorkspaceToOpen } from 'vs/platform/windows/common/windows';
import { isEqual } from 'vs/base/common/resources';
import { isStandalone } from 'vs/base/browser/browser';
+import { Schemas } from 'vs/base/common/network';
interface ICredential {
service: string;
@@ -242,12 +243,18 @@ class WorkspaceProvider implements IWorkspaceProvider {
// Folder
else if (isFolderToOpen(workspace)) {
- targetHref = `${document.location.origin}${document.location.pathname}?${WorkspaceProvider.QUERY_PARAM_FOLDER}=${encodeURIComponent(workspace.folderUri.toString())}`;
+ const target = workspace.folderUri.scheme === Schemas.vscodeRemote
+ ? workspace.folderUri.path
+ : encodeURIComponent(workspace.folderUri.toString());
+ targetHref = `${document.location.origin}${document.location.pathname}?${WorkspaceProvider.QUERY_PARAM_FOLDER}=${target}`;
}
// Workspace
else if (isWorkspaceToOpen(workspace)) {
- targetHref = `${document.location.origin}${document.location.pathname}?${WorkspaceProvider.QUERY_PARAM_WORKSPACE}=${encodeURIComponent(workspace.workspaceUri.toString())}`;
+ const target = workspace.workspaceUri.scheme === Schemas.vscodeRemote
+ ? workspace.workspaceUri.path
+ : encodeURIComponent(workspace.workspaceUri.toString());
+ targetHref = `${document.location.origin}${document.location.pathname}?${WorkspaceProvider.QUERY_PARAM_WORKSPACE}=${target}`;
}
// Append payload if any
@@ -298,35 +305,6 @@ class WorkspaceProvider implements IWorkspaceProvider {
let workspace: IWorkspace; let workspace: IWorkspace;
let payload = Object.create(null); let payload = Object.create(null);