Archived
1
0

Document workspace and folder behavior

Also fixed a type issue.
This commit is contained in:
Asher 2020-04-07 17:49:50 -05:00
parent a5c35af81b
commit 3b39482420
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A
2 changed files with 13 additions and 4 deletions

View File

@ -261,7 +261,7 @@ index 2c64061da7..c0ef8faedd 100644
// Do nothing. If we can't read the file we have no
// language pack config.
diff --git a/src/vs/code/browser/workbench/workbench.ts b/src/vs/code/browser/workbench/workbench.ts
index 45f6f17ce0..102289c147 100644
index 45f6f17ce0..546b4c24de 100644
--- a/src/vs/code/browser/workbench/workbench.ts
+++ b/src/vs/code/browser/workbench/workbench.ts
@@ -16,6 +16,7 @@ import product from 'vs/platform/product/common/product';
@ -306,14 +306,14 @@ index 45f6f17ce0..102289c147 100644
const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents, workspaceUri?: UriComponents } = JSON.parse(configElementAttribute);
+ // Strip the protocol from the authority if it exists.
+ const normalizeAuthority = (authority?: string): string => authority && authority.replace(/^https?:\/\//, "");
+ const normalizeAuthority = (authority: string): string => authority.replace(/^https?:\/\//, "");
+ if (config.remoteAuthority) {
+ (config as any).remoteAuthority = normalizeAuthority(config.remoteAuthority);
+ }
+ if (config.workspaceUri) {
+ if (config.workspaceUri && config.workspaceUri.authority) {
+ config.workspaceUri.authority = normalizeAuthority(config.workspaceUri.authority);
+ }
+ if (config.folderUri) {
+ if (config.folderUri && config.folderUri.authority) {
+ config.folderUri.authority = normalizeAuthority(config.folderUri.authority);
+ }
+

View File

@ -104,6 +104,15 @@ demand and will work on it when the time is right.
Use the `--disable-telemetry` flag to completely disable telemetry. We use the
data collected only to improve code-server.
## How does code-server decide what workspace or folder to open?
code-server tries the following in order:
1. The `workspace` query parameter.
2. The `folder` query parameter.
3. The directory passed on the command line.
4. The last opened workspace or folder.
## Enterprise
Visit [our enterprise page](https://coder.com) for more information about our