code-server/patches/store-socket.diff
Florian Ritterhoff 2bfe15b3e9
chore: update Code to 1.70 (#5422)
* Update upstream Code to 1.70

* Update CSP hashes

* Update comment on remote authority

Also remove it from script-src since it is invalid anyway.

* Use absolute path for disable download patch

Just to keep it consistent with the other imports.  We initially added
the patch like this so it was not part of the upgrade but might as well
fix it now.

* Fix inability to change language while code-server is running

Co-authored-by: Asher <ash@coder.com>
2022-08-16 20:27:23 -05:00

38 lines
1.6 KiB
Diff

Store a static reference to the IPC socket
This lets us use it to open files inside code-server from outside of
code-server.
To test this:
1. run code-server
2. open file outside of code-server i.e. `code-server <path-to-file`
It should open in your existing code-server instance.
Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostExtensionService.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/api/node/extHostExtensionService.ts
+++ code-server/lib/vscode/src/vs/workbench/api/node/extHostExtensionService.ts
@@ -2,7 +2,9 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
-
+import { promises as fs } from 'fs';
+import * as os from 'os'
+import * as path from 'vs/base/common/path';
import * as performance from 'vs/base/common/performance';
import { createApiFactoryAndRegisterActors } from 'vs/workbench/api/common/extHost.api.impl';
import { RequireInterceptor } from 'vs/workbench/api/common/extHostRequireInterceptor';
@@ -72,6 +74,10 @@ export class ExtHostExtensionService ext
if (this._initData.remote.isRemote && this._initData.remote.authority) {
const cliServer = this._instaService.createInstance(CLIServer);
process.env['VSCODE_IPC_HOOK_CLI'] = cliServer.ipcHandlePath;
+
+ fs.writeFile(path.join(os.tmpdir(), 'vscode-ipc'), cliServer.ipcHandlePath).catch((error) => {
+ this._logService.error(error);
+ });
}
// Module loading tricks