Compare commits
5 Commits
1.903-vsc1
...
1.939-vsc1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2bc6e1a457 | ||
|
|
e61ea796c6 | ||
|
|
d073622629 | ||
|
|
5f40ebb845 | ||
|
|
c56e2797cc |
@@ -23,6 +23,10 @@ docker run -it -p 127.0.0.1:8443:8443 -v "${PWD}:/home/coder/project" codercom/c
|
|||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
|
### Run over SSH
|
||||||
|
|
||||||
|
Use [sshcode](https://github.com/codercom/sshcode) for a simple setup.
|
||||||
|
|
||||||
### Docker
|
### Docker
|
||||||
|
|
||||||
See docker oneliner mentioned above. Dockerfile is at [/Dockerfile](/Dockerfile).
|
See docker oneliner mentioned above. Dockerfile is at [/Dockerfile](/Dockerfile).
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ commander.version(process.env.VERSION || "development")
|
|||||||
.option("-H, --allow-http", "Allow http connections.", false)
|
.option("-H, --allow-http", "Allow http connections.", false)
|
||||||
.option("-P, --password <value>", "DEPRECATED: Use the PASSWORD environment variable instead. Specify a password for authentication.")
|
.option("-P, --password <value>", "DEPRECATED: Use the PASSWORD environment variable instead. Specify a password for authentication.")
|
||||||
.option("--disable-telemetry", "Disables ALL telemetry.", false)
|
.option("--disable-telemetry", "Disables ALL telemetry.", false)
|
||||||
|
.option("--socket <value>", "Listen on a UNIX socket. Host and port will be ignored when set.")
|
||||||
.option("--install-extension <value>", "Install an extension by its ID.")
|
.option("--install-extension <value>", "Install an extension by its ID.")
|
||||||
.option("--bootstrap-fork <name>", "Used for development. Never set.")
|
.option("--bootstrap-fork <name>", "Used for development. Never set.")
|
||||||
.option("--extra-args <args>", "Used for development. Never set.")
|
.option("--extra-args <args>", "Used for development. Never set.")
|
||||||
@@ -63,6 +64,7 @@ const bold = (text: string | number): string | number => {
|
|||||||
readonly open?: boolean;
|
readonly open?: boolean;
|
||||||
readonly cert?: string;
|
readonly cert?: string;
|
||||||
readonly certKey?: string;
|
readonly certKey?: string;
|
||||||
|
readonly socket?: string;
|
||||||
|
|
||||||
readonly installExtension?: string;
|
readonly installExtension?: string;
|
||||||
|
|
||||||
@@ -267,7 +269,11 @@ const bold = (text: string | number): string | number => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
logger.info("Starting webserver...", field("host", options.host), field("port", options.port));
|
logger.info("Starting webserver...", field("host", options.host), field("port", options.port));
|
||||||
app.server.listen(options.port, options.host);
|
if (options.socket) {
|
||||||
|
app.server.listen(options.socket);
|
||||||
|
} else {
|
||||||
|
app.server.listen(options.port, options.host);
|
||||||
|
}
|
||||||
let clientId = 1;
|
let clientId = 1;
|
||||||
app.wss.on("connection", (ws, req) => {
|
app.wss.on("connection", (ws, req) => {
|
||||||
const id = clientId++;
|
const id = clientId++;
|
||||||
@@ -284,7 +290,11 @@ const bold = (text: string | number): string | number => {
|
|||||||
});
|
});
|
||||||
app.wss.on("error", (err: NodeJS.ErrnoException) => {
|
app.wss.on("error", (err: NodeJS.ErrnoException) => {
|
||||||
if (err.code === "EADDRINUSE") {
|
if (err.code === "EADDRINUSE") {
|
||||||
logger.error(`Port ${bold(options.port)} is in use. Please free up port ${options.port} or specify a different port with the -p flag`);
|
if (options.socket) {
|
||||||
|
logger.error(`Socket ${bold(options.socket)} is in use. Please specify a different socket.`);
|
||||||
|
} else {
|
||||||
|
logger.error(`Port ${bold(options.port)} is in use. Please free up port ${options.port} or specify a different port with the -p flag`);
|
||||||
|
}
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,6 +2,17 @@ import * as vscodeTextmate from "../../../../lib/vscode/node_modules/vscode-text
|
|||||||
|
|
||||||
const target = vscodeTextmate as typeof vscodeTextmate;
|
const target = vscodeTextmate as typeof vscodeTextmate;
|
||||||
|
|
||||||
|
const ctx = (require as any).context("../../../../lib/extensions", true, /.*\.tmLanguage.json$/);
|
||||||
|
// Maps grammar scope to loaded grammar
|
||||||
|
const scopeToGrammar = {} as any;
|
||||||
|
|
||||||
|
ctx.keys().forEach((key: string) => {
|
||||||
|
const value = ctx(key);
|
||||||
|
if (value.scopeName) {
|
||||||
|
scopeToGrammar[value.scopeName] = value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
target.Registry = class Registry extends vscodeTextmate.Registry {
|
target.Registry = class Registry extends vscodeTextmate.Registry {
|
||||||
public constructor(opts: vscodeTextmate.RegistryOptions) {
|
public constructor(opts: vscodeTextmate.RegistryOptions) {
|
||||||
super({
|
super({
|
||||||
@@ -21,6 +32,13 @@ target.Registry = class Registry extends vscodeTextmate.Registry {
|
|||||||
}).catch(reason => rej(reason));
|
}).catch(reason => rej(reason));
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
loadGrammar: async (scopeName: string) => {
|
||||||
|
if (scopeToGrammar[scopeName]) {
|
||||||
|
return scopeToGrammar[scopeName];
|
||||||
|
}
|
||||||
|
|
||||||
|
return opts.loadGrammar(scopeName);
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ index 1f8b17a..2a875f9 100644
|
|||||||
+ await cli.main(args);
|
+ await cli.main(args);
|
||||||
+ return; // Always just do this for now.
|
+ return; // Always just do this for now.
|
||||||
diff --git a/src/vs/editor/browser/config/configuration.ts b/src/vs/editor/browser/config/configuration.ts
|
diff --git a/src/vs/editor/browser/config/configuration.ts b/src/vs/editor/browser/config/configuration.ts
|
||||||
index f97a692..0206957 100644
|
index f97a692..8059a67 100644
|
||||||
--- a/src/vs/editor/browser/config/configuration.ts
|
--- a/src/vs/editor/browser/config/configuration.ts
|
||||||
+++ b/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';
|
@@ -10 +9,0 @@ import { Disposable } from 'vs/base/common/lifecycle';
|
||||||
@@ -187,9 +187,6 @@ index f97a692..0206957 100644
|
|||||||
@@ -367 +366 @@ export class Configuration extends CommonEditorConfiguration {
|
@@ -367 +366 @@ export class Configuration extends CommonEditorConfiguration {
|
||||||
- if (platform.isMacintosh) {
|
- if (platform.isMacintosh) {
|
||||||
+ if (browser.isMacintosh) {
|
+ if (browser.isMacintosh) {
|
||||||
@@ -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
|
diff --git a/src/vs/editor/browser/controller/mouseHandler.ts b/src/vs/editor/browser/controller/mouseHandler.ts
|
||||||
index b3b4472..f888d63 100644
|
index b3b4472..f888d63 100644
|
||||||
--- a/src/vs/editor/browser/controller/mouseHandler.ts
|
--- a/src/vs/editor/browser/controller/mouseHandler.ts
|
||||||
@@ -250,32 +247,57 @@ index c69ea3f..b8d87f7 100644
|
|||||||
-const GOLDEN_LINE_HEIGHT_RATIO = platform.isMacintosh ? 1.5 : 1.35;
|
-const GOLDEN_LINE_HEIGHT_RATIO = platform.isMacintosh ? 1.5 : 1.35;
|
||||||
+const GOLDEN_LINE_HEIGHT_RATIO = browser.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
|
diff --git a/src/vs/editor/contrib/clipboard/clipboard.ts b/src/vs/editor/contrib/clipboard/clipboard.ts
|
||||||
index 990be3a..8a326c6 100644
|
index 990be3a..4bec789 100644
|
||||||
--- a/src/vs/editor/contrib/clipboard/clipboard.ts
|
--- a/src/vs/editor/contrib/clipboard/clipboard.ts
|
||||||
+++ b/src/vs/editor/contrib/clipboard/clipboard.ts
|
+++ b/src/vs/editor/contrib/clipboard/clipboard.ts
|
||||||
@@ -29 +29,2 @@ const supportsCopyWithSyntaxHighlighting = (supportsCopy && !browser.isEdgeOrIE)
|
@@ -18,0 +19 @@ import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegis
|
||||||
|
+import { clipboard } from 'electron';
|
||||||
|
@@ -29 +30,2 @@ const supportsCopyWithSyntaxHighlighting = (supportsCopy && !browser.isEdgeOrIE)
|
||||||
-const supportsPaste = (platform.isNative || (!browser.isChrome && document.queryCommandSupported('paste')));
|
-const supportsPaste = (platform.isNative || (!browser.isChrome && document.queryCommandSupported('paste')));
|
||||||
+// const supportsPaste = (platform.isNative || (!browser.isChrome && document.queryCommandSupported('paste')));
|
+// const supportsPaste = (platform.isNative || (!browser.isChrome && document.queryCommandSupported('paste')));
|
||||||
+const supportsPaste = true;
|
+const supportsPaste = true;
|
||||||
@@ -176,0 +178 @@ class ExecCommandPasteAction extends ExecCommandAction {
|
@@ -54,0 +57 @@ abstract class ExecCommandAction extends EditorAction {
|
||||||
|
+ console.log(document.activeElement!.cloneNode(true));
|
||||||
|
@@ -71 +74 @@ class ExecCommandCutAction extends ExecCommandAction {
|
||||||
|
- kbOpts = null;
|
||||||
|
+ // kbOpts = null;
|
||||||
|
@@ -119 +122 @@ class ExecCommandCopyAction extends ExecCommandAction {
|
||||||
|
- kbOpts = null;
|
||||||
|
+ // kbOpts = null;
|
||||||
|
@@ -174 +177 @@ class ExecCommandPasteAction extends ExecCommandAction {
|
||||||
|
- kbOpts = null;
|
||||||
|
+ // kbOpts = null;
|
||||||
|
@@ -176,0 +180 @@ class ExecCommandPasteAction extends ExecCommandAction {
|
||||||
+ const { workbench } = require('vs/../../../../packages/vscode/src/workbench') as typeof import ('vs/../../../../packages/vscode/src/workbench');
|
+ const { workbench } = require('vs/../../../../packages/vscode/src/workbench') as typeof import ('vs/../../../../packages/vscode/src/workbench');
|
||||||
@@ -181 +183 @@ class ExecCommandPasteAction extends ExecCommandAction {
|
@@ -181 +185 @@ class ExecCommandPasteAction extends ExecCommandAction {
|
||||||
- precondition: EditorContextKeys.writable,
|
- precondition: EditorContextKeys.writable,
|
||||||
+ precondition: (require('vs/platform/contextkey/common/contextkey') as typeof import('vs/platform/contextkey/common/contextkey')).ContextKeyExpr.and(EditorContextKeys.writable, workbench.clipboardContextKey),
|
+ precondition: (require('vs/platform/contextkey/common/contextkey') as typeof import('vs/platform/contextkey/common/contextkey')).ContextKeyExpr.and(EditorContextKeys.writable, workbench.clipboardContextKey),
|
||||||
@@ -191 +193,2 @@ class ExecCommandPasteAction extends ExecCommandAction {
|
@@ -191 +195,2 @@ class ExecCommandPasteAction extends ExecCommandAction {
|
||||||
- order: 3
|
- order: 3
|
||||||
+ order: 3,
|
+ order: 3,
|
||||||
+ when: workbench.clipboardContextKey,
|
+ when: workbench.clipboardContextKey,
|
||||||
@@ -194,0 +198,14 @@ class ExecCommandPasteAction extends ExecCommandAction {
|
@@ -194,0 +200,26 @@ class ExecCommandPasteAction extends ExecCommandAction {
|
||||||
+
|
+
|
||||||
+ public async run(accessor, editor: ICodeEditor): Promise<void> {
|
+ public async run(accessor, editor: ICodeEditor): Promise<void> {
|
||||||
+ if (editor instanceof (require('vs/editor/browser/widget/codeEditorWidget') as typeof import('vs/editor/browser/widget/codeEditorWidget')).CodeEditorWidget) {
|
+ if (editor instanceof (require('vs/editor/browser/widget/codeEditorWidget') as typeof import('vs/editor/browser/widget/codeEditorWidget')).CodeEditorWidget) {
|
||||||
+ try {
|
+ try {
|
||||||
+ editor.trigger('', (require('vs/editor/common/editorCommon') as typeof import ('vs/editor/common/editorCommon')).Handler.Paste, {
|
+ editor.focus();
|
||||||
+ text: await (require('vs/../../../../packages/vscode/src/workbench') as typeof import ('vs/../../../../packages/vscode/src/workbench')).workbench.clipboardText,
|
+ const textInput = document.activeElement! as HTMLTextAreaElement;
|
||||||
|
+ const dataTransfer = new DataTransfer();
|
||||||
|
+ const value = await clipboard.readText();
|
||||||
|
+ dataTransfer.setData("text/plain", value);
|
||||||
|
+ const pasteEvent = new ClipboardEvent("paste", {
|
||||||
|
+ clipboardData: dataTransfer,
|
||||||
+ });
|
+ });
|
||||||
|
+ textInput.dispatchEvent(pasteEvent);
|
||||||
+ } catch (ex) {
|
+ } catch (ex) {
|
||||||
+ super.run(accessor, editor);
|
+ try {
|
||||||
|
+ editor.trigger('', (require('vs/editor/common/editorCommon') as typeof import ('vs/editor/common/editorCommon')).Handler.Paste, {
|
||||||
|
+ text: await (require('vs/../../../../packages/vscode/src/workbench') as typeof import ('vs/../../../../packages/vscode/src/workbench')).workbench.clipboardText,
|
||||||
|
+ });
|
||||||
|
+ } catch (ex) {
|
||||||
|
+ super.run(accessor, editor);
|
||||||
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ } else {
|
+ } else {
|
||||||
+ super.run(accessor, editor);
|
+ super.run(accessor, editor);
|
||||||
|
|||||||
Reference in New Issue
Block a user