From 861e0a902ba0d82f84788b99ca6ddf6be8ab7acf Mon Sep 17 00:00:00 2001 From: Jonas Date: Sun, 21 May 2023 18:09:52 +0200 Subject: [PATCH 1/3] docs: mention Termux extension workarounds --- docs/termux.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/termux.md b/docs/termux.md index 152e0154b70e..9b5e00efec5f 100644 --- a/docs/termux.md +++ b/docs/termux.md @@ -87,6 +87,31 @@ Potential Workaround : 1. Create a soft-link from the debian-fs to your folder in `/sdcard` 2. Use git from termux (preferred) +### Many extensions including language packs fail to install + +Issue: Android is not seen as a Linux environment but as a separate, unsupported platform, so code-server only allows [Web Extensions](https://code.visualstudio.com/api/extension-guides/web-extensions), refusing to install extensions that run on the server. +Fix: None\ +Potential workaround : + +You can manually download extensions as `.vsix` file and install them via `Extensions: Install from VSIX...` in the Command Palette. + +Alternatively, you can override `process.platform` to `linux`: + +Create a JS script that patches `process.platform`: + +``` +// android-as-linux.js +Object.defineProperty(process, 'platform', { get() { return 'linux' }}); +``` + +Then use Node's `--require` option to make sure it is loaded before `code-server` starts: + +```sh +NODE_OPTIONS="--require /path/to/android-as-linux.js" code-server +``` + +⚠️ Note that Android and Linux are not 100% compatible, so use these workarounds at your own risk. Extensions that have native dependencies other than Node or interact with the OS directly might cause issues. + ## Extra ### Create a new user From 9d7721fadca1cbeedb6c7c61bb3e05605e202688 Mon Sep 17 00:00:00 2001 From: Jonas Date: Sun, 21 May 2023 18:18:12 +0200 Subject: [PATCH 2/3] docs: improve wording and formatting --- docs/termux.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/termux.md b/docs/termux.md index 9b5e00efec5f..470bd13d6ec9 100644 --- a/docs/termux.md +++ b/docs/termux.md @@ -89,17 +89,19 @@ Potential Workaround : ### Many extensions including language packs fail to install -Issue: Android is not seen as a Linux environment but as a separate, unsupported platform, so code-server only allows [Web Extensions](https://code.visualstudio.com/api/extension-guides/web-extensions), refusing to install extensions that run on the server. +Issue: Android is not seen as a Linux environment but as a separate, unsupported platform, so code-server only allows [Web Extensions](https://code.visualstudio.com/api/extension-guides/web-extensions), refusing to download extensions that run on the server.\ Fix: None\ -Potential workaround : +Potential workarounds : -You can manually download extensions as `.vsix` file and install them via `Extensions: Install from VSIX...` in the Command Palette. +Either -Alternatively, you can override `process.platform` to `linux`: +- Manually download extensions as `.vsix` file and install them via `Extensions: Install from VSIX...` in the Command Palette. + +- Use an override to pretend the platform is Linux: Create a JS script that patches `process.platform`: -``` +```js // android-as-linux.js Object.defineProperty(process, 'platform', { get() { return 'linux' }}); ``` @@ -110,7 +112,7 @@ Then use Node's `--require` option to make sure it is loaded before `code-server NODE_OPTIONS="--require /path/to/android-as-linux.js" code-server ``` -⚠️ Note that Android and Linux are not 100% compatible, so use these workarounds at your own risk. Extensions that have native dependencies other than Node or interact with the OS directly might cause issues. +⚠️ Note that Android and Linux are not 100% compatible, so use these workarounds at your own risk. Extensions that have native dependencies other than Node or that directly interact with the OS might cause issues. ## Extra From 64399d6bf4b46094eee434e2b283508948d32015 Mon Sep 17 00:00:00 2001 From: Jonas Date: Mon, 22 May 2023 22:09:50 +0000 Subject: [PATCH 3/3] docs: fix formatting + doctoc --- ci/build/build-vscode.sh | 2 +- docs/termux.md | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ci/build/build-vscode.sh b/ci/build/build-vscode.sh index 49acbf5b7853..a72549fb6022 100755 --- a/ci/build/build-vscode.sh +++ b/ci/build/build-vscode.sh @@ -112,7 +112,7 @@ EOF pushd lib/vscode-reh-web-linux-x64 # Make sure Code took the version we set in the environment variable. Not # having a version will break display languages. - if ! jq -e .commit product.json ; then + if ! jq -e .commit product.json; then echo "'commit' is missing from product.json" exit 1 fi diff --git a/docs/termux.md b/docs/termux.md index 470bd13d6ec9..9c19a9e42c50 100644 --- a/docs/termux.md +++ b/docs/termux.md @@ -8,6 +8,7 @@ - [Upgrade](#upgrade) - [Known Issues](#known-issues) - [Git won't work in `/sdcard`](#git-wont-work-in-sdcard) + - [Many extensions including language packs fail to install](#many-extensions-including-language-packs-fail-to-install) - [Extra](#extra) - [Create a new user](#create-a-new-user) - [Install Go](#install-go) @@ -103,7 +104,11 @@ Create a JS script that patches `process.platform`: ```js // android-as-linux.js -Object.defineProperty(process, 'platform', { get() { return 'linux' }}); +Object.defineProperty(process, "platform", { + get() { + return "linux" + }, +}) ``` Then use Node's `--require` option to make sure it is loaded before `code-server` starts: @@ -112,7 +117,7 @@ Then use Node's `--require` option to make sure it is loaded before `code-server NODE_OPTIONS="--require /path/to/android-as-linux.js" code-server ``` -⚠️ Note that Android and Linux are not 100% compatible, so use these workarounds at your own risk. Extensions that have native dependencies other than Node or that directly interact with the OS might cause issues. +⚠️ Note that Android and Linux are not 100% compatible, so use these workarounds at your own risk. Extensions that have native dependencies other than Node or that directly interact with the OS might cause issues. ## Extra