Skip to content

Commit 54ffd1d

Browse files
committed
Make extension sidebar work
1 parent 86e8ba1 commit 54ffd1d

7 files changed

Lines changed: 932 additions & 1284 deletions

File tree

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ matrix:
88
- os: linux
99
dist: trusty
1010
env:
11-
- VSCODE_VERSION="1.36.0" MAJOR_VERSION="2" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER" TARGET="centos"
11+
- VSCODE_VERSION="1.36.1" MAJOR_VERSION="2" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER" TARGET="centos"
1212
- os: linux
1313
dist: trusty
1414
env:
15-
- VSCODE_VERSION="1.36.0" MAJOR_VERSION="2" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER" TARGET="alpine"
15+
- VSCODE_VERSION="1.36.1" MAJOR_VERSION="2" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER" TARGET="alpine"
1616
- os: osx
1717
env:
18-
- VSCODE_VERSION="1.36.0" MAJOR_VERSION="2" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER"
18+
- VSCODE_VERSION="1.36.1" MAJOR_VERSION="2" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER"
1919
before_install:
2020
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y libxkbfile-dev libsecret-1-dev; fi
2121
- npm install -g yarn@1.12.3

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,18 @@ How to [secure your setup](/doc/security/ssl.md).
6161
6262
## Development
6363
64-
- Clone VS Code.
65-
- Run `yarn` in the VS Code root directory.
66-
- Run `yarn compile` in the VS Code root directory.
67-
- Clone this repository to `src/vs/server` in the VS Code source.
68-
- Run `yarn` in this directory.
69-
- Run `yarn watch` in this directory.
70-
- Wait for the initial compilation to complete.
71-
- Run `yarn start` in this directory.
72-
- Visit `http://localhost:8443`.
64+
```fish
65+
git clone https://github.com/microsoft/vscode
66+
cd vscode
67+
git clone https://github.com/cdr/code-server src/vs/server
68+
cd src/vs/server
69+
yarn patch:apply
70+
yarn
71+
yarn watch
72+
# Wait for the initial compilation to complete (it will say "Finished compilation").
73+
yarn start
74+
# Visit http://localhost:8443
75+
```
7376

7477
### Known Issues
7578

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
{
22
"license": "MIT",
33
"scripts": {
4-
"postinstall": "rm -r node_modules/@types/node # I keep getting type conflicts",
4+
"preinstall": "cd ../../../ && yarn",
5+
"postinstall": "rm -rf node_modules/@types/node # I keep getting type conflicts",
56
"start": "nodemon ../../../out/vs/server/main.js --watch ../../../out --verbose",
6-
"watch": "cd ../../../ && yarn watch-client",
7+
"watch": "cd ../../../ && yarn watch",
78
"build": "bash ./scripts/tasks.bash build",
89
"package": "bash ./scripts/tasks.bash package",
910
"vstar": "bash ./scripts/tasks.bash vstar",
10-
"binary": "bash ./scripts/tasks.bash binary"
11+
"binary": "bash ./scripts/tasks.bash binary",
12+
"patch:generate": "cd ../../../ && git diff --staged > ./src/vs/server/scripts/vscode.patch",
13+
"patch:apply": "cd ../../../ && git apply ./src/vs/server/scripts/vscode.patch"
1114
},
1215
"devDependencies": {
1316
"@types/tar-stream": "^1.6.1",

scripts/tasks.bash

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ function copy-server() {
3636
else
3737
log "Installing dependencies"
3838
cd "${serverPath}"
39-
yarn
39+
# Ignore scripts to avoid also installing VS Code dependencies which has
40+
# already been done.
41+
yarn --ignore-scripts
4042
rm -r node_modules/@types/node # I keep getting type conflicts
4143
fi
4244
}
@@ -62,6 +64,9 @@ function build-code-server() {
6264
# the same type of build you get with the vscode-linux-x64-min task).
6365
# Something like: yarn gulp "vscode-server-${target}-${arch}-min"
6466
cd "${vscodeSourcePath}"
67+
git reset --hard
68+
git clean -fd
69+
git apply "${rootPath}/scripts/vscode.patch"
6570
yarn gulp compile-client
6671

6772
rm -rf "${codeServerBuildPath}"
@@ -105,7 +110,6 @@ function build-vscode() {
105110
npm rebuild || true
106111

107112
# Keep just what we need to keep the pre-built archive smaller.
108-
rm -rf "${vscodeSourcePath}/.git"
109113
rm -rf "${vscodeSourcePath}/test"
110114
else
111115
log "${vscodeSourceName}/node_modules already exists, skipping install"
@@ -192,7 +196,7 @@ function package-task() {
192196
rm -rf "${archivePath}"
193197
mkdir -p "${archivePath}"
194198

195-
cp "${buildPath}/code-server" "${archivePath}"
199+
cp "${buildPath}/${binaryName}" "${archivePath}/code-server"
196200
cp "${rootPath}/README.md" "${archivePath}"
197201
cp "${vscodeSourcePath}/LICENSE.txt" "${archivePath}"
198202
cp "${vscodeSourcePath}/ThirdPartyNotices.txt" "${archivePath}"
@@ -216,8 +220,8 @@ function binary-task() {
216220
npm link @coder/nbin
217221
node "${rootPath}/scripts/nbin.js" "${target}" "${arch}" "${codeServerBuildPath}"
218222
rm node_modules/@coder/nbin
219-
mv "${codeServerBuildPath}/code-server" "${buildPath}"
220-
log "Binary at ${buildPath}/code-server"
223+
mv "${codeServerBuildPath}/code-server" "${buildPath}/${binaryName}"
224+
log "Binary at ${buildPath}/${binaryName}"
221225
}
222226

223227
function main() {
@@ -237,6 +241,19 @@ function main() {
237241
# will compile everything in the build directory as well.
238242
local outPath="${OUT:-${rootPath}}"
239243

244+
# If we're inside a vscode directory, assume we want to develop. In that case
245+
# we should set an OUT directory and not build in this directory.
246+
if [[ "${outPath}" == "${rootPath}" ]] ; then
247+
local maybeVscode
248+
local dirName
249+
maybeVscode="$(realpath "${outPath}/../../..")"
250+
dirName="$(basename "${maybeVscode}")"
251+
if [[ "${dirName}" == "vscode" ]] ; then
252+
log "Set the OUT environment variable to something outside ${maybeVscode}" "error"
253+
exit 1
254+
fi
255+
fi
256+
240257
local releasePath="${outPath}/release"
241258
local buildPath="${outPath}/build"
242259

@@ -245,8 +262,9 @@ function main() {
245262
local vscodeSourcePath="${buildPath}/${vscodeSourceName}"
246263
local vscodeBuildPath="${buildPath}/${vscodeBuildName}"
247264

248-
local codeServerBuildName="code-server-${target}-${arch}-built"
265+
local codeServerBuildName="code-server-${vscodeVersion}-${target}-${arch}-built"
249266
local codeServerBuildPath="${buildPath}/${codeServerBuildName}"
267+
local binaryName="code-server-${vscodeVersion}-${target}-${arch}"
250268

251269
log "Running ${task} task"
252270
log " rootPath: ${rootPath}"

0 commit comments

Comments
 (0)