Skip to content

Commit 3b39482

Browse files
committed
Document workspace and folder behavior
Also fixed a type issue.
1 parent a5c35af commit 3b39482

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

ci/vscode.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ index 2c64061da7..c0ef8faedd 100644
261261
// Do nothing. If we can't read the file we have no
262262
// language pack config.
263263
diff --git a/src/vs/code/browser/workbench/workbench.ts b/src/vs/code/browser/workbench/workbench.ts
264-
index 45f6f17ce0..102289c147 100644
264+
index 45f6f17ce0..546b4c24de 100644
265265
--- a/src/vs/code/browser/workbench/workbench.ts
266266
+++ b/src/vs/code/browser/workbench/workbench.ts
267267
@@ -16,6 +16,7 @@ import product from 'vs/platform/product/common/product';
@@ -306,14 +306,14 @@ index 45f6f17ce0..102289c147 100644
306306
const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents, workspaceUri?: UriComponents } = JSON.parse(configElementAttribute);
307307

308308
+ // Strip the protocol from the authority if it exists.
309-
+ const normalizeAuthority = (authority?: string): string => authority && authority.replace(/^https?:\/\//, "");
309+
+ const normalizeAuthority = (authority: string): string => authority.replace(/^https?:\/\//, "");
310310
+ if (config.remoteAuthority) {
311311
+ (config as any).remoteAuthority = normalizeAuthority(config.remoteAuthority);
312312
+ }
313-
+ if (config.workspaceUri) {
313+
+ if (config.workspaceUri && config.workspaceUri.authority) {
314314
+ config.workspaceUri.authority = normalizeAuthority(config.workspaceUri.authority);
315315
+ }
316-
+ if (config.folderUri) {
316+
+ if (config.folderUri && config.folderUri.authority) {
317317
+ config.folderUri.authority = normalizeAuthority(config.folderUri.authority);
318318
+ }
319319
+

doc/FAQ.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ demand and will work on it when the time is right.
104104
Use the `--disable-telemetry` flag to completely disable telemetry. We use the
105105
data collected only to improve code-server.
106106

107+
## How does code-server decide what workspace or folder to open?
108+
109+
code-server tries the following in order:
110+
111+
1. The `workspace` query parameter.
112+
2. The `folder` query parameter.
113+
3. The directory passed on the command line.
114+
4. The last opened workspace or folder.
115+
107116
## Enterprise
108117

109118
Visit [our enterprise page](https://coder.com) for more information about our

0 commit comments

Comments
 (0)