Compare commits

..

32 Commits

Author SHA1 Message Date
Kibo Hikari
dfabc070b9 fix(dockerfile): explicitly create a volume and set permission for project dir (#471)
Signed-off-by: Kibo Hikari <enra@sayonika.moe>
2019-04-13 23:34:25 -05:00
Kyle Carberry
da420cdda9 Merge branch 'master' of github.com:codercom/code-server 2019-04-14 00:32:06 -04:00
Kyle Carberry
c6a46e4753 Fix reading text from clipboard via electron fill 2019-04-14 00:32:03 -04:00
Asher
742dd6f597 Upgrade VS Code to 1.33.1 2019-04-12 16:10:45 -05:00
Yen-Chi Chen
6c3ff1d6f0 Fix typo: doc/self-hosted/index.md (#477) 2019-04-12 10:35:54 -05:00
John McCambridge
db57aa229f Allow use of the enter key for password input for code-server (#479)
* Allow use of the enter key for password input for code-server

* Remove function, make html form

* Remove function and create html form

* Handle form submit action

* Remove button listener

* Check if form exists
2019-04-12 10:35:30 -05:00
David Pinezich
f7342ede69 Update digitalocean.md (#486)
Seems that   sudo ./code-server-linux -p 80 is outdated. The "linux" is not anymore given.
2019-04-11 16:18:13 -05:00
Anmol Sethi
b781ccde9c Add common utilities to Dockerfile (#488) 2019-04-11 15:30:21 -05:00
Asher
8f62b2bff2 Decrease max retry time to three seconds 2019-04-11 14:58:29 -05:00
Asher
7047be859c Fix some open file/folder issues
- "Open folder" now says "open folder" instead of "open file"
- "Open folder" won't allow you to open files
- "Open file" won't allow you to open directories

Fixes #249.
2019-04-11 14:55:06 -05:00
Kyle Carberry
2785e2219a Remove hosted from the readme 2019-04-11 02:11:51 +00:00
majik
4b217fba00 Feature/relative url (#307)
* resrouce relative url

* add url pathname for require.toUrl (fix webview url)

* rest resrouce relative url

* fix resource url

* ignore .vscode
2019-04-10 20:07:53 -05:00
Kyle Carberry
3fae68bbab Add storage save to ide-api 2019-04-09 12:24:53 -04:00
Asher
a2f20aa25c Update window service fill 2019-04-08 18:04:41 -05:00
Asher
94b8b9a5cf Fix window.open infinite loop 2019-04-08 17:44:10 -05:00
Asher
bbd8b27fc7 Explicitly mention if netstat isn't installed; downgrade to warning 2019-04-08 11:15:25 -05:00
Asher
6361635b55 Move backup service init to the shared process
Since this is where it attempts to read it, this should solve the JSON
errors for good.
2019-04-08 11:03:33 -05:00
Kyle Carberry
d2da4cfc43 Fix errors appearing 2019-04-07 17:04:49 -04:00
Asher
a1136b3a02 Update VS Code to 1.33.0 (#445)
* Update VS Code to 1.33.0

* Fix slow file tree

* Fix WindowsService fill

* Provide `off` on event listeners

* Fix webview

* Fix double title bar and missing preferences on Mac

* Bump VS Code version in Travis config

* Fix black dialog text (again)

* Fix shared process not starting
2019-04-05 18:49:29 -05:00
Anmol Sethi
4dd74b31b9 Merge pull request #435 from codercom/docker-fixes
Reduce layers in Dockerfile
2019-04-05 10:18:50 -05:00
Anmol Sethi
bc0f6eb65d Reduce layers in Dockerfile 2019-04-04 20:00:42 -05:00
Anmol Sethi
6737d3da18 Merge pull request #433 from codercom/docker-fixes
Significantly improve the Dockerfile
2019-04-04 18:42:14 -05:00
Anmol Sethi
eb0f773146 Update README.md 2019-04-04 18:41:45 -05:00
Anmol Sethi
ebac84899e Significantly improve the Dockerfile
- Adds dumb-init so closes #403, closes #361, closes #383
- User mode docker so closes #192, closes #65
- Uses latest docker ubuntu instead of 18.10 which is the rolling tag so closes #404

Thanks to @RichardMcSorley and @sr229
2019-04-04 18:41:45 -05:00
Richard McSorley
0b7a090a73 Use an init system 2019-04-04 18:41:45 -05:00
Hikari Kibo
a95019f38d fix: slap adduser into another RUN
im abusing the word slap today please help me
2019-04-04 18:41:45 -05:00
Hikari
15948c1af6 feat: user-mode docker
Signed-off-by: Hikari <enra@sayonika.moe>
2019-04-04 18:41:45 -05:00
Asher
e73eb74208 Fix sending dates through the protocol
Fixes #253.
2019-04-04 18:24:53 -05:00
Kyle Carberry
278c59b920 Remove non-working menu items 2019-04-04 18:04:34 -04:00
Kyle Carberry
5a1eb858a9 Merge branch 'master' of github.com:codercom/code-server 2019-04-04 17:13:58 -04:00
Kyle Carberry
3c1dfb1170 Update @coder/nbin. Fixes UI state saves 2019-04-04 17:13:54 -04:00
Asher
09a02eb9e9 Build for production in Docker 2019-04-04 13:33:49 -05:00
48 changed files with 879 additions and 418 deletions

3
.gitignore vendored
View File

@@ -4,4 +4,5 @@ dist
out
.DS_Store
release
.cache
.vscode
.cache

View File

@@ -2,7 +2,7 @@ language: node_js
node_js:
- 8.15.0
env:
- VSCODE_VERSION="1.32.0" MAJOR_VERSION="1" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER-vsc$VSCODE_VERSION"
- VSCODE_VERSION="1.33.1" MAJOR_VERSION="1" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER-vsc$VSCODE_VERSION"
matrix:
include:
- os: linux

View File

@@ -13,22 +13,42 @@ COPY . .
# In the future, we can use https://github.com/yarnpkg/rfcs/pull/53 to make yarn use the node_modules
# directly which should be fast as it is slow because it populates its own cache every time.
RUN yarn && yarn task build:server:binary
RUN yarn && NODE_ENV=production yarn task build:server:binary
# We deploy with ubuntu so that devs have a familiar environment.
FROM ubuntu:18.10
WORKDIR /root/project
COPY --from=0 /src/packages/server/cli-linux-x64 /usr/local/bin/code-server
EXPOSE 8443
FROM ubuntu:18.04
RUN apt-get update && apt-get install -y \
openssl \
net-tools \
git \
locales
locales \
sudo \
dumb-init \
vim \
curl \
wget
RUN locale-gen en_US.UTF-8
# We unfortunately cannot use update-locale because docker will not use the env variables
# configured in /etc/default/locale so we need to set it manually.
ENV LANG=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENTRYPOINT ["code-server"]
ENV LC_ALL=en_US.UTF-8
RUN adduser --gecos '' --disabled-password coder && \
echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd
USER coder
# We create first instead of just using WORKDIR as when WORKDIR creates, the user is root.
RUN mkdir -p /home/coder/project && \
chmod g+rw /home/coder/project;
WORKDIR /home/coder/project
# This assures we have a volume mounted even if the user forgot to do bind mount.
# XXX: Workaround for GH-459 and for OpenShift compatibility.
VOLUME [ "/home/coder/project" ]
COPY --from=0 /src/packages/server/cli-linux-x64 /usr/local/bin/code-server
EXPOSE 8443
ENTRYPOINT ["dumb-init", "code-server"]

View File

@@ -9,7 +9,7 @@
Try it out:
```bash
docker run -t -p 127.0.0.1:8443:8443 -v "${PWD}:/root/project" codercom/code-server code-server --allow-http --no-auth
docker run -it -p 127.0.0.1:8443:8443 -v "${PWD}:/home/coder/project" codercom/code-server:1.621 --allow-http --no-auth
```
- Code on your Chromebook, tablet, and laptop with a consistent dev environment.
@@ -23,10 +23,6 @@ docker run -t -p 127.0.0.1:8443:8443 -v "${PWD}:/root/project" codercom/code-ser
## Getting Started
### Hosted
[Try `code-server` now](https://coder.com/signup) for free at coder.com.
### Docker
See docker oneliner mentioned above. Dockerfile is at [/Dockerfile](/Dockerfile).

View File

@@ -12,7 +12,7 @@ const libPath = path.join(__dirname, "../lib");
const vscodePath = path.join(libPath, "vscode");
const defaultExtensionsPath = path.join(libPath, "extensions");
const pkgsPath = path.join(__dirname, "../packages");
const vscodeVersion = process.env.VSCODE_VERSION || "1.32.0";
const vscodeVersion = process.env.VSCODE_VERSION || "1.33.1";
const vsSourceUrl = `https://codesrv-ci.cdr.sh/vstar-${vscodeVersion}.tar.gz`;
const buildServerBinary = register("build:server:binary", async (runner) => {

View File

@@ -39,7 +39,7 @@ If you're just starting out, we recommend [installing code-server locally](../..
> To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../../security/ssl.md)
- Finally start the code-server
```
sudo ./code-server-linux -p 80
sudo ./code-server -p 80
```
> For instructions on how to keep the server running after you end your SSH session please checkout [how to use systemd](https://www.linode.com/docs/quick-answers/linux/start-service-at-boot/) to start linux based services if they are killed
- When you visit the public IP for your Digital Ocean instance, you will be greeted with this page. Code-server is using a self-signed SSL certificate for easy setup. To proceed to the IDE, click **"Advanced"**<img src ="../../assets/chrome_warning.png">

View File

@@ -62,7 +62,7 @@ OPTIONS
> Example: `code-server -h 127.0.0.1`
### Open
You can have the server automatically open the VS Code in your browser on startup by using the `code server -o` or `code-server --open` flags
You can have the server automatically open the VS Code in your browser on startup by using the `code-server -o` or `code-server --open` flags
### Port
By default, code-server will use `8443` as its port. This can be changed by using `code-server -p` or `code-server --port=` followed by the port you want to use.

View File

@@ -7,22 +7,24 @@
</head>
<body>
<div class="login">
<div class="back"> <- Back </div>
<h4 class="title">code-server</h4>
<h2 class="subtitle">
Enter server password
</h2>
<div class="mdc-text-field">
<input type="password" id="password" class="mdc-text-field__input" required>
<label class="mdc-floating-label" for="password">Password</label>
<div class="mdc-line-ripple"></div>
</div>
<button id="submit" class="mdc-button mdc-button--unelevated">
<span class="mdc-button__label">Enter IDE</span>
</button>
<div id="error-display"></div>
</div>
<form id="login-form">
<div class="login">
<div class="back">
<- Back </div> <h4 class="title">code-server</h4>
<h2 class="subtitle">
Enter server password
</h2>
<div class="mdc-text-field">
<input type="password" id="password" class="mdc-text-field__input" required>
<label class="mdc-floating-label" for="password">Password</label>
<div class="mdc-line-ripple"></div>
</div>
<button id="submit" class="mdc-button mdc-button--unelevated">
<span class="mdc-button__label">Enter IDE</span>
</button>
<div id="error-display"></div>
</div>
</form>
</body>
</html>

View File

@@ -20,11 +20,14 @@ window.addEventListener("message", (event) => {
});
const password = document.getElementById("password") as HTMLInputElement;
const submit = document.getElementById("submit") as HTMLButtonElement;
if (!submit) {
throw new Error("No submit button found");
const form = document.getElementById("login-form") as HTMLFormElement;
if (!form) {
throw new Error("No password form found");
}
submit.addEventListener("click", () => {
form.addEventListener("submit", (e) => {
e.preventDefault();
document.cookie = `password=${password.value}`;
location.reload();
});
@@ -38,4 +41,4 @@ const errorDisplay = document.getElementById("error-display") as HTMLDivElement;
if (document.referrer === document.location.href && matches) {
errorDisplay.innerText = "Password is incorrect!";
}
}

View File

@@ -136,12 +136,17 @@ interface ICommandRegistry {
registerCommand(command: ICommand): IDisposable;
}
interface IStorageService {
save(): Promise<void>;
}
declare namespace ide {
export const client: {};
export const workbench: {
readonly statusbarService: IStatusbarService;
readonly notificationService: INotificationService;
readonly storageService: IStorageService;
readonly menuRegistry: IMenuRegistry;
readonly commandRegistry: ICommandRegistry;

View File

@@ -1,6 +1,6 @@
{
"name": "@coder/ide-api",
"version": "1.0.3",
"version": "1.0.4",
"typings": "api.d.ts",
"author": "Coder",
"license": "MIT",

View File

@@ -41,7 +41,16 @@ export abstract class IdeClient {
});
this.sharedProcessData = new Promise((resolve): void => {
client.onSharedProcessActive(resolve);
let d = client.onSharedProcessActive((data) => {
d.dispose();
d = client.onSharedProcessActive(() => {
d.dispose();
this.retry.notificationService.error(
new Error("Disconnected from shared process. Searching, installing, enabling, and disabling extensions will not work until the page is refreshed."),
);
});
resolve(data);
});
});
window.addEventListener("contextmenu", (event) => {
@@ -65,10 +74,6 @@ export abstract class IdeClient {
});
}
/**
* Wrap a task in some logging, timing, and progress updates. Can optionally
* wait on other tasks which won't count towards this task's time.
*/
public async task<T>(description: string, duration: number, task: () => Promise<T>): Promise<T>;
public async task<T, V>(description: string, duration: number, task: (v: V) => Promise<T>, t: Promise<V>): Promise<T>;
public async task<T, V1, V2>(description: string, duration: number, task: (v1: V1, v2: V2) => Promise<T>, t1: Promise<V1>, t2: Promise<V2>): Promise<T>;
@@ -76,6 +81,10 @@ export abstract class IdeClient {
public async task<T, V1, V2, V3, V4>(description: string, duration: number, task: (v1: V1, v2: V2, v3: V3, v4: V4) => Promise<T>, t1: Promise<V1>, t2: Promise<V2>, t3: Promise<V3>, t4: Promise<V4>): Promise<T>;
public async task<T, V1, V2, V3, V4, V5>(description: string, duration: number, task: (v1: V1, v2: V2, v3: V3, v4: V4, v5: V5) => Promise<T>, t1: Promise<V1>, t2: Promise<V2>, t3: Promise<V3>, t4: Promise<V4>, t5: Promise<V5>): Promise<T>;
public async task<T, V1, V2, V3, V4, V5, V6>(description: string, duration: number, task: (v1: V1, v2: V2, v3: V3, v4: V4, v5: V5, v6: V6) => Promise<T>, t1: Promise<V1>, t2: Promise<V2>, t3: Promise<V3>, t4: Promise<V4>, t5: Promise<V5>, t6: Promise<V6>): Promise<T>;
/**
* Wrap a task in some logging, timing, and progress updates. Can optionally
* wait on other tasks which won't count towards this task's time.
*/
public async task<T>(
description: string, duration: number = 100, task: (...args: any[]) => Promise<T>, ...after: Array<Promise<any>> // tslint:disable-line no-any
): Promise<T> {

View File

@@ -132,7 +132,7 @@ export class Dialog {
public show(): void {
if (!this.cachedActiveElement) {
this.cachedActiveElement = document.activeElement as HTMLElement;
(document.getElementById("workbench.main.container") || document.body).appendChild(this.overlay);
(document.querySelector(".monaco-workbench") || document.body).appendChild(this.overlay);
document.addEventListener("keydown", this.onKeydown);
if (this.input) {
this.input.focus();

View File

@@ -45,7 +45,8 @@ const newCreateElement = <K extends keyof HTMLElementTagNameMap>(tagName: K): HT
},
set: (value: string): void => {
if (value) {
value = value.replace(/file:\/\//g, "/resource");
const resourceBaseUrl = location.pathname.replace(/\/$/, "") + "/resource";
value = value.replace(/file:\/\//g, resourceBaseUrl);
}
oldSrc!.set!.call(img, value);
},
@@ -66,7 +67,8 @@ const newCreateElement = <K extends keyof HTMLElementTagNameMap>(tagName: K): HT
},
set: (value: string): void => {
if (value) {
value = value.replace(/file:\/\//g, "/resource");
const resourceBaseUrl = location.pathname.replace(/\/$/, "") + "/resource";
value = value.replace(/file:\/\//g, resourceBaseUrl);
}
oldInnerHtml!.set!.call(style, value);
},
@@ -80,7 +82,8 @@ const newCreateElement = <K extends keyof HTMLElementTagNameMap>(tagName: K): HT
if (sheet && !overridden) {
const oldInsertRule = sheet.insertRule;
sheet.insertRule = (rule: string, index?: number): void => {
rule = rule.replace(/file:\/\//g, "/resource");
const resourceBaseUrl = location.pathname.replace(/\/$/, "") + "/resource";
rule = rule.replace(/file:\/\//g, resourceBaseUrl);
oldInsertRule.call(sheet, rule, index);
};
overridden = true;
@@ -137,12 +140,17 @@ const newCreateElement = <K extends keyof HTMLElementTagNameMap>(tagName: K): HT
};
},
});
view.src = require("!!file-loader?name=[path][name].[ext]!./webview.html");
Object.defineProperty(view, "src", {
set: (): void => { /* Nope. */ },
});
(view as any).getWebContents = (): void => undefined; // tslint:disable-line no-any
(view as any).send = (channel: string, ...args: any[]): void => { // tslint:disable-line no-any
if (args[0] && typeof args[0] === "object" && args[0].contents) {
// TODO
args[0].contents = (args[0].contents as string).replace(/"(file:\/\/[^"]*)"/g, (m1) => `"/resource${m1}"`);
args[0].contents = (args[0].contents as string).replace(/"vscode-resource:([^"]*)"/g, (m, m1) => `"/resource${m1}"`);
const resourceBaseUrl = location.pathname.replace(/\/$/, "") + "/resource";
args[0].contents = (args[0].contents as string).replace(/"(file:\/\/[^"]*)"/g, (m1) => `"${resourceBaseUrl}${m1}"`);
args[0].contents = (args[0].contents as string).replace(/"vscode-resource:([^"]*)"/g, (m, m1) => `"${resourceBaseUrl}${m1}"`);
args[0].contents = (args[0].contents as string).replace(/style-src vscode-core-resource:/g, "style-src 'self'");
}
if (view.contentWindow) {
@@ -178,6 +186,10 @@ class Clipboard {
public writeText(value: string): Promise<void> {
return clipboard.writeText(value);
}
public readText(): Promise<string> {
return clipboard.readText();
}
}
class Shell {

View File

@@ -0,0 +1,8 @@
<!DOCTYPE html>
<html lang="en" style="width: 100%; height: 100%">
<head>
<title>Virtual Document</title>
</head>
<body style="margin: 0; overflow: hidden; width: 100%; height: 100%">
</body>
</html>

View File

@@ -75,7 +75,7 @@ export class Retry {
// Times are in seconds.
private readonly retryMinDelay = 1;
private readonly retryMaxDelay = 10;
private readonly retryMaxDelay = 3;
private readonly maxImmediateRetries = 5;
private readonly retryExponent = 1.5;
private blocked: string | boolean | undefined;
@@ -147,7 +147,7 @@ export class Retry {
*
* Blocking without a name will override a block with a name.
*/
private block(name?: string): void {
public block(name?: string): void {
if (!this.blocked || !name) {
this.blocked = name || true;
this.items.forEach((item) => {

View File

@@ -317,17 +317,7 @@ export class FsModule {
}
class Stats implements fs.Stats {
public readonly atime: Date;
public readonly mtime: Date;
public readonly ctime: Date;
public readonly birthtime: Date;
public constructor(private readonly stats: IStats) {
this.atime = new Date(stats.atime);
this.mtime = new Date(stats.mtime);
this.ctime = new Date(stats.ctime);
this.birthtime = new Date(stats.birthtime);
}
public constructor(private readonly stats: IStats) {}
public get dev(): number { return this.stats.dev; }
public get ino(): number { return this.stats.ino; }
@@ -339,6 +329,10 @@ class Stats implements fs.Stats {
public get size(): number { return this.stats.size; }
public get blksize(): number { return this.stats.blksize; }
public get blocks(): number { return this.stats.blocks; }
public get atime(): Date { return this.stats.atime; }
public get mtime(): Date { return this.stats.mtime; }
public get ctime(): Date { return this.stats.ctime; }
public get birthtime(): Date { return this.stats.birthtime; }
public get atimeMs(): number { return this.stats.atimeMs; }
public get mtimeMs(): number { return this.stats.mtimeMs; }
public get ctimeMs(): number { return this.stats.ctimeMs; }

View File

@@ -45,4 +45,12 @@ export class SpdlogModule {
public setAsyncMode = (bufferSize: number, flushInterval: number): Promise<void> => {
return this.proxy.setAsyncMode(bufferSize, flushInterval);
}
public createRotatingLogger(name: string, filename: string, filesize: number, filecount: number): RotatingLogger {
return new RotatingLogger(this.proxy, name, filename, filesize, filecount);
}
public createRotatingLoggerAsync(name: string, filename: string, filesize: number, filecount: number): Promise<RotatingLogger> {
return Promise.resolve(this.createRotatingLogger(name, filename, filesize, filecount));
}
}

View File

@@ -53,6 +53,17 @@ export abstract class ClientProxy<T extends ServerProxy> extends EventEmitter {
}
}
/**
* Remove an event listener.
*/
public off(event: string, cb: (...args: any[]) => void): this {
// Fill it here because the fill we're using to provide EventEmitter for the
// browser doesn't appear to include `off`.
this.removeListener(event, cb);
return this;
}
protected get proxy(): T {
if (!this._proxy) {
throw new Error("not initialized");
@@ -158,8 +169,10 @@ export abstract class Batch<T, A> {
private readonly maxCount: number = 100,
/**
* Flush after not receiving more requests for this amount of time.
* This is pretty low by default so essentially we just end up batching
* requests that are all made at the same time.
*/
private readonly idleTime: number = 100,
private readonly idleTime: number = 1,
) {}
public add = (args: A): Promise<T> => {

View File

@@ -65,6 +65,11 @@ export const argumentToProto = (
const arg = new Argument.ProxyValue();
arg.setId(storeProxy(currentValue));
message.setProxy(arg);
} else if (currentValue instanceof Date
|| (currentValue && typeof currentValue.getTime === "function")) {
const arg = new Argument.DateValue();
arg.setDate(currentValue.toString());
message.setDate(arg);
} else if (currentValue !== null && typeof currentValue === "object") {
const arg = new Argument.ObjectValue();
const map = arg.getDataMap();
@@ -136,6 +141,8 @@ export const protoToArgument = (
}
return createProxy(currentMessage.getProxy()!.getId());
case Argument.MsgCase.DATE:
return new Date(currentMessage.getDate()!.getDate());
case Argument.MsgCase.OBJECT:
const obj: { [Key: string]: any } = {};
currentMessage.getObject()!.getDataMap().forEach((argument, key) => {

View File

@@ -24,10 +24,10 @@ export interface Stats {
mtimeMs: number;
ctimeMs: number;
birthtimeMs: number;
atime: Date | string;
mtime: Date | string;
ctime: Date | string;
birthtime: Date | string;
atime: Date;
mtime: Date;
ctime: Date;
birthtime: Date;
_isFile: boolean;
_isDirectory: boolean;
_isBlockDevice: boolean;

View File

@@ -317,6 +317,7 @@ export class Server {
logger.trace(() => [
"sending reject",
field("id", id) ,
field("message", error.message),
]);
const failedMessage = new Method.Fail();

View File

@@ -40,6 +40,10 @@ message Argument {
message UndefinedValue {}
message DateValue {
string date = 1;
}
oneof msg {
ErrorValue error = 1;
BufferValue buffer = 2;
@@ -52,6 +56,7 @@ message Argument {
double number = 9;
string string = 10;
bool boolean = 11;
DateValue date = 12;
}
}

View File

@@ -59,6 +59,11 @@ export class Argument extends jspb.Message {
getBoolean(): boolean;
setBoolean(value: boolean): void;
hasDate(): boolean;
clearDate(): void;
getDate(): Argument.DateValue | undefined;
setDate(value?: Argument.DateValue): void;
getMsgCase(): Argument.MsgCase;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): Argument.AsObject;
@@ -83,6 +88,7 @@ export namespace Argument {
number: number,
string: string,
pb_boolean: boolean,
date?: Argument.DateValue.AsObject,
}
export class ErrorValue extends jspb.Message {
@@ -248,6 +254,26 @@ export namespace Argument {
}
}
export class DateValue extends jspb.Message {
getDate(): string;
setDate(value: string): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): DateValue.AsObject;
static toObject(includeInstance: boolean, msg: DateValue): DateValue.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: DateValue, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): DateValue;
static deserializeBinaryFromReader(message: DateValue, reader: jspb.BinaryReader): DateValue;
}
export namespace DateValue {
export type AsObject = {
date: string,
}
}
export enum MsgCase {
MSG_NOT_SET = 0,
ERROR = 1,
@@ -261,6 +287,7 @@ export namespace Argument {
NUMBER = 9,
STRING = 10,
BOOLEAN = 11,
DATE = 12,
}
}

View File

@@ -14,6 +14,7 @@ var global = Function('return this')();
goog.exportSymbol('proto.Argument', null, global);
goog.exportSymbol('proto.Argument.ArrayValue', null, global);
goog.exportSymbol('proto.Argument.BufferValue', null, global);
goog.exportSymbol('proto.Argument.DateValue', null, global);
goog.exportSymbol('proto.Argument.ErrorValue', null, global);
goog.exportSymbol('proto.Argument.FunctionValue', null, global);
goog.exportSymbol('proto.Argument.NullValue', null, global);
@@ -223,6 +224,27 @@ if (goog.DEBUG && !COMPILED) {
*/
proto.Argument.UndefinedValue.displayName = 'proto.Argument.UndefinedValue';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.Argument.DateValue = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.Argument.DateValue, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.Argument.DateValue.displayName = 'proto.Argument.DateValue';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
@@ -505,7 +527,7 @@ if (goog.DEBUG && !COMPILED) {
* @private {!Array<!Array<number>>}
* @const
*/
proto.Argument.oneofGroups_ = [[1,2,3,4,5,6,7,8,9,10,11]];
proto.Argument.oneofGroups_ = [[1,2,3,4,5,6,7,8,9,10,11,12]];
/**
* @enum {number}
@@ -522,7 +544,8 @@ proto.Argument.MsgCase = {
UNDEFINED: 8,
NUMBER: 9,
STRING: 10,
BOOLEAN: 11
BOOLEAN: 11,
DATE: 12
};
/**
@@ -571,7 +594,8 @@ proto.Argument.toObject = function(includeInstance, msg) {
undefined: (f = msg.getUndefined()) && proto.Argument.UndefinedValue.toObject(includeInstance, f),
number: +jspb.Message.getFieldWithDefault(msg, 9, 0.0),
string: jspb.Message.getFieldWithDefault(msg, 10, ""),
pb_boolean: jspb.Message.getFieldWithDefault(msg, 11, false)
pb_boolean: jspb.Message.getFieldWithDefault(msg, 11, false),
date: (f = msg.getDate()) && proto.Argument.DateValue.toObject(includeInstance, f)
};
if (includeInstance) {
@@ -660,6 +684,11 @@ proto.Argument.deserializeBinaryFromReader = function(msg, reader) {
var value = /** @type {boolean} */ (reader.readBool());
msg.setBoolean(value);
break;
case 12:
var value = new proto.Argument.DateValue;
reader.readMessage(value,proto.Argument.DateValue.deserializeBinaryFromReader);
msg.setDate(value);
break;
default:
reader.skipField();
break;
@@ -774,6 +803,14 @@ proto.Argument.serializeBinaryToWriter = function(message, writer) {
f
);
}
f = message.getDate();
if (f != null) {
writer.writeMessage(
12,
f,
proto.Argument.DateValue.serializeBinaryToWriter
);
}
};
@@ -1837,6 +1874,131 @@ proto.Argument.UndefinedValue.serializeBinaryToWriter = function(message, writer
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto suitable for use in Soy templates.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
* for transitional soy proto support: http://goto/soy-param-migration
* @return {!Object}
*/
proto.Argument.DateValue.prototype.toObject = function(opt_includeInstance) {
return proto.Argument.DateValue.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Whether to include the JSPB
* instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.Argument.DateValue} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.Argument.DateValue.toObject = function(includeInstance, msg) {
var obj = {
date: jspb.Message.getFieldWithDefault(msg, 1, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.Argument.DateValue}
*/
proto.Argument.DateValue.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.Argument.DateValue;
return proto.Argument.DateValue.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.Argument.DateValue} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.Argument.DateValue}
*/
proto.Argument.DateValue.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setDate(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.Argument.DateValue.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.Argument.DateValue.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.Argument.DateValue} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.Argument.DateValue.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getDate();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
};
/**
* optional string date = 1;
* @return {string}
*/
proto.Argument.DateValue.prototype.getDate = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.Argument.DateValue.prototype.setDate = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional ErrorValue error = 1;
* @return {?proto.Argument.ErrorValue}
@@ -2199,6 +2361,39 @@ proto.Argument.prototype.hasBoolean = function() {
};
/**
* optional DateValue date = 12;
* @return {?proto.Argument.DateValue}
*/
proto.Argument.prototype.getDate = function() {
return /** @type{?proto.Argument.DateValue} */ (
jspb.Message.getWrapperField(this, proto.Argument.DateValue, 12));
};
/** @param {?proto.Argument.DateValue|undefined} value */
proto.Argument.prototype.setDate = function(value) {
jspb.Message.setOneofWrapperField(this, 12, proto.Argument.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
*/
proto.Argument.prototype.clearDate = function() {
this.setDate(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.Argument.prototype.hasDate = function() {
return jspb.Message.getField(this, 12) != null;
};
/**
* Oneof group definitions for this message. Each group defines the field

View File

@@ -53,6 +53,11 @@ describe("child_process", () => {
await expect(getStdout(proc)).resolves.toContain("hi=donkey\n");
});
it("should eval", async () => {
const proc = cp.spawn("node", ["-e", "console.log('foo')"]);
await expect(getStdout(proc)).resolves.toContain("foo");
});
});
describe("fork", () => {

View File

@@ -4,6 +4,8 @@ import * as util from "util";
import { Module } from "../src/common/proxy";
import { createClient, Helper } from "./helpers";
// tslint:disable deprecation to use fs.exists
describe("fs", () => {
const client = createClient();
// tslint:disable-next-line no-any
@@ -242,6 +244,14 @@ describe("fs", () => {
await util.promisify(nativeFs.close)(fd);
});
it("should futimes existing file with date", async () => {
const file = await helper.createTmpFile();
const fd = await util.promisify(nativeFs.open)(file, "w");
await expect(util.promisify(fs.futimes)(fd, new Date(), new Date()))
.resolves.toBeUndefined();
await util.promisify(nativeFs.close)(fd);
});
it("should fail to futimes nonexistent file", async () => {
await expect(util.promisify(fs.futimes)(99999, 9999, 9999))
.rejects.toThrow("EBADF");
@@ -346,7 +356,7 @@ describe("fs", () => {
it("should read existing file", async () => {
const fd = await util.promisify(nativeFs.open)(__filename, "r");
const stat = await util.promisify(nativeFs.fstat)(fd);
const buffer = new Buffer(stat.size);
const buffer = Buffer.alloc(stat.size);
let bytesRead = 0;
let chunkSize = 2048;
while (bytesRead < stat.size) {
@@ -364,7 +374,7 @@ describe("fs", () => {
});
it("should fail to read nonexistent file", async () => {
await expect(util.promisify(fs.read)(99999, new Buffer(10), 9999, 999, 999))
await expect(util.promisify(fs.read)(99999, Buffer.alloc(10), 9999, 999, 999))
.rejects.toThrow("EBADF");
});
});
@@ -466,6 +476,7 @@ describe("fs", () => {
expect(stat).toMatchObject({
size: nativeStat.size,
});
expect(typeof stat.mtime.getTime()).toBe("number");
expect(stat.isFile()).toBe(true);
});
@@ -493,7 +504,7 @@ describe("fs", () => {
const destination = helper.tmpFile();
await expect(util.promisify(fs.symlink)(source, destination))
.resolves.toBeUndefined();
expect(util.promisify(nativeFs.exists)(source))
await expect(util.promisify(nativeFs.exists)(source))
.resolves.toBe(true);
});
@@ -525,7 +536,7 @@ describe("fs", () => {
const file = await helper.createTmpFile();
await expect(util.promisify(fs.unlink)(file))
.resolves.toBeUndefined();
expect(util.promisify(nativeFs.exists)(file))
await expect(util.promisify(nativeFs.exists)(file))
.resolves.toBe(false);
});

View File

@@ -38,6 +38,23 @@ describe("net", () => {
expect(fn).toHaveBeenCalledTimes(1);
});
it("should remove event listener", async () => {
const socket = new net.Socket();
const fn1 = jest.fn();
const fn2 = jest.fn();
socket.on("error", fn1);
socket.on("error", fn2);
socket.off("error", fn1);
socket.connect("/tmp/t/e/s/t/d/o/e/s/n/o/t/e/x/i/s/t");
await new Promise((r): nativeNet.Socket => socket.on("close", r));
expect(fn1).toHaveBeenCalledTimes(0);
expect(fn2).toHaveBeenCalledTimes(1);
});
it("should connect", async () => {
await new Promise((resolve): void => {
const socket = net.createConnection(socketPath, () => {

View File

@@ -9,7 +9,7 @@
"build:binary": "ts-node scripts/nbin.ts"
},
"dependencies": {
"@coder/nbin": "^1.0.6",
"@coder/nbin": "^1.0.7",
"commander": "^2.19.0",
"express": "^4.16.4",
"express-static-gzip": "^1.1.3",

View File

@@ -200,7 +200,13 @@ const bold = (text: string | number): string | number => {
const webpackConfig = require(path.resolve(__dirname, "..", "..", "web", "webpack.config.js"));
const compiler = require("webpack")(webpackConfig);
app.use(require("webpack-dev-middleware")(compiler, {
logger,
logger: {
trace: (m: string): void => logger.trace("webpack", field("message", m)),
debug: (m: string): void => logger.debug("webpack", field("message", m)),
info: (m: string): void => logger.info("webpack", field("message", m)),
warn: (m: string): void => logger.warn("webpack", field("message", m)),
error: (m: string): void => logger.error("webpack", field("message", m)),
},
publicPath: webpackConfig.output.publicPath,
stats: webpackConfig.stats,
}));

View File

@@ -79,7 +79,11 @@ export const createPortScanner = (scanInterval: number = 5000): PortScanner => {
logger.trace("scanning ports");
scan((error) => {
if (error) {
logger.error(`Port scanning will not be available: ${error.message}.`);
if ((error as NodeJS.ErrnoException).code === "ENOENT") {
logger.warn("Port scanning will not be available because netstat is not installed");
} else {
logger.warn(`Port scanning will not be available: ${error.message}`);
}
disposed = true;
} else if (!disposed) {
lastTimeout = setTimeout(doInterval, scanInterval);

View File

@@ -271,7 +271,7 @@ export const createApp = async (options: CreateAppOptions): Promise<{
const body = data.join("");
await mkdirp(path.dirname(fullPath));
fs.writeFileSync(fullPath, body);
logger.debug("Wrote resource", field("path", fullPath), field("content-length", body.length));
logger.info("Wrote resource", field("path", fullPath), field("content-length", body.length));
res.status(200);
res.end();
});

View File

@@ -66,12 +66,6 @@ export class SharedProcess {
this.setState({ state: SharedProcessState.Starting });
const activeProcess = await this.restart();
activeProcess.stderr.on("data", (data) => {
// Warn instead of error to prevent panic. It's unlikely stderr here is
// about anything critical to the functioning of the editor.
logger.warn(data.toString());
});
activeProcess.on("exit", (exitCode) => {
const error = new Error(`Exited with ${exitCode}`);
this.setState({
@@ -132,6 +126,16 @@ export class SharedProcess {
activeProcess.on("error", doReject);
activeProcess.on("exit", doReject);
activeProcess.stdout.on("data", (data) => {
logger.trace(data.toString());
});
activeProcess.stderr.on("data", (data) => {
// Warn instead of error to prevent panic. It's unlikely stderr here is
// about anything critical to the functioning of the editor.
logger.warn(data.toString());
});
this.ipcHandler = new StdioIpcHandler(activeProcess);
this.ipcHandler.once("handshake:hello", () => {
const data: {

View File

@@ -7,10 +7,10 @@
resolved "https://registry.yarnpkg.com/@coder/logger/-/logger-1.0.3.tgz#e0e1ae5496fde5a3c6ef3d748fdfb26a55add8b8"
integrity sha512-1o5qDZX2VZUNnzgz5KfAdMnaqaX6FNeTs0dUdg73MRHfQW94tFTIryFC1xTTCuzxGDjVHOHkaUAI4uHA2bheOA==
"@coder/nbin@^1.0.6":
version "1.0.6"
resolved "https://registry.yarnpkg.com/@coder/nbin/-/nbin-1.0.6.tgz#6babfaad93b27eac66c1e6a3acb52135b00c5525"
integrity sha512-61niwcPQhZj1mNMyYEt7h62i2a9sg+XP6DmxUF09cZa4HsXPlspHIfoe9Oe3xa7lg7aP9s2Pg9KaYlaYr70Dcg==
"@coder/nbin@^1.0.7":
version "1.0.7"
resolved "https://registry.yarnpkg.com/@coder/nbin/-/nbin-1.0.7.tgz#fc6adeb8366bf9d7dc7c301ce0be9e741eccf14b"
integrity sha512-HkCFJnYyFuPaAjk6O8IcafEEBYlHG63SqxgwB0QSyUGwjq/hUekgB23BnKmywbcxNIuX26b9j2AGWt/DBdJlXA==
dependencies:
"@coder/logger" "^1.0.3"
fs-extra "^7.0.1"

View File

@@ -2,6 +2,7 @@
--primary: #2A2E37;
--border: black;
--faded: #a0a1a5;
--disabled: #888;
--header-background: #161616;
--header-foreground: white;
--list-active-selection-background: rgb(0, 120, 160);
@@ -101,6 +102,12 @@
background-color: var(--list-active-selection-background);
color: var(--list-active-selection-foreground);
}
&.disabled, &.disabled:hover {
background-color: var(--primary);
color: var(--disabled);
cursor: initial;
}
}
}
@@ -134,6 +141,11 @@
color: white;
}
}
button[disabled], button[disabled]:hover {
color: var(--disabled);
cursor: initial;
}
}
}

View File

@@ -16,6 +16,9 @@ import { IThemeService } from "vs/platform/theme/common/themeService";
import { workbench } from "./workbench";
import "./dialog.scss";
/**
* Describes the type of dialog to show.
*/
export enum DialogType {
NewFolder,
Save,
@@ -68,8 +71,12 @@ interface DialogEntry {
readonly isDirectory: boolean;
readonly size: number;
readonly lastModified: string;
readonly isDisabled?: boolean;
}
/**
* Open and save dialogs.
*/
class Dialog {
private _path: string | undefined;
@@ -108,7 +115,7 @@ class Dialog {
this.root.style.width = "850px";
this.root.style.height = "600px";
this.background.appendChild(this.root);
(document.getElementById("workbench.main.container") || document.body).appendChild(this.background);
(document.querySelector(".monaco-workbench") || document.body).appendChild(this.background);
this.root.classList.add("dialog");
const setProperty = (vari: string, id: string): void => {
@@ -265,8 +272,7 @@ class Dialog {
}
if (element.isDirectory) {
this.path = element.fullPath;
} else {
// Open
} else if (!(this.options as OpenDialogOptions).properties.openDirectory) {
this.selectEmitter.emit(element.fullPath);
}
});
@@ -282,12 +288,18 @@ class Dialog {
});
buttonsNode.appendChild(cancelBtn);
const confirmBtn = document.createElement("button");
confirmBtn.innerText = "Confirm";
const openFile = (this.options as OpenDialogOptions).properties.openFile;
confirmBtn.innerText = openFile ? "Open" : "Confirm";
confirmBtn.addEventListener("click", () => {
if (this._path) {
if (this._path && !openFile) {
this.selectEmitter.emit(this._path);
}
});
// Since a single click opens a file, the only time this button can be
// used is on a directory, which is invalid for opening files.
if (openFile) {
confirmBtn.disabled = true;
}
buttonsNode.appendChild(confirmBtn);
this.root.appendChild(buttonsNode);
this.entryList.layout();
@@ -303,6 +315,9 @@ class Dialog {
return this.errorEmitter.event;
}
/**
* Remove the dialog.
*/
public dispose(): void {
this.selectEmitter.dispose();
this.errorEmitter.dispose();
@@ -310,6 +325,9 @@ class Dialog {
this.background.remove();
}
/**
* Build and insert the path shown at the top of the dialog.
*/
private buildPath(): void {
while (this.pathNode.lastChild) {
this.pathNode.removeChild(this.pathNode.lastChild);
@@ -376,6 +394,9 @@ class Dialog {
return (<any>this.entryList).typeFilterController.filter._pattern;
}
/**
* List the files and return dialog entries.
*/
private async list(directory: string): Promise<ReadonlyArray<DialogEntry>> {
const paths = (await util.promisify(fs.readdir)(directory)).sort();
const stats = await Promise.all(paths.map(p => util.promisify(fs.stat)(path.join(directory, p))));
@@ -386,6 +407,8 @@ class Dialog {
isDirectory: stat.isDirectory(),
lastModified: stat.mtime.toDateString(),
size: stat.size,
// If we are opening a directory, show files as disabled.
isDisabled: !stat.isDirectory() && (this.options as OpenDialogOptions).properties.openDirectory,
}));
}
}
@@ -397,11 +420,17 @@ interface DialogEntryData {
label: HighlightedLabel;
}
/**
* Rendering for the different parts of a dialog entry.
*/
class DialogEntryRenderer implements ITreeRenderer<DialogEntry, string, DialogEntryData> {
public get templateId(): string {
return "dialog-entry";
}
/**
* Append and return containers for each part of the dialog entry.
*/
public renderTemplate(container: HTMLElement): DialogEntryData {
addClass(container, "dialog-entry");
addClass(container, "dialog-grid");
@@ -422,6 +451,9 @@ class DialogEntryRenderer implements ITreeRenderer<DialogEntry, string, DialogEn
};
}
/**
* Render a dialog entry.
*/
public renderElement(node: ITreeNode<DialogEntry, string>, _index: number, templateData: DialogEntryData): void {
templateData.icon.className = "dialog-entry-icon monaco-icon-label";
const classes = getIconClasses(
@@ -444,8 +476,19 @@ class DialogEntryRenderer implements ITreeRenderer<DialogEntry, string, DialogEn
}] : []);
templateData.size.innerText = node.element.size.toString();
templateData.lastModified.innerText = node.element.lastModified;
// We know this exists because we created the template.
const entryContainer = templateData.label.element.parentElement!.parentElement!.parentElement!;
if (node.element.isDisabled) {
entryContainer.classList.add("disabled");
} else {
entryContainer.classList.remove("disabled");
}
}
/**
* Does nothing (not implemented).
*/
public disposeTemplate(_templateData: DialogEntryData): void {
// throw new Error("Method not implemented.");
}

View File

@@ -1,19 +1,36 @@
import { logger } from "@coder/logger";
import { IDisposable } from "vs/base/common/lifecycle";
import * as actions from "vs/platform/actions/common/actions";
import { CloseWorkspaceAction } from "vs/workbench/browser/actions/workspaceActions";
import { OpenProcessExplorer } from "vs/workbench/contrib/issue/electron-browser/issueActions";
import { ToggleDevToolsAction } from "vs/workbench/electron-browser/actions/developerActions";
import { OpenPrivacyStatementUrlAction, OpenRequestFeatureUrlAction, OpenTwitterUrlAction } from "vs/workbench/electron-browser/actions/helpActions";
import { CloseCurrentWindowAction, NewWindowAction, ShowAboutDialogAction } from "vs/workbench/electron-browser/actions/windowActions";
const toSkip = [
ToggleDevToolsAction.ID,
OpenTwitterUrlAction.ID,
OpenPrivacyStatementUrlAction.ID,
ShowAboutDialogAction.ID,
OpenProcessExplorer.ID,
OpenRequestFeatureUrlAction.ID,
NewWindowAction.ID,
CloseCurrentWindowAction.ID,
CloseWorkspaceAction.ID,
// Unfortunately referenced as a string
"update.showCurrentReleaseNotes",
"workbench.action.openIssueReporter",
];
// Intercept appending menu items so we can skip items that won't work.
const originalAppend = actions.MenuRegistry.appendMenuItem.bind(actions.MenuRegistry);
actions.MenuRegistry.appendMenuItem = (id: actions.MenuId, item: actions.IMenuItem | actions.ISubmenuItem): IDisposable => {
if (actions.isIMenuItem(item)) {
switch (item.command.id) {
case ToggleDevToolsAction.ID: // There appears to be no way to toggle this programmatically.
logger.debug(`Skipping unsupported menu item ${item.command.id}`);
return {
dispose: (): void => undefined,
};
if (toSkip.indexOf(item.command.id) !== -1) {
// Skip instantiation
return {
dispose: (): void => undefined,
};
}
}

View File

@@ -2,8 +2,8 @@ import * as nls from "vs/nls";
import { Action } from "vs/base/common/actions";
import { TERMINAL_COMMAND_ID } from "vs/workbench/contrib/terminal/common/terminalCommands";
import { ITerminalService } from "vs/workbench/contrib/terminal/common/terminal";
import * as actions from "vs/workbench/contrib/terminal/electron-browser/terminalActions";
import * as instance from "vs/workbench/contrib/terminal/electron-browser/terminalInstance";
import * as actions from "vs/workbench/contrib/terminal/browser/terminalActions";
import * as instance from "vs/workbench/contrib/terminal/browser/terminalInstance";
import { client } from "../client";
const getLabel = (key: string, enabled: boolean): string => {

View File

@@ -4,6 +4,14 @@ import { IProductConfiguration } from "vs/platform/product/node/product";
class Product implements IProductConfiguration {
public nameShort = "code-server";
public nameLong = "code-server";
public documentationUrl = "https://code.visualstudio.com/docs";
public keyboardShortcutsUrlMac = "https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf";
public keyboardShortcutsUrlLinux = "https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdf";
public keyboardShortcutsUrlWin = "https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf";
public introductoryVideosUrl = "https://code.visualstudio.com/docs/getstarted/introvideos";
public tipsAndTricksUrl = "https://code.visualstudio.com/docs/getstarted/tips-and-tricks";
public twitterUrl = "https://twitter.com/code";
public licenseUrl = "https://github.com/codercom/code-server/blob/master/LICENSE";
private _dataFolderName: string | undefined;
public get dataFolderName(): string {

View File

@@ -11,6 +11,8 @@ import { IStorageService, WillSaveStateReason } from "vs/platform/storage/common
import * as paths from "./paths";
import { workbench } from "../workbench";
// tslint:disable completed-docs
class StorageDatabase implements workspaceStorage.IStorageDatabase {
public readonly onDidChangeItemsExternal = Event.None;
private readonly items = new Map<string, string>();
@@ -26,7 +28,8 @@ class StorageDatabase implements workspaceStorage.IStorageDatabase {
}
this.triggerFlush(WillSaveStateReason.SHUTDOWN);
navigator.sendBeacon(`/resource${this.path}`, this.content);
const resourceBaseUrl = location.pathname.replace(/\/$/, "") + "/resource";
navigator.sendBeacon(`${resourceBaseUrl}/${this.path}`, this.content);
});
}

View File

@@ -1,21 +1,32 @@
import * as electron from "electron";
import { Emitter } from "@coder/events";
import * as windowsIpc from "vs/platform/windows/node/windowsIpc";
import { IWindowsService, INativeOpenDialogOptions, MessageBoxOptions, SaveDialogOptions, OpenDialogOptions, IMessageBoxResult, IDevToolsOptions, IEnterWorkspaceResult, CrashReporterStartOptions, INewWindowOptions, IOpenFileRequest, IAddFoldersRequest } from "vs/platform/windows/common/windows";
import { logger } from "@coder/logger";
import { IWindowsService, INativeOpenDialogOptions, MessageBoxOptions, SaveDialogOptions, OpenDialogOptions, IMessageBoxResult, IDevToolsOptions, IEnterWorkspaceResult, CrashReporterStartOptions, INewWindowOptions, IOpenFileRequest, IAddFoldersRequest, IURIToOpen, IOpenSettings } from "vs/platform/windows/common/windows";
import { ParsedArgs } from "vs/platform/environment/common/environment";
import { IWorkspaceIdentifier, IWorkspaceFolderCreationData, ISingleFolderWorkspaceIdentifier } from "vs/platform/workspaces/common/workspaces";
import { URI } from "vs/base/common/uri";
import { IRecentlyOpened } from "vs/platform/history/common/history";
import { IRecentlyOpened, IRecent } from "vs/platform/history/common/history";
import { ISerializableCommandAction } from "vs/platform/actions/common/actions";
import { client } from "../client";
import { showOpenDialog } from "../dialog";
import { workbench } from "../workbench";
// tslint:disable completed-docs
// VS Code overrides window.open to call openExternal, but we then call
// window.open which results in an infinite loop. Store the function but also
// make it unable to be set (doesn't work otherwise).
const windowOpen = window.open;
Object.defineProperty(window, "open", {
set: (): void => { /* Not allowed. */ },
get: (): Function => windowOpen,
});
/**
* Instead of going to the shared process, we'll directly run these methods on
* the client. This setup means we can only control the current window.
*/
class WindowsService implements IWindowsService {
export class WindowsService implements IWindowsService {
// tslint:disable-next-line no-any
public _serviceBrand: any;
@@ -36,9 +47,9 @@ class WindowsService implements IWindowsService {
private readonly window = new electron.BrowserWindow();
// Dialogs
public async pickFileFolderAndOpen(_options: INativeOpenDialogOptions): Promise<void> {
public async pickFileFolderAndOpen(options: INativeOpenDialogOptions): Promise<void> {
showOpenDialog({
...(_options.dialogOptions || {}),
...(options.dialogOptions || {}),
properties: {
openFile: true,
openDirectory: true,
@@ -51,13 +62,13 @@ class WindowsService implements IWindowsService {
}],
} as IOpenFileRequest);
}).catch((ex) => {
//
logger.error(ex.message);
});
}
public async pickFileAndOpen(_options: INativeOpenDialogOptions): Promise<void> {
public async pickFileAndOpen(options: INativeOpenDialogOptions): Promise<void> {
showOpenDialog({
...(_options.dialogOptions || {}),
...(options.dialogOptions || {}),
properties: {
openFile: true,
},
@@ -69,26 +80,32 @@ class WindowsService implements IWindowsService {
}],
} as IOpenFileRequest);
}).catch((ex) => {
//
logger.error(ex.message);
});
}
public async pickFolderAndOpen(_options: INativeOpenDialogOptions): Promise<void> {
public async pickFolderAndOpen(options: INativeOpenDialogOptions): Promise<void> {
if (!options.dialogOptions) {
options.dialogOptions = {};
}
if (!options.dialogOptions.title) {
options.dialogOptions.title = "Open Folder";
}
showOpenDialog({
...(_options.dialogOptions || {}),
...(options.dialogOptions || {}),
properties: {
openDirectory: true,
},
}).then((path) => {
workbench.workspace = URI.file(path);
}).catch((ex) => {
//
logger.error(ex.message);
});
}
public async pickWorkspaceAndOpen(_options: INativeOpenDialogOptions): Promise<void> {
public async pickWorkspaceAndOpen(options: INativeOpenDialogOptions): Promise<void> {
showOpenDialog({
...(_options.dialogOptions || {}),
...(options.dialogOptions || {}),
properties: {
openDirectory: true,
},
@@ -98,7 +115,7 @@ class WindowsService implements IWindowsService {
foldersToAdd: [URI.file(path)],
} as IAddFoldersRequest);
}).catch((ex) => {
//
logger.error(ex.message);
});
}
@@ -121,16 +138,14 @@ class WindowsService implements IWindowsService {
});
}
public showOpenDialog(windowId: number, options: OpenDialogOptions): Promise<string[]> {
return showOpenDialog({
public async showOpenDialog(_windowId: number, options: OpenDialogOptions): Promise<string[]> {
return [await showOpenDialog({
...(options || {}),
properties: {
openDirectory: true,
openFile: true,
},
}).then((path) => {
return [path];
});
})];
}
public reloadWindow(windowId: number, _args?: ParsedArgs): Promise<void> {
@@ -149,14 +164,14 @@ class WindowsService implements IWindowsService {
throw new Error("not implemented");
}
public enterWorkspace(_windowId: number, _path: URI): Promise<IEnterWorkspaceResult> {
if (_path.path.endsWith(".json")) {
public enterWorkspace(_windowId: number, uri: URI): Promise<IEnterWorkspaceResult> {
if (uri.path.endsWith(".json")) {
workbench.workspace = {
id: "Untitled",
configPath: _path.path,
configPath: uri,
};
} else {
workbench.workspace = _path;
workbench.workspace = uri;
}
return undefined!;
@@ -180,7 +195,7 @@ class WindowsService implements IWindowsService {
return Promise.resolve(this.getWindowById(windowId).setRepresentedFilename(fileName));
}
public addRecentlyOpened(_files: URI[]): Promise<void> {
public addRecentlyOpened(_files: IRecent[]): Promise<void> {
throw new Error("not implemented");
}
@@ -284,7 +299,7 @@ class WindowsService implements IWindowsService {
}
// Global methods
public openWindow(_windowId: number, _paths: URI[], _options?: { forceNewWindow?: boolean, forceReuseWindow?: boolean, forceOpenWorkspaceAsFile?: boolean, args?: ParsedArgs }): Promise<void> {
public openWindow(_windowId: number, _uris: IURIToOpen[], _options?: IOpenSettings): Promise<void> {
throw new Error("not implemented");
}
@@ -308,8 +323,8 @@ class WindowsService implements IWindowsService {
throw new Error("not implemented");
}
public async showItemInFolder(_path: string): Promise<void> {
workbench.workspace = URI.file(_path);
public async showItemInFolder(uri: URI): Promise<void> {
workbench.workspace = uri;
}
public getActiveWindowId(): Promise<number | undefined> {
@@ -343,7 +358,3 @@ class WindowsService implements IWindowsService {
return this.window;
}
}
const target = windowsIpc as typeof windowsIpc;
// @ts-ignore TODO: don't ignore it.
target.WindowsChannelClient = WindowsService;

View File

@@ -5,7 +5,7 @@ import { IWorkbenchActionRegistry, Extensions } from "vs/workbench/common/action
import { SyncActionDescriptor } from "vs/platform/actions/common/actions";
import { ContextKeyExpr } from "vs/platform/contextkey/common/contextkey";
import { ToggleDevToolsAction } from "vs/workbench/electron-browser/actions/developerActions";
import { TerminalPasteAction } from "vs/workbench/contrib/terminal/electron-browser/terminalActions";
import { TerminalPasteAction } from "vs/workbench/contrib/terminal/browser/terminalActions";
import { KEYBINDING_CONTEXT_TERMINAL_FOCUS } from "vs/workbench/contrib/terminal/common/terminal";
import { KeyCode, KeyMod } from "vs/base/common/keyCodes";
import { workbench } from "../workbench";

View File

@@ -29,8 +29,6 @@ import { LogLevel } from "vs/platform/log/common/log";
import { RawContextKey, IContextKeyService } from "vs/platform/contextkey/common/contextkey";
import { ServiceCollection } from "vs/platform/instantiation/common/serviceCollection";
import { URI } from "vs/base/common/uri";
import { BackupMainService } from "vs/platform/backup/electron-main/backupMainService";
import { IInstantiationService } from "vs/platform/instantiation/common/instantiation";
/**
* Initializes VS Code and provides a way to call into general client
@@ -131,13 +129,12 @@ export class Workbench {
public set serviceCollection(collection: ServiceCollection) {
this._serviceCollection = collection;
// TODO: If possible it might be better to start the app from vs/code/electron-main/app.
// For now, manually initialize services from there as needed.
const inst = this._serviceCollection.get(IInstantiationService) as IInstantiationService;
const backupMainService = inst.createInstance(BackupMainService) as BackupMainService;
backupMainService.initialize().catch((error) => {
logger.error(error.message);
const contextKeys = this.serviceCollection.get(IContextKeyService) as IContextKeyService;
const bounded = this.clipboardContextKey.bindTo(contextKeys);
client.clipboard.onPermissionChange((enabled) => {
bounded.set(enabled);
});
client.clipboard.initialize();
client.progressService = {
start: <T>(title: string, task: (progress: IProgress) => Promise<T>, onCancel: () => void): Promise<T> => {
@@ -237,12 +234,6 @@ export class Workbench {
return;
}
}
const contextKeys = this.serviceCollection.get(IContextKeyService) as IContextKeyService;
const bounded = this.clipboardContextKey.bindTo(contextKeys);
client.clipboard.onPermissionChange((enabled) => {
bounded.set(enabled);
});
client.clipboard.initialize();
}
}

View File

@@ -36,7 +36,8 @@ module.exports = merge(
loader: "ignore-loader",
}],
}, {
test: /((\\|\/)vs(\\|\/)code(\\|\/)electron-main(\\|\/))|((\\|\/)test(\\|\/))|(OSSREADME\.json$)|\/browser\//,
// The only thing we need in electron-browser is the shared process (including contrib).
test: /((\\|\/)vs(\\|\/)code(\\|\/)electron-main(\\|\/))|((\\|\/)test(\\|\/))|(OSSREADME\.json$)|\/browser\/|\/electron-browser\/(?!sharedProcess\/).+\//,
use: [{
loader: "ignore-loader",
}],
@@ -50,6 +51,7 @@ module.exports = merge(
"windows-mutex": path.resolve(fills, "empty.ts"),
"windows-process-tree": path.resolve(fills, "empty.ts"),
"vscode-windows-registry": path.resolve(fills, "empty.ts"),
"vscode-windows-ca-certs": path.resolve(fills, "empty.ts"),
"vscode-sqlite3": path.resolve(fills, "empty.ts"),
"vs/base/browser/browser": path.resolve(fills, "empty.ts"),

View File

@@ -70,6 +70,7 @@ module.exports = merge(
// This seems to be in the wrong place?
"vs/workbench/contrib/codeEditor/electron-browser/media/WordWrap_16x.svg": "vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/WordWrap_16x.svg",
"vs/platform/windows/electron-browser/windowsService": path.join(vsFills, "windowsService.ts"),
"vs/base/node/paths": path.join(vsFills, "paths.ts"),
"vs/base/common/amd": path.join(vsFills, "amd.ts"),
"vs/platform/product/node/package": path.resolve(vsFills, "package.ts"),

View File

@@ -1,5 +1,5 @@
diff --git a/src/vs/base/browser/browser.ts b/src/vs/base/browser/browser.ts
index c092106..66f1934 100644
index 16414ef..3006e05 100644
--- a/src/vs/base/browser/browser.ts
+++ b/src/vs/base/browser/browser.ts
@@ -125,0 +126,4 @@ export const isEdgeWebView = isEdge && (userAgent.indexOf('WebView/') >= 0);
@@ -24,45 +24,36 @@ index 03bdffc..d72c168 100644
-const metaKeyMod = (platform.isMacintosh ? KeyMod.CtrlCmd : KeyMod.WinCtrl);
+const metaKeyMod = (browser.isMacintosh ? KeyMod.CtrlCmd : KeyMod.WinCtrl);
diff --git a/src/vs/base/browser/ui/aria/aria.ts b/src/vs/base/browser/ui/aria/aria.ts
index 1922450..9900776 100644
index fc71827..c8ed796 100644
--- a/src/vs/base/browser/ui/aria/aria.ts
+++ b/src/vs/base/browser/ui/aria/aria.ts
@@ -8 +8 @@ import * as nls from 'vs/nls';
-import { isMacintosh } from 'vs/base/common/platform';
+import { isMacintosh } from 'vs/base/browser/browser';
diff --git a/src/vs/base/browser/ui/list/listWidget.ts b/src/vs/base/browser/ui/list/listWidget.ts
index cd73128..b1246de 100644
index 0869c52..4bd0813 100644
--- a/src/vs/base/browser/ui/list/listWidget.ts
+++ b/src/vs/base/browser/ui/list/listWidget.ts
@@ -13 +13 @@ import * as DOM from 'vs/base/browser/dom';
-import * as platform from 'vs/base/common/platform';
+import * as browser from 'vs/base/browser/browser';
@@ -253 +253 @@ class KeyboardController<T> implements IDisposable {
@@ -256 +256 @@ class KeyboardController<T> implements IDisposable {
- onKeyDown.filter(e => (platform.isMacintosh ? e.metaKey : e.ctrlKey) && e.keyCode === KeyCode.KEY_A).on(this.onCtrlA, this, this.disposables);
+ onKeyDown.filter(e => (browser.isMacintosh ? e.metaKey : e.ctrlKey) && e.keyCode === KeyCode.KEY_A).on(this.onCtrlA, this, this.disposables);
@@ -491 +491 @@ export function isSelectionSingleChangeEvent(event: IListMouseEvent<any> | IList
@@ -494 +494 @@ export function isSelectionSingleChangeEvent(event: IListMouseEvent<any> | IList
- return platform.isMacintosh ? event.browserEvent.metaKey : event.browserEvent.ctrlKey;
+ return browser.isMacintosh ? event.browserEvent.metaKey : event.browserEvent.ctrlKey;
@@ -553 +553 @@ export class MouseController<T> implements IDisposable {
@@ -556 +556 @@ export class MouseController<T> implements IDisposable {
- return platform.isMacintosh ? event.browserEvent.metaKey : event.browserEvent.ctrlKey;
+ return browser.isMacintosh ? event.browserEvent.metaKey : event.browserEvent.ctrlKey;
diff --git a/src/vs/base/browser/ui/menu/menu.ts b/src/vs/base/browser/ui/menu/menu.ts
index 47da5e4..fbf7e22 100644
--- a/src/vs/base/browser/ui/menu/menu.ts
+++ b/src/vs/base/browser/ui/menu/menu.ts
@@ -23,2 +23,3 @@ import { isLinux } from 'vs/base/common/platform';
-export const MENU_MNEMONIC_REGEX: RegExp = /\(&([^\s&])\)|(?<!&)&([^\s&])/;
-export const MENU_ESCAPED_MNEMONIC_REGEX: RegExp = /(?<!&amp;)(?:&amp;)([^\s&])/;
+// Not all browsers support negative lookbehinds. We don't support mnemonics currently anyway.
+export const MENU_MNEMONIC_REGEX: RegExp = /&([^\s&])/; ///\(&([^\s&])\)|(?<!&)&([^\s&])/;
+export const MENU_ESCAPED_MNEMONIC_REGEX: RegExp = /&amp;([^\s&])/; // /(?<!&amp;)(?:&amp;)([^\s&])/;
diff --git a/src/vs/base/browser/ui/sash/sash.ts b/src/vs/base/browser/ui/sash/sash.ts
index 8c7168b..8bbea63 100644
index 8c7168b..6b34122 100644
--- a/src/vs/base/browser/ui/sash/sash.ts
+++ b/src/vs/base/browser/ui/sash/sash.ts
@@ -9 +9 @@ import { isIPad } from 'vs/base/browser/browser';
@@ -8,2 +8 @@ import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle';
-import { isIPad } from 'vs/base/browser/browser';
-import { isMacintosh } from 'vs/base/common/platform';
+import { isMacintosh } from 'vs/base/browser/browser';
+import { isIPad, isMacintosh } from 'vs/base/browser/browser';
diff --git a/src/vs/base/browser/ui/scrollbar/scrollableElement.ts b/src/vs/base/browser/ui/scrollbar/scrollableElement.ts
index 9b31c84..51de0ea 100644
--- a/src/vs/base/browser/ui/scrollbar/scrollableElement.ts
@@ -80,28 +71,28 @@ index 9b31c84..51de0ea 100644
- if (platform.isMacintosh) {
+ if (browser.isMacintosh) {
diff --git a/src/vs/base/browser/ui/selectBox/selectBox.ts b/src/vs/base/browser/ui/selectBox/selectBox.ts
index 0e7314f..814fb0a 100644
index d74c30c..ac39ce3 100644
--- a/src/vs/base/browser/ui/selectBox/selectBox.ts
+++ b/src/vs/base/browser/ui/selectBox/selectBox.ts
@@ -16 +16 @@ import { SelectBoxList } from 'vs/base/browser/ui/selectBox/selectBoxCustom';
-import { isMacintosh } from 'vs/base/common/platform';
+import { isMacintosh } from 'vs/base/browser/browser';
diff --git a/src/vs/base/browser/ui/selectBox/selectBoxCustom.ts b/src/vs/base/browser/ui/selectBox/selectBoxCustom.ts
index 0ddce2d..cc2fd1b 100644
index 8908d68..35dae2d 100644
--- a/src/vs/base/browser/ui/selectBox/selectBoxCustom.ts
+++ b/src/vs/base/browser/ui/selectBox/selectBoxCustom.ts
@@ -20 +20 @@ import { ISelectBoxDelegate, ISelectOptionItem, ISelectBoxOptions, ISelectBoxSty
-import { isMacintosh } from 'vs/base/common/platform';
+import { isMacintosh } from 'vs/base/browser/browser';
diff --git a/src/vs/base/browser/ui/selectBox/selectBoxNative.ts b/src/vs/base/browser/ui/selectBox/selectBoxNative.ts
index 01f59d4..453d5c4 100644
index 98dee79..09c0467 100644
--- a/src/vs/base/browser/ui/selectBox/selectBoxNative.ts
+++ b/src/vs/base/browser/ui/selectBox/selectBoxNative.ts
@@ -12 +12 @@ import { ISelectBoxDelegate, ISelectOptionItem, ISelectBoxOptions, ISelectBoxSty
-import { isMacintosh } from 'vs/base/common/platform';
+import { isMacintosh } from 'vs/base/browser/browser';
diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts
index 2283978..26c2dee 100644
index f68ae90..d6b9ea7 100644
--- a/src/vs/base/browser/ui/tree/abstractTree.ts
+++ b/src/vs/base/browser/ui/tree/abstractTree.ts
@@ -24 +24 @@ import { disposableTimeout } from 'vs/base/common/async';
@@ -130,31 +121,37 @@ index f91ca2b..ef6fce9 100644
- const isMac = platform.isMacintosh;
+ const isMac = browser.isMacintosh;
diff --git a/src/vs/code/electron-browser/issue/issueReporterMain.ts b/src/vs/code/electron-browser/issue/issueReporterMain.ts
index ca5ed69..945b281 100644
index f08c996..f9de58c 100644
--- a/src/vs/code/electron-browser/issue/issueReporterMain.ts
+++ b/src/vs/code/electron-browser/issue/issueReporterMain.ts
@@ -423 +423 @@ export class IssueReporter extends Disposable {
@@ -425 +425 @@ export class IssueReporter extends Disposable {
- const cmdOrCtrlKey = platform.isMacintosh ? e.metaKey : e.ctrlKey;
+ const cmdOrCtrlKey = browser.isMacintosh ? e.metaKey : e.ctrlKey;
@@ -457 +457 @@ export class IssueReporter extends Disposable {
@@ -459 +459 @@ export class IssueReporter extends Disposable {
- if (platform.isMacintosh) {
+ if (browser.isMacintosh) {
diff --git a/src/vs/code/electron-browser/processExplorer/processExplorerMain.ts b/src/vs/code/electron-browser/processExplorer/processExplorerMain.ts
index ce8c65f..c31a6d3 100644
index e0ff793..885de12 100644
--- a/src/vs/code/electron-browser/processExplorer/processExplorerMain.ts
+++ b/src/vs/code/electron-browser/processExplorer/processExplorerMain.ts
@@ -304 +304 @@ export function startup(data: ProcessExplorerData): void {
- const cmdOrCtrlKey = platform.isMacintosh ? e.metaKey : e.ctrlKey;
+ const cmdOrCtrlKey = browser.isMacintosh ? e.metaKey : e.ctrlKey;
diff --git a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts
index 25de96d..66e732e 100644
index 6fd8249..039d31a 100644
--- a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts
+++ b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts
@@ -195,0 +196,2 @@ async function handshake(configuration: ISharedProcessConfiguration): Promise<vo
@@ -50,0 +51 @@ import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiatio
+import { BackupMainService } from 'vs/platform/backup/electron-main/backupMainService';
@@ -120,0 +122,3 @@ function main(server: Server, initData: ISharedProcessInitData, configuration: I
+ const backupMainService = instantiationService.createInstance(BackupMainService) as BackupMainService;
+ backupMainService.initialize().catch(console.error);
+
@@ -223,0 +228,2 @@ async function handshake(configuration: ISharedProcessConfiguration): Promise<vo
+
+startup({ machineId: "1" });
diff --git a/src/vs/editor/browser/config/configuration.ts b/src/vs/editor/browser/config/configuration.ts
index f4a579b..aa3c6d9 100644
index f97a692..0206957 100644
--- a/src/vs/editor/browser/config/configuration.ts
+++ b/src/vs/editor/browser/config/configuration.ts
@@ -10 +9,0 @@ import { Disposable } from 'vs/base/common/lifecycle';
@@ -163,14 +160,14 @@ index f4a579b..aa3c6d9 100644
-import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
@@ -18,0 +17 @@ import { IAccessibilityService } from 'vs/platform/accessibility/common/accessib
+import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
@@ -353 +352 @@ export class Configuration extends CommonEditorConfiguration {
@@ -367 +366 @@ export class Configuration extends CommonEditorConfiguration {
- if (platform.isMacintosh) {
+ if (browser.isMacintosh) {
@@ -364 +363 @@ export class Configuration extends CommonEditorConfiguration {
@@ -378 +377 @@ export class Configuration extends CommonEditorConfiguration {
- emptySelectionClipboard: browser.isWebKit || browser.isFirefox,
+ emptySelectionClipboard: false, // browser.isWebKit || browser.isFirefox,
diff --git a/src/vs/editor/browser/controller/mouseHandler.ts b/src/vs/editor/browser/controller/mouseHandler.ts
index 1a8af35..fe56af9 100644
index b3b4472..f888d63 100644
--- a/src/vs/editor/browser/controller/mouseHandler.ts
+++ b/src/vs/editor/browser/controller/mouseHandler.ts
@@ -222 +222 @@ export class MouseHandler extends ViewEventHandler {
@@ -184,21 +181,21 @@ index be5583d..c0e4f2e 100644
- if (platform.isMacintosh) {
+ if (browser.isMacintosh) {
diff --git a/src/vs/editor/browser/controller/textAreaInput.ts b/src/vs/editor/browser/controller/textAreaInput.ts
index 7ccf0e9..8c30ca2 100644
index bc986fa..63c6d79 100644
--- a/src/vs/editor/browser/controller/textAreaInput.ts
+++ b/src/vs/editor/browser/controller/textAreaInput.ts
@@ -262 +262 @@ export class TextAreaInput extends Disposable {
@@ -263 +263 @@ export class TextAreaInput extends Disposable {
- const [newState, typeInput] = deduceInputFromTextAreaValue(/*couldBeEmojiInput*/platform.isMacintosh, /*couldBeTypingAtOffset0*/previousEventWasFocus && platform.isMacintosh);
+ const [newState, typeInput] = deduceInputFromTextAreaValue(/*couldBeEmojiInput*/browser.isMacintosh, /*couldBeTypingAtOffset0*/previousEventWasFocus && browser.isMacintosh);
diff --git a/src/vs/editor/common/config/commonEditorConfig.ts b/src/vs/editor/common/config/commonEditorConfig.ts
index fa004fb..6420078 100644
index 7571c59..7f5689a 100644
--- a/src/vs/editor/common/config/commonEditorConfig.ts
+++ b/src/vs/editor/common/config/commonEditorConfig.ts
@@ -392 +392 @@ const editorConfiguration: IConfigurationNode = {
@@ -395 +395 @@ const editorConfiguration: IConfigurationNode = {
- 'included': platform.isMacintosh
+ 'included': platform.isNative && platform.isMacintosh
diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts
index 934e908..bd6fd88 100644
index 85b823f..7da04c6 100644
--- a/src/vs/editor/common/config/editorOptions.ts
+++ b/src/vs/editor/common/config/editorOptions.ts
@@ -6 +6 @@
@@ -206,20 +203,20 @@ index 934e908..bd6fd88 100644
+import * as browser from 'vs/base/browser/browser';
@@ -13,0 +14 @@ import { USUAL_WORD_SEPARATORS } from 'vs/editor/common/model/wordHelper';
+import * as nls from 'vs/nls';
@@ -1765 +1766 @@ export class EditorOptionsValidator {
@@ -1803 +1804 @@ export class EditorOptionsValidator {
- configuredMulticursorModifier = platform.isMacintosh ? 'metaKey' : 'ctrlKey';
+ configuredMulticursorModifier = browser.isMacintosh ? 'metaKey' : 'ctrlKey';
@@ -2530 +2531 @@ export const EDITOR_FONT_DEFAULTS = {
@@ -2578 +2579 @@ export const EDITOR_FONT_DEFAULTS = {
- platform.isMacintosh ? DEFAULT_MAC_FONT_FAMILY : (platform.isLinux ? DEFAULT_LINUX_FONT_FAMILY : DEFAULT_WINDOWS_FONT_FAMILY)
+ browser.isMacintosh ? DEFAULT_MAC_FONT_FAMILY : (platform.isLinux ? DEFAULT_LINUX_FONT_FAMILY : DEFAULT_WINDOWS_FONT_FAMILY)
@@ -2534 +2535 @@ export const EDITOR_FONT_DEFAULTS = {
@@ -2582 +2583 @@ export const EDITOR_FONT_DEFAULTS = {
- platform.isMacintosh ? 12 : 14
+ browser.isMacintosh ? 12 : 14
@@ -2640 +2641 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
@@ -2688 +2689 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
- selectionClipboard: true,
+ selectionClipboard: false,
diff --git a/src/vs/editor/common/config/fontInfo.ts b/src/vs/editor/common/config/fontInfo.ts
index 88cb52a..c4a1be9 100644
index c69ea3f..b8d87f7 100644
--- a/src/vs/editor/common/config/fontInfo.ts
+++ b/src/vs/editor/common/config/fontInfo.ts
@@ -6 +6 @@
@@ -229,7 +226,7 @@ index 88cb52a..c4a1be9 100644
-const GOLDEN_LINE_HEIGHT_RATIO = platform.isMacintosh ? 1.5 : 1.35;
+const GOLDEN_LINE_HEIGHT_RATIO = browser.isMacintosh ? 1.5 : 1.35;
diff --git a/src/vs/editor/contrib/clipboard/clipboard.ts b/src/vs/editor/contrib/clipboard/clipboard.ts
index 5e43f1b..2244391 100644
index 990be3a..8a326c6 100644
--- a/src/vs/editor/contrib/clipboard/clipboard.ts
+++ b/src/vs/editor/contrib/clipboard/clipboard.ts
@@ -29 +29,2 @@ const supportsCopyWithSyntaxHighlighting = (supportsCopy && !browser.isEdgeOrIE)
@@ -261,7 +258,7 @@ index 5e43f1b..2244391 100644
+ }
+ }
diff --git a/src/vs/editor/contrib/dnd/dnd.ts b/src/vs/editor/contrib/dnd/dnd.ts
index caa3ea7..e32371f 100644
index 44a5dd5..9083efb 100644
--- a/src/vs/editor/contrib/dnd/dnd.ts
+++ b/src/vs/editor/contrib/dnd/dnd.ts
@@ -9 +9 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle';
@@ -278,7 +275,7 @@ index 3b72a01..0d723f5 100644
- if (platform.isMacintosh) {
+ if (browser.isMacintosh) {
diff --git a/src/vs/editor/contrib/links/links.ts b/src/vs/editor/contrib/links/links.ts
index 972a60c..453ad61 100644
index b3c5f8d..db4a359 100644
--- a/src/vs/editor/contrib/links/links.ts
+++ b/src/vs/editor/contrib/links/links.ts
@@ -13 +13 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle';
@@ -297,13 +294,13 @@ index 972a60c..453ad61 100644
- platform.isMacintosh
+ browser.isMacintosh
diff --git a/src/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.ts b/src/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.ts
index cacc646..459fedd 100644
index 4bde524..0b18c35 100644
--- a/src/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.ts
+++ b/src/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.ts
@@ -262 +262 @@ class AccessibilityHelpWidget extends Widget implements IOverlayWidget {
@@ -257 +257 @@ class AccessibilityHelpWidget extends Widget implements IOverlayWidget {
- platform.isMacintosh
+ browser.isMacintosh
@@ -291 +291 @@ class AccessibilityHelpWidget extends Widget implements IOverlayWidget {
@@ -282 +282 @@ class AccessibilityHelpWidget extends Widget implements IOverlayWidget {
- platform.isMacintosh
+ browser.isMacintosh
diff --git a/src/vs/loader.js b/src/vs/loader.js
@@ -343,71 +340,94 @@ index 9952574..908a9ae 100644
-import { isMacintosh } from 'vs/base/common/platform';
+import { isMacintosh } from 'vs/base/browser/browser';
diff --git a/src/vs/platform/windows/common/windows.ts b/src/vs/platform/windows/common/windows.ts
index e28ca55..e8a4cd0 100644
index cbc55b3..9d27c01 100644
--- a/src/vs/platform/windows/common/windows.ts
+++ b/src/vs/platform/windows/common/windows.ts
@@ -9 +9 @@ import { ITelemetryData } from 'vs/platform/telemetry/common/telemetry';
-import { IProcessEnvironment, isMacintosh, isLinux } from 'vs/base/common/platform';
+import { IProcessEnvironment, isMacintosh, isLinux, isWeb } from 'vs/base/common/platform';
@@ -260,0 +261 @@ export function getTitleBarStyle(configurationService: IConfigurationService, en
@@ -262,0 +263 @@ export function getTitleBarStyle(configurationService: IConfigurationService, en
+ if (isWeb) { return 'custom'; }
diff --git a/src/vs/workbench/api/electron-browser/mainThreadHeapService.ts b/src/vs/workbench/api/electron-browser/mainThreadHeapService.ts
index 1b5d15e..f0ce325 100644
--- a/src/vs/workbench/api/electron-browser/mainThreadHeapService.ts
+++ b/src/vs/workbench/api/electron-browser/mainThreadHeapService.ts
@@ -49,0 +50 @@ export class HeapService implements IHeapService {
+ return; // Cannot control GC in the browser.
diff --git a/src/vs/workbench/api/node/extHostExtensionService.ts b/src/vs/workbench/api/node/extHostExtensionService.ts
index 58ba2e5..4fb6272 100644
index 25e74c8..0bed89e 100644
--- a/src/vs/workbench/api/node/extHostExtensionService.ts
+++ b/src/vs/workbench/api/node/extHostExtensionService.ts
@@ -774 +774 @@ function loadCommonJSModule<T>(logService: ILogService, modulePath: string, acti
@@ -769 +769 @@ function loadCommonJSModule<T>(logService: ILogService, modulePath: string, acti
- r = require.__$__nodeRequire<T>(modulePath);
+ r = (global as any).nativeNodeRequire(modulePath);
diff --git a/src/vs/workbench/api/node/extHostTypeConverters.ts b/src/vs/workbench/api/node/extHostTypeConverters.ts
index a445750..c64712b 100644
index 84406b8..cffd952 100644
--- a/src/vs/workbench/api/node/extHostTypeConverters.ts
+++ b/src/vs/workbench/api/node/extHostTypeConverters.ts
@@ -26 +25,0 @@ import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/node/extHostDocumen
-import { isString, isNumber } from 'vs/base/common/types';
@@ -31 +29,0 @@ import { LogLevel as _MainLogLevel } from 'vs/platform/log/common/log';
-import { coalesce } from 'vs/base/common/arrays';
@@ -116,0 +115,2 @@ export namespace Diagnostic {
@@ -117,0 +116,2 @@ export namespace Diagnostic {
+ const { isString, isNumber } = require('vs/base/common/types');
+ const { coalesce } = require('vs/base/common/arrays');
diff --git a/src/vs/workbench/browser/dnd.ts b/src/vs/workbench/browser/dnd.ts
index 5897ab9..57b926e 100644
index 7b6ad89..3190356 100644
--- a/src/vs/workbench/browser/dnd.ts
+++ b/src/vs/workbench/browser/dnd.ts
@@ -168 +168 @@ export class ResourcesDropHandler {
@@ -170 +170 @@ export class ResourcesDropHandler {
- return;
+ return (require('vs/../../../../packages/vscode/src/workbench') as typeof import ('vs/../../../../packages/vscode/src/workbench')).workbench.handleDrop(event, resolveTargetGroup, afterDrop, targetIndex);
diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts
index 819bb31..de69133 100644
index c25c940..9f11d98 100644
--- a/src/vs/workbench/browser/layout.ts
+++ b/src/vs/workbench/browser/layout.ts
@@ -15 +15 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
@@ -12 +12 @@ import { Registry } from 'vs/platform/registry/common/platform';
-import { isWindows, isLinux, isMacintosh } from 'vs/base/common/platform';
+import { isWindows, isLinux, isMacintosh, isNative, isWeb } from 'vs/base/common/platform';
@@ -210 +210 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
- if ((isWindows || isLinux) && getTitleBarStyle(this.configurationService, this.environmentService) === 'custom') {
+ if ((isWeb || isWindows || isLinux) && getTitleBarStyle(this.configurationService, this.environmentService) === 'custom') {
@@ -535 +535 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
- } else if (isMacintosh) {
+ } else if (isNative && isMacintosh) {
@@ -567 +567 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
- if (isMacintosh || this.state.menuBar.visibility === 'hidden') {
+ if ((isNative && isMacintosh) || this.state.menuBar.visibility === 'hidden') {
diff --git a/src/vs/workbench/browser/legacyLayout.ts b/src/vs/workbench/browser/legacyLayout.ts
index 53e73ac..0e24627 100644
--- a/src/vs/workbench/browser/legacyLayout.ts
+++ b/src/vs/workbench/browser/legacyLayout.ts
@@ -13 +13 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
-import { isMacintosh } from 'vs/base/common/platform';
+import { isNative, isMacintosh } from 'vs/base/common/platform';
@@ -29 +29 @@ import { getZoomFactor } from 'vs/base/browser/browser';
+import { isMacintosh, isNative } from 'vs/base/common/platform';
@@ -20 +20 @@ import { Part } from 'vs/workbench/browser/part';
-const TITLE_BAR_HEIGHT = isMacintosh ? 22 : 30;
+const TITLE_BAR_HEIGHT = isNative && isMacintosh ? 22 : 30;
@@ -413 +413 @@ export class WorkbenchLegacyLayout extends Disposable implements IVerticalSashLa
- this.titlebarHeight = isTitlebarHidden ? 0 : this.partLayoutInfo.titlebar.height / (isMacintosh || !menubarVisibility || menubarVisibility === 'hidden' ? getZoomFactor() : 1); // adjust for zoom prevention
+ this.titlebarHeight = isTitlebarHidden ? 0 : this.partLayoutInfo.titlebar.height / ((isNative && isMacintosh) || !menubarVisibility || menubarVisibility === 'hidden' ? getZoomFactor() : 1); // adjust for zoom prevention
diff --git a/src/vs/workbench/browser/parts/editor/editor.contribution.ts b/src/vs/workbench/browser/parts/editor/editor.contribution.ts
index 5c1e6ef..dd79592 100644
index df1ac8e..b86ab6a 100644
--- a/src/vs/workbench/browser/parts/editor/editor.contribution.ts
+++ b/src/vs/workbench/browser/parts/editor/editor.contribution.ts
@@ -48 +48 @@ import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
-import { isMacintosh } from 'vs/base/common/platform';
+import { isMacintosh } from 'vs/base/browser/browser';
diff --git a/src/vs/workbench/browser/parts/editor/editorDropTarget.ts b/src/vs/workbench/browser/parts/editor/editorDropTarget.ts
index 52272c0..77d447d 100644
index acf2522..feebe63 100644
--- a/src/vs/workbench/browser/parts/editor/editorDropTarget.ts
+++ b/src/vs/workbench/browser/parts/editor/editorDropTarget.ts
@@ -14 +14 @@ import { IEditorIdentifier, EditorInput, EditorOptions } from 'vs/workbench/comm
-import { isMacintosh } from 'vs/base/common/platform';
+import { isMacintosh } from 'vs/base/browser/browser';
diff --git a/src/vs/workbench/browser/parts/editor/editorGroupView.ts b/src/vs/workbench/browser/parts/editor/editorGroupView.ts
index 50977a6..81e4fc0 100644
--- a/src/vs/workbench/browser/parts/editor/editorGroupView.ts
+++ b/src/vs/workbench/browser/parts/editor/editorGroupView.ts
@@ -1499 +1499 @@ registerThemingParticipant((theme, collector, environment) => {
- const letterpress = `./media/letterpress${theme.type === 'dark' ? '-dark' : theme.type === 'hc' ? '-hc' : ''}.svg`;
+ const letterpress = theme.type === 'dark' ? require.toUrl('./media/letterpress-dark.svg') : theme.type === 'hc' ? require.toUrl('./media/letterpress-hc.svg') : require.toUrl('./media/letterpress.svg');
@@ -1502 +1502 @@ registerThemingParticipant((theme, collector, environment) => {
- background-image: url('${require.toUrl(letterpress)}')
+ background-image: url('${letterpress}')
diff --git a/src/vs/workbench/browser/parts/editor/resourceViewer.ts b/src/vs/workbench/browser/parts/editor/resourceViewer.ts
index 73446c7..90330a2 100644
index 98a67c2..67d5248 100644
--- a/src/vs/workbench/browser/parts/editor/resourceViewer.ts
+++ b/src/vs/workbench/browser/parts/editor/resourceViewer.ts
@@ -23 +23 @@ import { memoize } from 'vs/base/common/decorators';
@@ -426,20 +446,20 @@ index 73446c7..90330a2 100644
- const isScrollWhellKeyPressed = platform.isMacintosh ? altPressed : ctrlPressed;
+ const isScrollWhellKeyPressed = browser.isMacintosh ? altPressed : ctrlPressed;
diff --git a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
index e2bfb8d..3f6ae26 100644
index 8b40624..43df4de 100644
--- a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
+++ b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
@@ -7 +7 @@ import 'vs/css!./media/tabstitlecontrol';
-import { isMacintosh } from 'vs/base/common/platform';
+import { isMacintosh } from 'vs/base/browser/browser';
diff --git a/src/vs/workbench/browser/parts/quickinput/quickInputList.ts b/src/vs/workbench/browser/parts/quickinput/quickInputList.ts
index 7478274..aa55946 100644
index 78c0846..f20462f 100644
--- a/src/vs/workbench/browser/parts/quickinput/quickInputList.ts
+++ b/src/vs/workbench/browser/parts/quickinput/quickInputList.ts
@@ -24 +24 @@ import { range } from 'vs/base/common/arrays';
-import * as platform from 'vs/base/common/platform';
+import * as browser from 'vs/base/browser/browser';
@@ -264 +264 @@ export class QuickInputList {
@@ -265 +265 @@ export class QuickInputList {
- if (platform.isMacintosh ? e.metaKey : e.ctrlKey) {
+ if (browser.isMacintosh ? e.metaKey : e.ctrlKey) {
diff --git a/src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css b/src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css
@@ -449,7 +469,7 @@ index a215bde..df7562b 100644
@@ -44,0 +45 @@
+.web > .monaco-workbench .part.titlebar,
diff --git a/src/vs/workbench/browser/parts/titlebar/menubarControl.ts b/src/vs/workbench/browser/parts/titlebar/menubarControl.ts
index 254ae28..4f2e217 100644
index a822341..43b882a 100644
--- a/src/vs/workbench/browser/parts/titlebar/menubarControl.ts
+++ b/src/vs/workbench/browser/parts/titlebar/menubarControl.ts
@@ -16 +16,2 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
@@ -459,50 +479,74 @@ index 254ae28..4f2e217 100644
@@ -117 +118 @@ export class MenubarControl extends Disposable {
- if (isMacintosh) {
+ if (isNative && isMacintosh) {
@@ -123 +124 @@ export class MenubarControl extends Disposable {
@@ -126 +127 @@ export class MenubarControl extends Disposable {
- if (isMacintosh || this.currentTitlebarStyleSetting !== 'custom') {
+ if ((isNative && isMacintosh) || this.currentTitlebarStyleSetting !== 'custom') {
@@ -283 +284 @@ export class MenubarControl extends Disposable {
@@ -138 +139 @@ export class MenubarControl extends Disposable {
- if (isMacintosh || this.currentTitlebarStyleSetting !== 'custom') {
+ if ((isNative && isMacintosh) || this.currentTitlebarStyleSetting !== 'custom') {
@@ -288 +289 @@ export class MenubarControl extends Disposable {
- if (!isMacintosh && this.currentTitlebarStyleSetting === 'custom') {
+ if (!(isNative && isMacintosh) && this.currentTitlebarStyleSetting === 'custom') {
@@ -299 +300 @@ export class MenubarControl extends Disposable {
@@ -304 +305 @@ export class MenubarControl extends Disposable {
- if (!isMacintosh && this.currentTitlebarStyleSetting === 'custom') {
+ if (!(isNative && isMacintosh) && this.currentTitlebarStyleSetting === 'custom') {
@@ -470 +471 @@ export class MenubarControl extends Disposable {
@@ -473 +474 @@ export class MenubarControl extends Disposable {
- if (!isMacintosh) {
+ if (!(isNative && isMacintosh)) {
@@ -692 +693 @@ export class MenubarControl extends Disposable {
@@ -699 +700 @@ export class MenubarControl extends Disposable {
- if (!isMacintosh && this.currentTitlebarStyleSetting === 'custom') {
+ if (!(isNative && isMacintosh) && this.currentTitlebarStyleSetting === 'custom') {
diff --git a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
index 3ab509f..5c76d17 100644
index 028f375..4bfe956 100644
--- a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
+++ b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
@@ -25 +25,2 @@ import { TITLE_BAR_ACTIVE_BACKGROUND, TITLE_BAR_ACTIVE_FOREGROUND, TITLE_BAR_INA
@@ -11 +11 @@ import { ITitleService, ITitleProperties } from 'vs/workbench/services/title/com
-import { getZoomFactor } from 'vs/base/browser/browser';
+import { getZoomFactor, isMacintosh, isWindows, isLinux } from 'vs/base/browser/browser';
@@ -25 +25 @@ import { TITLE_BAR_ACTIVE_BACKGROUND, TITLE_BAR_ACTIVE_FOREGROUND, TITLE_BAR_INA
-import { isMacintosh, isWindows, isLinux } from 'vs/base/common/platform';
+import { isNative } from 'vs/base/common/platform';
+import { isMacintosh, isWindows, isLinux } from 'vs/base/browser/browser';
@@ -327 +328 @@ export class TitlebarPart extends Part implements ITitleService, ISerializableVi
@@ -327 +327 @@ export class TitlebarPart extends Part implements ITitleService {
- if (!isMacintosh) {
+ if (!(isNative && isMacintosh)) {
@@ -343 +344 @@ export class TitlebarPart extends Part implements ITitleService, ISerializableVi
@@ -343 +343 @@ export class TitlebarPart extends Part implements ITitleService {
- if (!isMacintosh) {
+ if (!(isNative && isMacintosh)) {
@@ -550 +551 @@ export class TitlebarPart extends Part implements ITitleService, ISerializableVi
@@ -549 +549 @@ export class TitlebarPart extends Part implements ITitleService {
- if (!isMacintosh &&
+ if (!(isNative && isMacintosh) &&
@@ -568 +569 @@ export class TitlebarPart extends Part implements ITitleService, ISerializableVi
@@ -567 +567 @@ export class TitlebarPart extends Part implements ITitleService {
- if (isMacintosh || this.configurationService.getValue<MenuBarVisibility>('window.menuBarVisibility') === 'hidden') {
+ if ((isNative && isMacintosh) || this.configurationService.getValue<MenuBarVisibility>('window.menuBarVisibility') === 'hidden') {
diff --git a/src/vs/workbench/browser/workbench.contribution.ts b/src/vs/workbench/browser/workbench.contribution.ts
index 1eb763e..ad509f8 100644
index 696f351..47af9f7 100644
--- a/src/vs/workbench/browser/workbench.contribution.ts
+++ b/src/vs/workbench/browser/workbench.contribution.ts
@@ -9 +9 @@ import { IConfigurationRegistry, Extensions as ConfigurationExtensions, Configur
-import { isMacintosh } from 'vs/base/common/platform';
+import { isMacintosh } from 'vs/base/browser/browser';
diff --git a/src/vs/workbench/browser/workbench.ts b/src/vs/workbench/browser/workbench.ts
index c69d1ab..a34dd7e 100644
--- a/src/vs/workbench/browser/workbench.ts
+++ b/src/vs/workbench/browser/workbench.ts
@@ -13 +13 @@ import { runWhenIdle, IdleValue } from 'vs/base/common/async';
-import { getZoomLevel } from 'vs/base/browser/browser';
+import { getZoomLevel, isWindows, isLinux } from 'vs/base/browser/browser';
@@ -17 +17 @@ import { Registry } from 'vs/platform/registry/common/platform';
-import { isWindows, isLinux } from 'vs/base/common/platform';
+import { isWeb } from 'vs/base/common/platform';
@@ -83 +83 @@ export class Workbench extends Layout {
- // Inform user about loading issues from the loader
+ /*// Inform user about loading issues from the loader
@@ -90 +90 @@ export class Workbench extends Layout {
- });
+ });*/
@@ -272 +272 @@ export class Workbench extends Layout {
- addClasses(document.body, platformClass); // used by our fonts
+ addClasses(document.body, platformClass, isWeb ? 'web' : 'native'); // used by our fonts
diff --git a/src/vs/workbench/common/contextkeys.ts b/src/vs/workbench/common/contextkeys.ts
index a0921a0..ed5ba1e 100644
index e5b4a41..e623101 100644
--- a/src/vs/workbench/common/contextkeys.ts
+++ b/src/vs/workbench/common/contextkeys.ts
@@ -7 +7 @@ import { RawContextKey } from 'vs/platform/contextkey/common/contextkey';
@@ -522,7 +566,7 @@ index 787c9ef..bd50c14 100644
- platform.isMacintosh
+ browser.isMacintosh
diff --git a/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.ts b/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.ts
index 1d338f1..4f13736 100644
index b949e00..8a9005c 100644
--- a/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.ts
+++ b/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.ts
@@ -14 +14 @@ import { mixin } from 'vs/base/common/objects';
@@ -538,23 +582,24 @@ index 5e1b6da..f8643d2 100644
@@ -84 +84 @@ MenuRegistry.appendMenuItem(MenuId.MenubarSelectionMenu, {
- platform.isMacintosh
+ browser.isMacintosh
diff --git a/src/vs/workbench/contrib/comments/electron-browser/commentNode.ts b/src/vs/workbench/contrib/comments/electron-browser/commentNode.ts
index 1ece57b..cf9505e 100644
--- a/src/vs/workbench/contrib/comments/electron-browser/commentNode.ts
+++ b/src/vs/workbench/contrib/comments/electron-browser/commentNode.ts
@@ -26 +26 @@ import { KeyCode } from 'vs/base/common/keyCodes';
-import { isMacintosh } from 'vs/base/common/platform';
+import { isMacintosh } from 'vs/base/browser/browser';
diff --git a/src/vs/workbench/contrib/comments/electron-browser/commentThreadWidget.ts b/src/vs/workbench/contrib/comments/electron-browser/commentThreadWidget.ts
index 973dd5a..6c54854 100644
--- a/src/vs/workbench/contrib/comments/electron-browser/commentThreadWidget.ts
+++ b/src/vs/workbench/contrib/comments/electron-browser/commentThreadWidget.ts
@@ -15 +15 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle';
-import * as platform from 'vs/base/common/platform';
diff --git a/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts b/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts
index de8fe1e..e8749fa 100644
--- a/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts
+++ b/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts
@@ -9,0 +10 @@ import * as env from 'vs/base/common/platform';
+import * as browser from 'vs/base/browser/browser';
@@ -742 +742 @@ export class ReviewZoneWidget extends ZoneWidget {
- let keybinding = platform.isMacintosh ? 'Cmd+Enter' : 'Ctrl+Enter';
+ let keybinding = browser.isMacintosh ? 'Cmd+Enter' : 'Ctrl+Enter';
@@ -181 +182 @@ export class DebugEditorContribution implements IDebugEditorContribution {
- if (e.event.rightButton || (env.isMacintosh && e.event.leftButton && e.event.ctrlKey)) {
+ if (e.event.rightButton || (browser.isMacintosh && e.event.leftButton && e.event.ctrlKey)) {
@@ -200 +201 @@ export class DebugEditorContribution implements IDebugEditorContribution {
- if (!env.isLinux && breakpoints.some(bp => !!bp.condition || !!bp.logMessage || !!bp.hitCondition)) {
+ if (!(env.isNative && env.isLinux) && breakpoints.some(bp => !!bp.condition || !!bp.logMessage || !!bp.hitCondition)) {
@@ -435 +436 @@ export class DebugEditorContribution implements IDebugEditorContribution {
- const stopKey = env.isMacintosh ? 'metaKey' : 'ctrlKey';
+ const stopKey = browser.isMacintosh ? 'metaKey' : 'ctrlKey';
@@ -453 +454 @@ export class DebugEditorContribution implements IDebugEditorContribution {
- const stopKey = env.isMacintosh ? KeyCode.Meta : KeyCode.Ctrl;
+ const stopKey = browser.isMacintosh ? KeyCode.Meta : KeyCode.Ctrl;
diff --git a/src/vs/workbench/contrib/debug/browser/linkDetector.ts b/src/vs/workbench/contrib/debug/browser/linkDetector.ts
index 1b6f41c..0c9bf68 100644
--- a/src/vs/workbench/contrib/debug/browser/linkDetector.ts
@@ -563,88 +608,72 @@ index 1b6f41c..0c9bf68 100644
-import { isMacintosh } from 'vs/base/common/platform';
+import { isMacintosh } from 'vs/base/browser/browser';
diff --git a/src/vs/workbench/contrib/debug/electron-browser/debug.contribution.ts b/src/vs/workbench/contrib/debug/electron-browser/debug.contribution.ts
index fde17ef..6010faa 100644
index 5ed1eda..60d3815 100644
--- a/src/vs/workbench/contrib/debug/electron-browser/debug.contribution.ts
+++ b/src/vs/workbench/contrib/debug/electron-browser/debug.contribution.ts
@@ -45 +45 @@ import { ViewsRegistry } from 'vs/workbench/common/views';
@@ -38 +38 @@ import { IViewsRegistry, Extensions as ViewExtensions } from 'vs/workbench/commo
-import { isMacintosh } from 'vs/base/common/platform';
+import { isMacintosh } from 'vs/base/browser/browser';
diff --git a/src/vs/workbench/contrib/debug/electron-browser/debugEditorContribution.ts b/src/vs/workbench/contrib/debug/electron-browser/debugEditorContribution.ts
index 89c1311..e803b6f 100644
--- a/src/vs/workbench/contrib/debug/electron-browser/debugEditorContribution.ts
+++ b/src/vs/workbench/contrib/debug/electron-browser/debugEditorContribution.ts
@@ -9,0 +10 @@ import * as env from 'vs/base/common/platform';
+import * as browser from 'vs/base/browser/browser';
@@ -180 +181 @@ export class DebugEditorContribution implements IDebugEditorContribution {
- if (e.event.rightButton || (env.isMacintosh && e.event.leftButton && e.event.ctrlKey)) {
+ if (e.event.rightButton || (browser.isMacintosh && e.event.leftButton && e.event.ctrlKey)) {
@@ -429 +430 @@ export class DebugEditorContribution implements IDebugEditorContribution {
- const stopKey = env.isMacintosh ? 'metaKey' : 'ctrlKey';
+ const stopKey = browser.isMacintosh ? 'metaKey' : 'ctrlKey';
@@ -447 +448 @@ export class DebugEditorContribution implements IDebugEditorContribution {
- const stopKey = env.isMacintosh ? KeyCode.Meta : KeyCode.Ctrl;
+ const stopKey = browser.isMacintosh ? KeyCode.Meta : KeyCode.Ctrl;
diff --git a/src/vs/workbench/contrib/debug/node/debugAdapter.ts b/src/vs/workbench/contrib/debug/node/debugAdapter.ts
index b5f6da9..6e6ff4b 100644
--- a/src/vs/workbench/contrib/debug/node/debugAdapter.ts
+++ b/src/vs/workbench/contrib/debug/node/debugAdapter.ts
@@ -315 +315 @@ export class ExecutableDebugAdapter extends StreamDebugAdapter {
- return new Promise<void>((resolve, reject) => {
+ return new Promise<void>(async (resolve, reject) => {
@@ -320 +320 @@ export class ExecutableDebugAdapter extends StreamDebugAdapter {
- if (!fs.existsSync(this.adapterExecutable.command)) {
+ if (!(await require("util").promisify(fs.exists)(this.adapterExecutable.command))) {
diff --git a/src/vs/workbench/contrib/extensions/node/extensionsWorkbenchService.ts b/src/vs/workbench/contrib/extensions/node/extensionsWorkbenchService.ts
index 67c0c41..956c3a6 100644
index 7c58491..63ac200 100644
--- a/src/vs/workbench/contrib/extensions/node/extensionsWorkbenchService.ts
+++ b/src/vs/workbench/contrib/extensions/node/extensionsWorkbenchService.ts
@@ -118 +118 @@ class Extension implements IExtension {
- return `${product.extensionsGallery.itemUrl}?itemName=${this.publisher}.${this.name}`;
+ return undefined; // `${product.extensionsGallery.itemUrl}?itemName=${this.publisher}.${this.name}`;
diff --git a/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts b/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts
index f83842f..bca184e 100644
index a9f017e..75fe519 100644
--- a/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts
+++ b/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts
@@ -17 +17 @@ import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/co
-import { isWindows, isMacintosh } from 'vs/base/common/platform';
+import { isWindows, isMacintosh } from 'vs/base/browser/browser';
diff --git a/src/vs/workbench/contrib/files/browser/fileCommands.ts b/src/vs/workbench/contrib/files/browser/fileCommands.ts
index 136bbc9..6766894 100644
index 59922c1..62d4d5b 100644
--- a/src/vs/workbench/contrib/files/browser/fileCommands.ts
+++ b/src/vs/workbench/contrib/files/browser/fileCommands.ts
@@ -28 +28 @@ import { KeyMod, KeyCode, KeyChord } from 'vs/base/common/keyCodes';
-import { isWindows, isMacintosh } from 'vs/base/common/platform';
+import { isWindows, isMacintosh } from 'vs/base/browser/browser';
diff --git a/src/vs/workbench/contrib/files/browser/views/emptyView.ts b/src/vs/workbench/contrib/files/browser/views/emptyView.ts
index 89e2def..9005795 100644
--- a/src/vs/workbench/contrib/files/browser/views/emptyView.ts
+++ b/src/vs/workbench/contrib/files/browser/views/emptyView.ts
@@ -7,0 +8 @@ import * as errors from 'vs/base/common/errors';
+import * as browser from 'vs/base/browser/browser';
@@ -76 +77 @@ export class EmptyView extends ViewletPanel {
- const actionClass = this.contextService.getWorkbenchState() === WorkbenchState.WORKSPACE ? AddRootFolderAction : env.isMacintosh ? OpenFileFolderAction : OpenFolderAction;
+ const actionClass = this.contextService.getWorkbenchState() === WorkbenchState.WORKSPACE ? AddRootFolderAction : browser.isMacintosh ? OpenFileFolderAction : OpenFolderAction;
diff --git a/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts b/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts
index e944612..e638513 100644
index b3c2d15..067215e 100644
--- a/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts
+++ b/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts
@@ -38 +38 @@ import { DesktopDragAndDropData, ExternalElementsDragAndDropData, ElementsDragAn
-import { isMacintosh, isLinux } from 'vs/base/common/platform';
+import { isMacintosh, isLinux } from 'vs/base/browser/browser';
@@ -592,0 +593 @@ export class FileDragAndDrop implements ITreeDragAndDrop<ExplorerItem> {
@@ -606,0 +607 @@ export class FileDragAndDrop implements ITreeDragAndDrop<ExplorerItem> {
+ return (require('vs/../../../../packages/vscode/src/workbench') as typeof import('vs/../../../../packages/vscode/src/workbench')).workbench.handleExternalDrop(target, originalEvent);
diff --git a/src/vs/workbench/contrib/files/common/explorerModel.ts b/src/vs/workbench/contrib/files/common/explorerModel.ts
index 4ddf707..5e51b38 100644
index a5cd043..0569a5f 100644
--- a/src/vs/workbench/contrib/files/common/explorerModel.ts
+++ b/src/vs/workbench/contrib/files/common/explorerModel.ts
@@ -77,0 +78 @@ export class ExplorerItem {
+ private forgotChildren: boolean = false;
@@ -252 +253,2 @@ export class ExplorerItem {
@@ -248 +249,2 @@ export class ExplorerItem {
- if (!this._isDirectoryResolved) {
+ if (!this._isDirectoryResolved || this.forgotChildren) {
+ this.forgotChildren = false;
@@ -277,0 +280 @@ export class ExplorerItem {
+ this.forgotChildren = true;
diff --git a/src/vs/workbench/contrib/files/common/explorerService.ts b/src/vs/workbench/contrib/files/common/explorerService.ts
index 980c9b1..a692900 100644
index 46d87e4..fd3f927 100644
--- a/src/vs/workbench/contrib/files/common/explorerService.ts
+++ b/src/vs/workbench/contrib/files/common/explorerService.ts
@@ -333 +333 @@ export class ExplorerService implements IExplorerService {
- if (shouldRefresh()) {
+ if (true || shouldRefresh()) {
diff --git a/src/vs/workbench/contrib/logs/common/logs.contribution.ts b/src/vs/workbench/contrib/logs/common/logs.contribution.ts
index a14a280..af264a8 100644
index 25df212..6c40c9d 100644
--- a/src/vs/workbench/contrib/logs/common/logs.contribution.ts
+++ b/src/vs/workbench/contrib/logs/common/logs.contribution.ts
@@ -31 +31,2 @@ class LogOutputChannels extends Disposable implements IWorkbenchContribution {
@@ -681,62 +710,58 @@ index e3c9552..a64fda2 100644
@@ -75 +76 @@ export class SettingsChangeRelauncher extends Disposable implements IWorkbenchCo
- if (isMacintosh && config.window && typeof config.window.nativeFullScreen === 'boolean' && config.window.nativeFullScreen !== this.nativeFullScreen) {
+ if (isNative && isMacintosh && config.window && typeof config.window.nativeFullScreen === 'boolean' && config.window.nativeFullScreen !== this.nativeFullScreen) {
diff --git a/src/vs/workbench/contrib/scm/electron-browser/scmViewlet.ts b/src/vs/workbench/contrib/scm/electron-browser/scmViewlet.ts
index 077334b..b215ede 100644
--- a/src/vs/workbench/contrib/scm/electron-browser/scmViewlet.ts
+++ b/src/vs/workbench/contrib/scm/electron-browser/scmViewlet.ts
@@ -50 +50 @@ import { IPanelDndController, Panel } from 'vs/base/browser/ui/splitview/panelvi
diff --git a/src/vs/workbench/contrib/scm/browser/scmViewlet.ts b/src/vs/workbench/contrib/scm/browser/scmViewlet.ts
index b8db2f2..be84602 100644
--- a/src/vs/workbench/contrib/scm/browser/scmViewlet.ts
+++ b/src/vs/workbench/contrib/scm/browser/scmViewlet.ts
@@ -46 +46 @@ import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/la
-import * as platform from 'vs/base/common/platform';
+import * as browser from 'vs/base/browser/browser';
@@ -816 +816 @@ export class RepositoryPanel extends ViewletPanel {
@@ -769 +769 @@ export class RepositoryPanel extends ViewletPanel {
- const label = binding ? binding.getLabel() : (platform.isMacintosh ? 'Cmd+Enter' : 'Ctrl+Enter');
+ const label = binding ? binding.getLabel() : (browser.isMacintosh ? 'Cmd+Enter' : 'Ctrl+Enter');
diff --git a/src/vs/workbench/contrib/search/browser/search.contribution.ts b/src/vs/workbench/contrib/search/browser/search.contribution.ts
index c60cccd..257cd31 100644
index 1f8088e..f5b0551 100644
--- a/src/vs/workbench/contrib/search/browser/search.contribution.ts
+++ b/src/vs/workbench/contrib/search/browser/search.contribution.ts
@@ -665 +665 @@ configurationRegistry.registerConfiguration({
@@ -686 +686 @@ configurationRegistry.registerConfiguration({
- included: platform.isMacintosh
+ included: platform.isNative && platform.isMacintosh
diff --git a/src/vs/workbench/contrib/tasks/common/problemMatcher.ts b/src/vs/workbench/contrib/tasks/common/problemMatcher.ts
index 57ece42..91bc82a 100644
--- a/src/vs/workbench/contrib/tasks/common/problemMatcher.ts
+++ b/src/vs/workbench/contrib/tasks/common/problemMatcher.ts
@@ -222 +222 @@ export function createLineMatcher(matcher: ProblemMatcher): ILineMatcher {
-const endOfLine: string = Platform.OS === Platform.OperatingSystem.Windows ? '\r\n' : '\n';
+const endOfLine: string = Platform.isWindows ? '\r\n' : '\n';
diff --git a/src/vs/workbench/contrib/terminal/electron-browser/terminal.contribution.ts b/src/vs/workbench/contrib/terminal/electron-browser/terminal.contribution.ts
index b15ee85..4a577b3 100644
--- a/src/vs/workbench/contrib/terminal/electron-browser/terminal.contribution.ts
+++ b/src/vs/workbench/contrib/terminal/electron-browser/terminal.contribution.ts
@@ -12,0 +13 @@ import * as platform from 'vs/base/common/platform';
diff --git a/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts b/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts
index 24ba122..fca7faf 100644
--- a/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts
+++ b/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts
@@ -12,0 +13 @@ import * as nls from 'vs/nls';
+import * as browser from 'vs/base/browser/browser';
@@ -219 +220 @@ configurationRegistry.registerConfiguration({
@@ -196 +197 @@ configurationRegistry.registerConfiguration({
- default: platform.isMacintosh ? 'selectWord' : platform.isWindows ? 'copyPaste' : 'default',
+ default: browser.isMacintosh ? 'selectWord' : browser.isWindows ? 'copyPaste' : 'default',
diff --git a/src/vs/workbench/contrib/terminal/electron-browser/terminalLinkHandler.ts b/src/vs/workbench/contrib/terminal/electron-browser/terminalLinkHandler.ts
index 734d13f..efba861 100644
--- a/src/vs/workbench/contrib/terminal/electron-browser/terminalLinkHandler.ts
+++ b/src/vs/workbench/contrib/terminal/electron-browser/terminalLinkHandler.ts
@@ -7,0 +8 @@ import * as path from 'vs/base/common/path';
diff --git a/src/vs/workbench/contrib/terminal/browser/terminalLinkHandler.ts b/src/vs/workbench/contrib/terminal/browser/terminalLinkHandler.ts
index 933e4ea..b661a7e 100644
--- a/src/vs/workbench/contrib/terminal/browser/terminalLinkHandler.ts
+++ b/src/vs/workbench/contrib/terminal/browser/terminalLinkHandler.ts
@@ -7,0 +8 @@ import * as platform from 'vs/base/common/platform';
+import * as browser from 'vs/base/browser/browser';
@@ -235 +236 @@ export class TerminalLinkHandler {
@@ -234 +235 @@ export class TerminalLinkHandler {
- return platform.isMacintosh ? event.metaKey : event.ctrlKey;
+ return browser.isMacintosh ? event.metaKey : event.ctrlKey;
@@ -243 +244 @@ export class TerminalLinkHandler {
@@ -242 +243 @@ export class TerminalLinkHandler {
- if (platform.isMacintosh) {
+ if (browser.isMacintosh) {
diff --git a/src/vs/workbench/contrib/terminal/electron-browser/terminalPanel.ts b/src/vs/workbench/contrib/terminal/electron-browser/terminalPanel.ts
index bfde146..6c3391e 100644
--- a/src/vs/workbench/contrib/terminal/electron-browser/terminalPanel.ts
+++ b/src/vs/workbench/contrib/terminal/electron-browser/terminalPanel.ts
diff --git a/src/vs/workbench/contrib/terminal/browser/terminalPanel.ts b/src/vs/workbench/contrib/terminal/browser/terminalPanel.ts
index 780147c..2e8c9af 100644
--- a/src/vs/workbench/contrib/terminal/browser/terminalPanel.ts
+++ b/src/vs/workbench/contrib/terminal/browser/terminalPanel.ts
@@ -8,0 +9 @@ import * as platform from 'vs/base/common/platform';
+import * as browser from 'vs/base/browser/browser';
@@ -232 +233 @@ export class TerminalPanel extends Panel {
@@ -211 +212 @@ export class TerminalPanel extends Panel {
- if (event.which === 2 && platform.isLinux) {
+ if (event.which === 2 && browser.isLinux) {
@@ -234 +235 @@ export class TerminalPanel extends Panel {
- if (platform.isMacintosh) {
+ if (browser.isMacintosh) {
diff --git a/src/vs/workbench/contrib/webview/electron-browser/webview-pre.js b/src/vs/workbench/contrib/webview/electron-browser/webview-pre.js
index a239f09..3f68547 100644
index 74fc798..03728d0 100644
--- a/src/vs/workbench/contrib/webview/electron-browser/webview-pre.js
+++ b/src/vs/workbench/contrib/webview/electron-browser/webview-pre.js
@@ -10 +10,19 @@
@@ -776,31 +801,23 @@ index a239f09..3f68547 100644
+ // corsEnabled: true
+ // });
diff --git a/src/vs/workbench/contrib/webview/electron-browser/webview.contribution.ts b/src/vs/workbench/contrib/webview/electron-browser/webview.contribution.ts
index 8e2b9e0..c06da1c 100644
index 484ff86..f3f57cb 100644
--- a/src/vs/workbench/contrib/webview/electron-browser/webview.contribution.ts
+++ b/src/vs/workbench/contrib/webview/electron-browser/webview.contribution.ts
@@ -24 +24 @@ import { InputFocusedContextKey } from 'vs/platform/contextkey/common/contextkey
@@ -23 +23 @@ import { InputFocusedContextKey } from 'vs/platform/contextkey/common/contextkey
-import { isMacintosh } from 'vs/base/common/platform';
+import { isMacintosh } from 'vs/base/browser/browser';
diff --git a/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts b/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts
index 5a28744..9d6f38c 100644
index 3e56ee1..3880c57 100644
--- a/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts
+++ b/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts
@@ -19 +19,2 @@ import { endsWith } from 'vs/base/common/strings';
@@ -11 +11 @@ import { Disposable } from 'vs/base/common/lifecycle';
-import { isMacintosh } from 'vs/base/common/platform';
+import { isWeb } from 'vs/base/common/platform';
+import { isMacintosh } from 'vs/base/browser/browser';
@@ -254 +255 @@ export class WebviewElement extends Disposable {
- this._webview.src = this._options.useSameOriginForRoot ? require.toUrl('./webview.html') : 'data:text/html;charset=utf-8,%3C%21DOCTYPE%20html%3E%0D%0A%3Chtml%20lang%3D%22en%22%20style%3D%22width%3A%20100%25%3B%20height%3A%20100%25%22%3E%0D%0A%3Chead%3E%0D%0A%09%3Ctitle%3EVirtual%20Document%3C%2Ftitle%3E%0D%0A%3C%2Fhead%3E%0D%0A%3Cbody%20style%3D%22margin%3A%200%3B%20overflow%3A%20hidden%3B%20width%3A%20100%25%3B%20height%3A%20100%25%22%3E%0D%0A%3C%2Fbody%3E%0D%0A%3C%2Fhtml%3E';
+ this._webview.src = isWeb || this._options.useSameOriginForRoot ? require.toUrl('./webview.html') : 'data:text/html;charset=utf-8,%3C%21DOCTYPE%20html%3E%0D%0A%3Chtml%20lang%3D%22en%22%20style%3D%22width%3A%20100%25%3B%20height%3A%20100%25%22%3E%0D%0A%3Chead%3E%0D%0A%09%3Ctitle%3EVirtual%20Document%3C%2Ftitle%3E%0D%0A%3C%2Fhead%3E%0D%0A%3Cbody%20style%3D%22margin%3A%200%3B%20overflow%3A%20hidden%3B%20width%3A%20100%25%3B%20height%3A%20100%25%22%3E%0D%0A%3C%2Fbody%3E%0D%0A%3C%2Fhtml%3E';
@@ -265,0 +267,3 @@ export class WebviewElement extends Disposable {
+ Object.defineProperty(this._options, 'useSameOriginForRoot', {
+ value: true,
+ });
diff --git a/src/vs/workbench/contrib/welcome/walkThrough/node/walkThroughContentProvider.ts b/src/vs/workbench/contrib/welcome/walkThrough/node/walkThroughContentProvider.ts
index 147f05b..a36fad0 100644
--- a/src/vs/workbench/contrib/welcome/walkThrough/node/walkThroughContentProvider.ts
+++ b/src/vs/workbench/contrib/welcome/walkThrough/node/walkThroughContentProvider.ts
diff --git a/src/vs/workbench/contrib/welcome/walkThrough/common/walkThroughContentProvider.ts b/src/vs/workbench/contrib/welcome/walkThrough/common/walkThroughContentProvider.ts
index 147f05b..6bc9061 100644
--- a/src/vs/workbench/contrib/welcome/walkThrough/common/walkThroughContentProvider.ts
+++ b/src/vs/workbench/contrib/welcome/walkThrough/common/walkThroughContentProvider.ts
@@ -30,0 +31 @@ export class WalkThroughContentProvider implements ITextModelContentProvider, IW
+ /*
@@ -38 +39,11 @@ export class WalkThroughContentProvider implements ITextModelContentProvider, IW
@@ -808,7 +825,7 @@ index 147f05b..a36fad0 100644
+ */
+ // This works because the only walkthrough that is a module is the welcome page.
+ // We have to explicitly import it or Webpack won't pick it up.
+ import("vs/workbench/contrib/welcome/page/electron-browser/vs_code_welcome_page").then((content) => {
+ import("vs/workbench/contrib/welcome/page/browser/vs_code_welcome_page").then((content) => {
+ resolve(content.default());
+ }).catch((err) => {
+ reject(err);
@@ -837,104 +854,96 @@ index 79e2ba2..8c1b21b 100644
+import { language } from 'vs/base/common/platform';
+import { isMacintosh, isLinux } from 'vs/base/browser/browser';
diff --git a/src/vs/workbench/electron-browser/actions/windowActions.ts b/src/vs/workbench/electron-browser/actions/windowActions.ts
index ef64015..689487d 100644
index 48ef482..dc47f81 100644
--- a/src/vs/workbench/electron-browser/actions/windowActions.ts
+++ b/src/vs/workbench/electron-browser/actions/windowActions.ts
@@ -14 +14 @@ import { IWorkspaceConfigurationService } from 'vs/workbench/services/configurat
-import { isMacintosh } from 'vs/base/common/platform';
+import { isMacintosh } from 'vs/base/browser/browser';
@@ -388 +388 @@ export abstract class BaseOpenRecentAction extends Action {
- placeHolder: isMacintosh ? nls.localize('openRecentPlaceHolderMac', "Select to open (hold Cmd-key to open in new window)") : nls.localize('openRecentPlaceHolder', "Select to open (hold Ctrl-key to open in new window)"),
+ placeHolder: browser.isMacintosh ? nls.localize('openRecentPlaceHolderMac', "Select to open (hold Cmd-key to open in new window)") : nls.localize('openRecentPlaceHolder', "Select to open (hold Ctrl-key to open in new window)"),
diff --git a/src/vs/workbench/electron-browser/main.contribution.ts b/src/vs/workbench/electron-browser/main.contribution.ts
index 0d9d443..f0e30f7 100644
index 71bc992..97cbb71 100644
--- a/src/vs/workbench/electron-browser/main.contribution.ts
+++ b/src/vs/workbench/electron-browser/main.contribution.ts
@@ -13 +13,2 @@ import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes';
-import { isWindows, isLinux, isMacintosh } from 'vs/base/common/platform';
+import { isNative, isWeb } from 'vs/base/common/platform';
+import { isWindows, isLinux, isMacintosh } from 'vs/base/browser/browser';
@@ -535 +536 @@ import { LogStorageAction } from 'vs/platform/storage/node/storageService';
+import { isMacintosh, isWindows, isLinux } from 'vs/base/browser/browser';
@@ -306 +307 @@ import { LogStorageAction } from 'vs/platform/storage/node/storageService';
- when: IsMacContext.toNegated()
+ // when: IsMacContext.toNegated()
@@ -538 +539 @@ import { LogStorageAction } from 'vs/platform/storage/node/storageService';
- isMacintosh ?
+ isNative && isMacintosh ?
@@ -542 +543 @@ import { LogStorageAction } from 'vs/platform/storage/node/storageService';
@@ -545 +546 @@ import { LogStorageAction } from 'vs/platform/storage/node/storageService';
- isMacintosh ?
+ isNative && isMacintosh ?
@@ -629 +630 @@ import { LogStorageAction } from 'vs/platform/storage/node/storageService';
@@ -626 +627 @@ import { LogStorageAction } from 'vs/platform/storage/node/storageService';
- 'included': isWindows || isLinux
+ 'included': isWeb || isWindows || isLinux
@@ -636 +637 @@ import { LogStorageAction } from 'vs/platform/storage/node/storageService';
@@ -633 +634 @@ import { LogStorageAction } from 'vs/platform/storage/node/storageService';
- 'included': isWindows || isLinux
+ 'included': isWeb || isWindows || isLinux
@@ -662 +663 @@ import { LogStorageAction } from 'vs/platform/storage/node/storageService';
@@ -650 +651 @@ import { LogStorageAction } from 'vs/platform/storage/node/storageService';
- 'default': isLinux ? 'native' : 'custom',
+ 'default': isNative && isLinux ? 'native' : 'custom',
@@ -659 +660 @@ import { LogStorageAction } from 'vs/platform/storage/node/storageService';
- 'included': isMacintosh && parseFloat(os.release()) >= 16 // Minimum: macOS Sierra (10.12.x = darwin 16.x)
+ 'included': isNative && isMacintosh && parseFloat(os.release()) >= 16 // Minimum: macOS Sierra (10.12.x = darwin 16.x)
@@ -668 +669 @@ import { LogStorageAction } from 'vs/platform/storage/node/storageService';
@@ -665 +666 @@ import { LogStorageAction } from 'vs/platform/storage/node/storageService';
- 'included': isMacintosh
+ 'included': isNative && isMacintosh
diff --git a/src/vs/workbench/electron-browser/main.ts b/src/vs/workbench/electron-browser/main.ts
index b94daa8..5963023 100644
--- a/src/vs/workbench/electron-browser/main.ts
+++ b/src/vs/workbench/electron-browser/main.ts
@@ -140,0 +141,2 @@ class CodeRendererMain extends Disposable {
+
+ (require('vs/../../../../packages/vscode/src/workbench') as typeof import ('vs/../../../../packages/vscode/src/workbench')).workbench.serviceCollection = services.serviceCollection;
diff --git a/src/vs/workbench/electron-browser/window.ts b/src/vs/workbench/electron-browser/window.ts
index acb68c8..bee143a 100644
index 111982b..73d83a4 100644
--- a/src/vs/workbench/electron-browser/window.ts
+++ b/src/vs/workbench/electron-browser/window.ts
@@ -53 +53 @@ const TextInputActions: IAction[] = [
- new Action('editor.action.clipboardPasteAction', nls.localize('paste', "Paste"), undefined, true, () => Promise.resolve(document.execCommand('paste'))),
+ (require('vs/../../../../packages/vscode/src/workbench') as typeof import ('vs/../../../../packages/vscode/src/workbench')).workbench.pasteAction,
@@ -319 +319 @@ export class ElectronWindow extends Disposable {
- (<any>window).open = function (url: string, target: string, features: string, replace: boolean): any {
+ (<any>window).openInvalid = function (url: string, target: string, features: string, replace: boolean): any {
@@ -365 +365 @@ export class ElectronWindow extends Disposable {
@@ -361 +361 @@ export class ElectronWindow extends Disposable {
- !isMacintosh || // macOS only
+ !browser.isMacintosh || // macOS only
diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts
index 7445d7b..ba6bf4b 100644
--- a/src/vs/workbench/electron-browser/workbench.ts
+++ b/src/vs/workbench/electron-browser/workbench.ts
@@ -19 +19,2 @@ import { Registry } from 'vs/platform/registry/common/platform';
-import { isWindows, isLinux, isMacintosh, language } from 'vs/base/common/platform';
+import { isWeb, isNative, language } from 'vs/base/common/platform';
+import { isWindows, isLinux, isMacintosh } from 'vs/base/browser/browser';
@@ -321,0 +323 @@ export class Workbench extends Disposable implements IPartService {
+ (require('vs/../../../../packages/vscode/src/workbench') as typeof import ('vs/../../../../packages/vscode/src/workbench')).workbench.serviceCollection = serviceCollection;
@@ -345,0 +348 @@ export class Workbench extends Disposable implements IPartService {
+ /*
@@ -353,0 +357 @@ export class Workbench extends Disposable implements IPartService {
+ */
@@ -458 +462 @@ export class Workbench extends Disposable implements IPartService {
- addClasses(document.body, platformClass); // used by our fonts
+ addClasses(document.body, platformClass, isWeb ? 'web' : 'native'); // used by our fonts
@@ -491,0 +496 @@ export class Workbench extends Disposable implements IPartService {
+ client.onClose(() => this.notificationService.error("Disconnected from shared process. Searching, installing, enabling, and disabling extensions will not work until the page is refreshed."));
@@ -633 +638 @@ export class Workbench extends Disposable implements IPartService {
- if (!isMacintosh && this.useCustomTitleBarStyle()) {
+ if (isWeb || (!isMacintosh && this.useCustomTitleBarStyle())) {
@@ -1241 +1246 @@ export class Workbench extends Disposable implements IPartService {
- if ((isWindows || isLinux) && this.useCustomTitleBarStyle()) {
+ if ((isWeb || isWindows || isLinux) && this.useCustomTitleBarStyle()) {
@@ -1397 +1402 @@ export class Workbench extends Disposable implements IPartService {
- } else if (isMacintosh) {
+ } else if (isNative && isMacintosh) {
diff --git a/src/vs/workbench/services/contextmenu/electron-browser/contextmenuService.ts b/src/vs/workbench/services/contextmenu/electron-browser/contextmenuService.ts
index 75f0026..2e94683 100644
--- a/src/vs/workbench/services/contextmenu/electron-browser/contextmenuService.ts
+++ b/src/vs/workbench/services/contextmenu/electron-browser/contextmenuService.ts
@@ -22 +22 @@ import { getTitleBarStyle } from 'vs/platform/windows/common/windows';
-import { isMacintosh } from 'vs/base/common/platform';
+import { isNative, isMacintosh } from 'vs/base/common/platform';
@@ -49 +49 @@ export class ContextMenuService extends Disposable implements IContextMenuServic
- if (!isMacintosh && getTitleBarStyle(configurationService, environmentService) === 'custom') {
+ if (!(isNative && isMacintosh) && getTitleBarStyle(configurationService, environmentService) === 'custom') {
diff --git a/src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts b/src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts
index 0592910..0ce7e35 100644
index 059f821..2dde675 100644
--- a/src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts
+++ b/src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts
@@ -33,0 +34 @@ function getSystemExtensionsRoot(): string {
@@ -32,0 +33 @@ function getSystemExtensionsRoot(): string {
+ return (require('vs/../../../../packages/vscode/src/fill/paths') as typeof import ('vs/../../../../packages/vscode/src/fill/paths')).getBuiltInExtensionsDirectory();
diff --git a/src/vs/workbench/services/extensions/electron-browser/extensionService.ts b/src/vs/workbench/services/extensions/electron-browser/extensionService.ts
index 2c2f9c7..e2ab620 100644
index b337206..0477464 100644
--- a/src/vs/workbench/services/extensions/electron-browser/extensionService.ts
+++ b/src/vs/workbench/services/extensions/electron-browser/extensionService.ts
@@ -92,0 +93 @@ export class ExtensionService extends Disposable implements IExtensionService {
@@ -96,0 +97 @@ export class ExtensionService extends Disposable implements IExtensionService {
+ private readonly retry = (require('vs/../../../../packages/vscode/src/workbench') as typeof import ('vs/../../../../packages/vscode/src/workbench')).workbench.retry.register('Extension Host', () => this.startExtensionHost());
@@ -435,0 +437 @@ export class ExtensionService extends Disposable implements IExtensionService {
+ extHostProcessWorker.start().then(() => this.retry.recover());
@@ -458,0 +461 @@ export class ExtensionService extends Disposable implements IExtensionService {
@@ -442,0 +444 @@ export class ExtensionService extends Disposable implements IExtensionService {
+ extHostProcessWorker.start()!.then(() => this.retry.recover());
@@ -449,0 +452 @@ export class ExtensionService extends Disposable implements IExtensionService {
+ return this.retry.run();
diff --git a/src/vs/workbench/services/extensions/node/extensionHostProcess.ts b/src/vs/workbench/services/extensions/node/extensionHostProcess.ts
index 484cef9..f728fc8 100644
index 838a9c7..2308cee 100644
--- a/src/vs/workbench/services/extensions/node/extensionHostProcess.ts
+++ b/src/vs/workbench/services/extensions/node/extensionHostProcess.ts
@@ -137 +137 @@ function connectToRenderer(protocol: IMessagePassingProtocol): Promise<IRenderer
@@ -192 +192 @@ function connectToRenderer(protocol: IMessagePassingProtocol): Promise<IRenderer
- process.kill(initData.parentPid, 0); // throws an exception if the main process doesn't exist anymore.
+ // process.kill(initData.parentPid, 0); // throws an exception if the main process doesn't exist anymore.
diff --git a/src/vs/workbench/services/files/node/watcher/nsfw/watcherService.ts b/src/vs/workbench/services/files/node/watcher/nsfw/watcherService.ts
index ca03fc9..e8b6326 100644
index 33d3697..af71b01 100644
--- a/src/vs/workbench/services/files/node/watcher/nsfw/watcherService.ts
+++ b/src/vs/workbench/services/files/node/watcher/nsfw/watcherService.ts
@@ -26,0 +27 @@ export class FileWatcher {
@@ -946,7 +955,7 @@ index ca03fc9..e8b6326 100644
- }));
+ })).then(() => this.retry.recover());
diff --git a/src/vs/workbench/services/files/node/watcher/unix/watcherService.ts b/src/vs/workbench/services/files/node/watcher/unix/watcherService.ts
index 7e3a324..a880182 100644
index 8059d2c..b5a3d68 100644
--- a/src/vs/workbench/services/files/node/watcher/unix/watcherService.ts
+++ b/src/vs/workbench/services/files/node/watcher/unix/watcherService.ts
@@ -26,0 +27 @@ export class FileWatcher {
@@ -967,26 +976,44 @@ index 74dad64..7bc591a 100644
+ this.handle.stdout.once('data', () => this.retry.recover());
@@ -110,0 +113 @@ export class OutOfProcessWin32FolderWatcher {
+ return this.retry.run();
diff --git a/src/vs/workbench/services/files2/node/diskFileSystemProvider.ts b/src/vs/workbench/services/files2/node/diskFileSystemProvider.ts
index 18edf56..8e5b395 100644
--- a/src/vs/workbench/services/files2/node/diskFileSystemProvider.ts
+++ b/src/vs/workbench/services/files2/node/diskFileSystemProvider.ts
@@ -79,2 +79,2 @@ export class DiskFileSystemProvider extends Disposable implements IFileSystemPro
- for (let i = 0; i < children.length; i++) {
- const child = children[i];
+ await Promise.all(children.map(async (child) => { // for (let i = 0; i < children.length; i++) {
+ // const child = children[i];
@@ -88 +88 @@ export class DiskFileSystemProvider extends Disposable implements IFileSystemPro
- }
+ })); // }
diff --git a/src/vs/workbench/services/heap/node/heap.ts b/src/vs/workbench/services/heap/node/heap.ts
index 8f627ba..9a795eb 100644
--- a/src/vs/workbench/services/heap/node/heap.ts
+++ b/src/vs/workbench/services/heap/node/heap.ts
@@ -33,0 +34 @@ export class HeapService implements IHeapService {
+ if (typeof process === 'undefined' || typeof process.stdout === 'undefined') { return; } // Doesn't work in the browser (for running the extension host in worker).
diff --git a/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts b/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts
index 3c78990..545d91a 100644
index 0c3d16f..e27e98c 100644
--- a/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts
+++ b/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts
@@ -16 +16 @@ import { KeybindingParser } from 'vs/base/common/keybindingParser';
-import { OS, OperatingSystem } from 'vs/base/common/platform';
+import { OS, OperatingSystem, isNative } from 'vs/base/common/platform';
@@ -130 +130 @@ export class KeyboardMapperFactory {
@@ -131 +131 @@ export class KeyboardMapperFactory {
- if (OS === OperatingSystem.Windows) {
+ if (isNative && OS === OperatingSystem.Windows) {
diff --git a/src/vs/workbench/services/search/node/searchService.ts b/src/vs/workbench/services/search/node/searchService.ts
index 3eaafa4..3b4cb5f 100644
index fcef06a..80f6800 100644
--- a/src/vs/workbench/services/search/node/searchService.ts
+++ b/src/vs/workbench/services/search/node/searchService.ts
@@ -11 +11 @@ import { Event } from 'vs/base/common/event';
-import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle';
+import { Disposable, IDisposable, toDisposable, dispose } from 'vs/base/common/lifecycle';
@@ -433,0 +434 @@ export class DiskSearch implements ISearchResultProvider {
@@ -422,0 +423 @@ export class DiskSearch implements ISearchResultProvider {
+ private toDispose: IDisposable[] = [];
@@ -470,6 +471,15 @@ export class DiskSearch implements ISearchResultProvider {
@@ -458,6 +459,15 @@ export class DiskSearch implements ISearchResultProvider {
- const client = new Client(
- getPathFromAmdModule(require, 'bootstrap-fork'),
- opts);
@@ -1014,10 +1041,3 @@ index 6e6fbcc..645bd72 100644
+++ b/src/vs/workbench/services/timer/electron-browser/timerService.ts
@@ -426,0 +427 @@ export function didUseCachedData(): boolean {
+ return false;
diff --git a/src/vs/workbench/workbench.main.ts b/src/vs/workbench/workbench.main.ts
index 368fffe..8c172db 100644
--- a/src/vs/workbench/workbench.main.ts
+++ b/src/vs/workbench/workbench.main.ts
@@ -25 +25 @@ import 'vs/workbench/browser/actions/navigationActions';
-import 'vs/workbench/browser/parts/quickopen/quickopenActions';
+import 'vs/workbench/browser/parts/quickopen/quickOpenActions';

View File

@@ -4,7 +4,7 @@ set -euxo pipefail
# Builds a tarfile containing vscode sourcefiles neccessary for CI.
# Done outside the CI and uploaded to object storage to reduce CI time.
branch=1.32.0
branch=1.33.1
dir=/tmp/vstar
outfile=/tmp/vstar-$branch.tar.gz
rm -rf $dir

View File

@@ -21,7 +21,7 @@ module.exports = (options = {}) => ({
// they are parsed as URIs and will throw errors if not fully formed.
// The !! prefix causes it to ignore other loaders (doesn't work).
search: "require\\.toUrl\\(",
replace: "location.protocol + '//' + location.host + '/' + require('!!file-loader?name=[path][name].[ext]!' + ",
replace: "location.protocol + '//' + location.host + location.pathname.replace(/\\/$/,'') + '/' + require('!!file-loader?name=[path][name].[ext]!' + ",
flags: "g",
}, {
search: "require\\.__\\$__nodeRequire",