Make extension sidebar work

This commit is contained in:
Asher 2019-07-10 16:29:15 -05:00
parent 86e8ba12e7
commit 54ffd1d351
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A
7 changed files with 934 additions and 1286 deletions

View File

@ -8,14 +8,14 @@ matrix:
- os: linux
dist: trusty
env:
- VSCODE_VERSION="1.36.0" MAJOR_VERSION="2" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER" TARGET="centos"
- VSCODE_VERSION="1.36.1" MAJOR_VERSION="2" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER" TARGET="centos"
- os: linux
dist: trusty
env:
- VSCODE_VERSION="1.36.0" MAJOR_VERSION="2" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER" TARGET="alpine"
- VSCODE_VERSION="1.36.1" MAJOR_VERSION="2" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER" TARGET="alpine"
- os: osx
env:
- VSCODE_VERSION="1.36.0" MAJOR_VERSION="2" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER"
- VSCODE_VERSION="1.36.1" MAJOR_VERSION="2" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER"
before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y libxkbfile-dev libsecret-1-dev; fi
- npm install -g yarn@1.12.3

View File

@ -61,15 +61,18 @@ How to [secure your setup](/doc/security/ssl.md).
## Development
- Clone VS Code.
- Run `yarn` in the VS Code root directory.
- Run `yarn compile` in the VS Code root directory.
- Clone this repository to `src/vs/server` in the VS Code source.
- Run `yarn` in this directory.
- Run `yarn watch` in this directory.
- Wait for the initial compilation to complete.
- Run `yarn start` in this directory.
- Visit `http://localhost:8443`.
```fish
git clone https://github.com/microsoft/vscode
cd vscode
git clone https://github.com/cdr/code-server src/vs/server
cd src/vs/server
yarn patch:apply
yarn
yarn watch
# Wait for the initial compilation to complete (it will say "Finished compilation").
yarn start
# Visit http://localhost:8443
```
### Known Issues

View File

