Repository: coder/code-server (TypeScript)
Date: 2022-01-04 18:02:33+00:00
Task type: Bug Fix

Issue:
Builtin extensions always require reload
@bpmct found an issue with the extensions panel while testing the [4.0.0 release](https://github.com/cdr/code-server/pull/4597#issuecomment-990381354).

## Steps to Reproduce

1. run code-server with 0 extensions installed
```shell
# create an empty directory
# that way we don't have to uninstall all extensions
mkdir empty-dir
code-server --extensions-dir empty-dir
```
2. open extensions panel

### Expected

See list of Popular Extensions
![image](https://user-images.githubusercontent.com/3806031/145621583-f0a38617-3eb6-4278-a158-5e3c307b8895.png)

### Actual (v3.12.0)

Works as expected.

![image](https://user-images.githubusercontent.com/3806031/145621583-f0a38617-3eb6-4278-a158-5e3c307b8895.png)

### Actual (v4.0.0)

Works as expected (running in dev mode with `yarn watch`)

![image](https://user-images.githubusercontent.com/3806031/145623101-88c142c3-a909-4815-851e-504ab4093ff1.png)

### Actual (vscode.dev)

Works as expected.

![image](https://user-images.githubusercontent.com/3806031/145621746-e3edd231-286b-4a9c-b792-aa057ad24029.png)

### Actual (Codespaces)

🐛 Does not show Popular Extensions

![image](https://user-images.githubusercontent.com/3806031/145622265-ff9e2966-5591-4a5c-9938-83bfb44af53a.png)

### Actual (VS Code)

Works as expected.

![image](https://user-images.githubusercontent.com/3806031/145621897-1c3fd124-0ab5-4f6b-b5f4-ae02774a74ce.png)




Issue discussion:
We don't think this is an issue but will retest after 4.0.0 is out.
### Actual (https://vscode-r.jupyter.b-data.ch, v4.0.0, empty `~/.local/share/code-server/extensions`)

Shows popular extensions. Says 'Reload Required' for _builtin_ extension; pre-installed extensions* not affected.

*Pre-installed using `code-server --extensions-dir /opt/code-server/vendor/modules/code-oss-dev/extensions --install-extension ms-python.python` for example.

![popular-extensions](https://user-images.githubusercontent.com/20233085/145862346-68171ef5-439d-4af6-a035-2ee653f7bbb9.png)

Fixed via https://github.com/coder/vscode/pull/32

Solution patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -32,12 +32,11 @@ implementation (#4414).
 - Web socket compression has been made the default (when supported). This means
   the `--enable` flag will no longer take `permessage-deflate` as an option.
 - Extra extension directories have been removed. The `--extra-extensions-dir`
-  and `--extra-builtin-extensions-dir` will no longer be accepted.
-- The `--install-source` and `--locale` flags have been removed.
+  and `--extra-builtin-extensions-dir` flags will no longer be accepted.
+- The `--install-source` flag has been removed.
 - The static endpoint can no longer reach outside code-server. However the
   vscode-remote-resource endpoint still can.
-- OpenVSX has been made the default marketplace. However this means web
-  extensions like Vim may be broken.
+- OpenVSX has been made the default marketplace.
 - The last opened folder/workspace is no longer stored separately in the
   settings file (we rely on the already-existing query object instead).
 
diff --git a/src/node/cli.ts b/src/node/cli.ts
--- a/src/node/cli.ts
+++ b/src/node/cli.ts
@@ -57,6 +57,7 @@ export interface UserProvidedArgs {
   enable?: string[]
   help?: boolean
   host?: string
+  locale?: string
   port?: number
   json?: boolean
   log?: LogLevel
@@ -163,6 +164,7 @@ const options: Options<Required<UserProvidedArgs>> = {
   enable: { type: "string[]" },
   help: { type: "boolean", short: "h", description: "Show this output." },
   json: { type: "boolean" },
+  locale: { type: "string" }, // The preferred way to set the locale is via the UI.
   open: { type: "boolean", description: "Open in browser on startup. Does not work remotely." },
 
   "bind-addr": {
diff --git a/vendor/package.json b/vendor/package.json
--- a/vendor/package.json
+++ b/vendor/package.json
@@ -7,6 +7,6 @@
     "postinstall": "./postinstall.sh"
   },
   "devDependencies": {
-    "code-oss-dev": "cdr/vscode#48fae57fd9adb772fc1b10e4a9a5e1ba6880640a"
+    "code-oss-dev": "cdr/vscode#69a6ce45fc5b883aa8a950e10b79fd083eb0a7d7"
   }
 }
diff --git a/vendor/yarn.lock b/vendor/yarn.lock
--- a/vendor/yarn.lock
+++ b/vendor/yarn.lock
@@ -274,9 +274,9 @@ clone-response@^1.0.2:
   dependencies:
     mimic-response "^1.0.0"
 
-code-oss-dev@cdr/vscode#48fae57fd9adb772fc1b10e4a9a5e1ba6880640a:
+code-oss-dev@cdr/vscode#69a6ce45fc5b883aa8a950e10b79fd083eb0a7d7:
   version "1.63.0"
-  resolved "https://codeload.github.com/cdr/vscode/tar.gz/48fae57fd9adb772fc1b10e4a9a5e1ba6880640a"
+  resolved "https://codeload.github.com/cdr/vscode/tar.gz/69a6ce45fc5b883aa8a950e10b79fd083eb0a7d7"
   dependencies:
     "@microsoft/applicationinsights-web" "^2.6.4"
     "@parcel/watcher" "2.0.3"


Test patch:
diff --git a/test/unit/node/cli.test.ts b/test/unit/node/cli.test.ts
--- a/test/unit/node/cli.test.ts
+++ b/test/unit/node/cli.test.ts
@@ -63,6 +63,8 @@ describe("parser", () => {
           "--verbose",
           "2",
 
+          ["--locale", "ja"],
+
           ["--log", "error"],
 
           "--help",
@@ -103,6 +105,7 @@ describe("parser", () => {
       help: true,
       host: "0.0.0.0",
       json: true,
+      locale: "ja",
       log: "error",
       open: true,
       port: 8081,