Skip to content

Commit 509adf9

Browse files
authored
Merge branch 'main' into patch-2
2 parents 593018e + c77999b commit 509adf9

File tree

13 files changed

+121
-67
lines changed

13 files changed

+121
-67
lines changed

ci/helm-chart/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ version: 1.0.5
2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
23-
appVersion: 3.12.0
23+
appVersion: 4.0.0

ci/helm-chart/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ replicaCount: 1
66

77
image:
88
repository: codercom/code-server
9-
tag: '3.12.0'
9+
tag: '4.0.0'
1010
pullPolicy: Always
1111

1212
imagePullSecrets: []

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# code-server
22

3-
[!["GitHub Discussions"](https://img.shields.io/badge/%20GitHub-%20Discussions-gray.svg?longCache=true&logo=github&colorB=purple)](https://github.com/cdr/code-server/discussions) [!["Join us on Slack"](https://img.shields.io/badge/join-us%20on%20slack-gray.svg?longCache=true&logo=slack&colorB=brightgreen)](https://cdr.co/join-community) [![Twitter Follow](https://img.shields.io/twitter/follow/CoderHQ?label=%40CoderHQ&style=social)](https://twitter.com/coderhq) [![codecov](https://codecov.io/gh/cdr/code-server/branch/main/graph/badge.svg?token=5iM9farjnC)](https://codecov.io/gh/cdr/code-server) [![See v3.12.0 docs](https://img.shields.io/static/v1?label=Docs&message=see%20v3.12.0%20&color=blue)](https://github.com/cdr/code-server/tree/v3.12.0/docs)
3+
[!["GitHub Discussions"](https://img.shields.io/badge/%20GitHub-%20Discussions-gray.svg?longCache=true&logo=github&colorB=purple)](https://github.com/cdr/code-server/discussions) [!["Join us on Slack"](https://img.shields.io/badge/join-us%20on%20slack-gray.svg?longCache=true&logo=slack&colorB=brightgreen)](https://cdr.co/join-community) [![Twitter Follow](https://img.shields.io/twitter/follow/CoderHQ?label=%40CoderHQ&style=social)](https://twitter.com/coderhq) [![codecov](https://codecov.io/gh/cdr/code-server/branch/main/graph/badge.svg?token=5iM9farjnC)](https://codecov.io/gh/cdr/code-server) [![See v4.0.0 docs](https://img.shields.io/static/v1?label=Docs&message=see%20v4.0.0%20&color=blue)](https://github.com/cdr/code-server/tree/v4.0.0/docs)
44

55
Run [VS Code](https://github.com/Microsoft/vscode) on any machine anywhere and
66
access it in the browser.

docs/collaboration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ As `code-server` is based on VS Code, you can follow the steps described on Duck
6060
code-server --enable-proposed-api genuitecllc.codetogether
6161
```
6262

63-
Another option would be to add a value in code-server's [config file](https://coder.com/docs/code-server/v3.12.0/FAQ#how-does-the-config-file-work).
63+
Another option would be to add a value in code-server's [config file](https://coder.com/docs/code-server/v4.0.0/FAQ#how-does-the-config-file-work).
6464

6565
3. Refresh code-server and navigate to the CodeTogether icon in the sidebar to host or join a coding session.

docs/helm.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# code-server Helm Chart
22

3-
[![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square)](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) [![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)](https://img.shields.io/badge/Type-application-informational?style=flat-square) [![AppVersion: 3.12.0](https://img.shields.io/badge/AppVersion-3.12.0-informational?style=flat-square)](https://img.shields.io/badge/AppVersion-3.12.0-informational?style=flat-square)
3+
[![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square)](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) [![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)](https://img.shields.io/badge/Type-application-informational?style=flat-square) [![AppVersion: 4.0.0](https://img.shields.io/badge/AppVersion-4.0.0-informational?style=flat-square)](https://img.shields.io/badge/AppVersion-4.0.0-informational?style=flat-square)
44

55
[code-server](https://github.com/cdr/code-server) code-server is VS Code running
66
on a remote server, accessible through the browser.
@@ -73,7 +73,7 @@ and their default values.
7373
| hostnameOverride | string | `""` |
7474
| image.pullPolicy | string | `"Always"` |
7575
| image.repository | string | `"codercom/code-server"` |
76-
| image.tag | string | `"3.12.0"` |
76+
| image.tag | string | `"4.0.0"` |
7777
| imagePullSecrets | list | `[]` |
7878
| ingress.enabled | bool | `false` |
7979
| nameOverride | string | `""` |

docs/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"versions": ["v3.12.0"],
2+
"versions": ["v4.0.0"],
33
"routes": [
44
{
55
"title": "Home",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "code-server",
33
"license": "MIT",
4-
"version": "3.12.0",
4+
"version": "4.0.0",
55
"description": "Run VS Code on a remote server.",
66
"homepage": "https://github.com/cdr/code-server",
77
"bugs": {

src/node/cli.ts

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,10 @@ export const parse = (
405405
throw new Error("--cert-key is missing")
406406
}
407407

408-
logger.debug(() => ["parsed command line", field("args", { ...args, password: undefined })])
408+
logger.debug(() => [
409+
`parsed ${opts?.configFile ? "config" : "command line"}`,
410+
field("args", { ...args, password: undefined }),
411+
])
409412

410413
return args
411414
}
@@ -430,8 +433,6 @@ export interface DefaultedArgs extends ConfigArgs {
430433
"user-data-dir": string
431434
/* Positional arguments. */
432435
_: []
433-
folder: string
434-
workspace: string
435436
}
436437

437438
/**
@@ -539,25 +540,8 @@ export async function setDefaults(cliArgs: UserProvidedArgs, configArgs?: Config
539540
args._ = []
540541
}
541542

542-
let workspace = ""
543-
let folder = ""
544-
if (args._.length) {
545-
const lastEntry = path.resolve(process.cwd(), args._[args._.length - 1])
546-
const entryIsFile = await isFile(lastEntry)
547-
548-
if (entryIsFile && path.extname(lastEntry) === ".code-workspace") {
549-
workspace = lastEntry
550-
args._.pop()
551-
} else if (!entryIsFile) {
552-
folder = lastEntry
553-
args._.pop()
554-
}
555-
}
556-
557543
return {
558544
...args,
559-
workspace,
560-
folder,
561545
usingEnvPassword,
562546
usingEnvHashedPassword,
563547
} as DefaultedArgs // TODO: Technically no guarantee this is fulfilled.
@@ -760,3 +744,34 @@ export const shouldOpenInExistingInstance = async (args: UserProvidedArgs): Prom
760744

761745
return undefined
762746
}
747+
748+
/**
749+
* Convert our arguments to VS Code server arguments.
750+
*/
751+
export const toVsCodeArgs = async (args: DefaultedArgs): Promise<CodeServerLib.ServerParsedArgs> => {
752+
let workspace = ""
753+
let folder = ""
754+
if (args._.length) {
755+
const lastEntry = path.resolve(args._[args._.length - 1])
756+
const entryIsFile = await isFile(lastEntry)
757+
if (entryIsFile && path.extname(lastEntry) === ".code-workspace") {
758+
workspace = lastEntry
759+
} else if (!entryIsFile) {
760+
folder = lastEntry
761+
}
762+
// Otherwise it is a regular file. Spawning VS Code with a file is not yet
763+
// supported but it can be done separately after code-server spawns.
764+
}
765+
766+
return {
767+
"connection-token": "0000",
768+
...args,
769+
workspace,
770+
folder,
771+
"accept-server-license-terms": true,
772+
/** Type casting. */
773+
help: !!args.help,
774+
version: !!args.version,
775+
port: args.port?.toString(),
776+
}
777+
}

src/node/main.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import path from "path"
55
import { Disposable } from "../common/emitter"
66
import { plural } from "../common/util"
77
import { createApp, ensureAddress } from "./app"
8-
import { AuthType, DefaultedArgs, Feature, UserProvidedArgs } from "./cli"
8+
import { AuthType, DefaultedArgs, Feature, toVsCodeArgs, UserProvidedArgs } from "./cli"
99
import { coderCloudBind } from "./coder_cloud"
1010
import { commit, version } from "./constants"
1111
import { register } from "./routes"
@@ -35,14 +35,7 @@ export const runVsCodeCli = async (args: DefaultedArgs): Promise<void> => {
3535
const spawnCli = await loadAMDModule<CodeServerLib.SpawnCli>("vs/server/remoteExtensionHostAgent", "spawnCli")
3636

3737
try {
38-
await spawnCli({
39-
...args,
40-
/** Type casting. */
41-
"accept-server-license-terms": true,
42-
help: !!args.help,
43-
version: !!args.version,
44-
port: args.port?.toString(),
45-
})
38+
await spawnCli(await toVsCodeArgs(args))
4639
} catch (error: any) {
4740
logger.error("Got error from VS Code", error)
4841
}

src/node/routes/vscode.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as express from "express"
33
import { WebsocketRequest } from "../../../typings/pluginapi"
44
import { logError } from "../../common/util"
55
import { isDevMode } from "../constants"
6+
import { toVsCodeArgs } from "../cli"
67
import { ensureAuthenticated, authenticated, redirect } from "../http"
78
import { loadAMDModule, readCompilationStats } from "../util"
89
import { Router as WsRouter } from "../wsRouter"
@@ -87,15 +88,7 @@ export class CodeServerRouteWrapper {
8788
)
8889

8990
try {
90-
this._codeServerMain = await createVSServer(null, {
91-
"connection-token": "0000",
92-
"accept-server-license-terms": true,
93-
...args,
94-
/** Type casting. */
95-
help: !!args.help,
96-
version: !!args.version,
97-
port: args.port?.toString(),
98-
})
91+
this._codeServerMain = await createVSServer(null, await toVsCodeArgs(args))
9992
} catch (createServerError) {
10093
logError(logger, "CodeServerRouteWrapper", createServerError)
10194
return next(createServerError)

0 commit comments

Comments
 (0)