@ -1,13 +1,16 @@
{
"license": "MIT",
"scripts": {
"postinstall": "rm -r node_modules/@types/node # I keep getting type conflicts",
"preinstall": "cd ../../../ && yarn",
"postinstall": "rm -rf node_modules/@types/node # I keep getting type conflicts",
"start": "nodemon ../../../out/vs/server/main.js --watch ../../../out --verbose",
"watch": "cd ../../../ && yarn watch-client",
"watch": "cd ../../../ && yarn watch",
"build": "bash ./scripts/tasks.bash build",
"package": "bash ./scripts/tasks.bash package",
"vstar": "bash ./scripts/tasks.bash vstar",
"binary": "bash ./scripts/tasks.bash binary"
"binary": "bash ./scripts/tasks.bash binary",
"patch:generate": "cd ../../../ && git diff --staged > ./src/vs/server/scripts/vscode.patch",
"patch:apply": "cd ../../../ && git apply ./src/vs/server/scripts/vscode.patch"
},
"devDependencies": {
"@types/tar-stream": "^1.6.1",

View File

@ -36,7 +36,9 @@ function copy-server() {
else
log "Installing dependencies"
cd "${serverPath}"
yarn
# Ignore scripts to avoid also installing VS Code dependencies which has
# already been done.
yarn --ignore-scripts
rm -r node_modules/@types/node # I keep getting type conflicts
fi
}
@ -62,6 +64,9 @@ function build-code-server() {
# the same type of build you get with the vscode-linux-x64-min task).
# Something like: yarn gulp "vscode-server-${target}-${arch}-min"
cd "${vscodeSourcePath}"
git reset --hard
git clean -fd
git apply "${rootPath}/scripts/vscode.patch"
yarn gulp compile-client
rm -rf "${codeServerBuildPath}"
@ -105,7 +110,6 @@ function build-vscode() {
npm rebuild || true
# Keep just what we need to keep the pre-built archive smaller.
rm -rf "${vscodeSourcePath}/.git"
rm -rf "${vscodeSourcePath}/test"
else
log "${vscodeSourceName}/node_modules already exists, skipping install"
@ -192,7 +196,7 @@ function package-task() {
rm -rf "${archivePath}"
mkdir -p "${archivePath}"
cp "${buildPath}/code-server" "${archivePath}"
cp "${buildPath}/${binaryName}" "${archivePath}/code-server"
cp "${rootPath}/README.md" "${archivePath}"
cp "${vscodeSourcePath}/LICENSE.txt" "${archivePath}"
cp "${vscodeSourcePath}/ThirdPartyNotices.txt" "${archivePath}"
@ -216,8 +220,8 @@ function binary-task() {
npm link @coder/nbin
node "${rootPath}/scripts/nbin.js" "${target}" "${arch}" "${codeServerBuildPath}"
rm node_modules/@coder/nbin
mv "${codeServerBuildPath}/code-server" "${buildPath}"
log "Binary at ${buildPath}/code-server"
mv "${codeServerBuildPath}/code-server" "${buildPath}/${binaryName}"
log "Binary at ${buildPath}/${binaryName}"
}
function main() {
@ -237,6 +241,19 @@ function main() {
# will compile everything in the build directory as well.
local outPath="${OUT:-${rootPath}}"
# If we're inside a vscode directory, assume we want to develop. In that case
# we should set an OUT directory and not build in this directory.
if [[ "${outPath}" == "${rootPath}" ]] ; then
local maybeVscode
local dirName
maybeVscode="$(realpath "${outPath}/../../..")"
dirName="$(basename "${maybeVscode}")"
if [[ "${dirName}" == "vscode" ]] ; then
log "Set the OUT environment variable to something outside ${maybeVscode}" "error"
exit 1
fi
fi
local releasePath="${outPath}/release"
local buildPath="${outPath}/build"
@ -245,8 +262,9 @@ function main() {
local vscodeSourcePath="${buildPath}/${vscodeSourceName}"
local vscodeBuildPath="${buildPath}/${vscodeBuildName}"
local codeServerBuildName="code-server-${target}-${arch}-built"
local codeServerBuildName="code-server-${vscodeVersion}-${target}-${arch}-built"
local codeServerBuildPath="${buildPath}/${codeServerBuildName}"
local binaryName="code-server-${vscodeVersion}-${target}-${arch}"
log "Running ${task} task"
log " rootPath: ${rootPath}"

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,11 @@
// This file is included via a regular Node require. I'm not sure how (or if)
// we can write this in Typescript and have it compile to non-AMD syntax.
module.exports = (remoteAuthority) => {
module.exports = (remoteAuthority, https) => {
return {
transformIncoming: (uri) => {
switch (uri.scheme) {
case "vscode-remote": return { scheme: "file", path: uri.path };
case "https": return { scheme: "file", path: uri.path };
case "http": return { scheme: "file", path: uri.path };
case "file": return { scheme: "vscode-local", path: uri.path };
default: return uri;
}
@ -12,14 +13,14 @@ module.exports = (remoteAuthority) => {
transformOutgoing: (uri) => {
switch (uri.scheme) {
case "vscode-local": return { scheme: "file", path: uri.path };
case "file": return { scheme: "vscode-remote", authority: remoteAuthority, path: uri.path };
case "file": return { scheme: https ? "https" : "http", authority: remoteAuthority, path: uri.path };
default: return uri;
}
},
transformOutgoingScheme: (scheme) => {
switch (scheme) {
case "vscode-local": return "file";
case "file": return "vscode-remote";
case "file": return https ? "https" : "http";
default: return scheme;
}
},

3
uriTransformerHttps.js Normal file
View File

@ -0,0 +1,3 @@
module.exports = (remoteAuthority) => {
return require("./uriTransformer")(remoteAuthority, true);
};