Skip to content

Restore socket write patch #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/vs/server/@types/code-server-lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ declare global {
executableName: string;
}

export type RemoteCLIMain = (desc: ProductDescription, args: string[]) => void;

export interface IServerAPI {
handleRequest(req: http.IncomingMessage, res: http.ServerResponse): Promise<void>;
handleUpgrade(req: http.IncomingMessage, socket: net.Socket): void;
Expand Down
5 changes: 2 additions & 3 deletions src/vs/server/remoteCli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,5 @@ function mapFileToRemoteUri(uri: string): string {
return uri.replace(/^file:\/\//, 'vscode-remote://' + cliRemoteAuthority);
}

// let [, , productName, version, commit, executableName, ...remainingArgs] = process.argv;
// main({ productName, version, commit, executableName }, remainingArgs);

let [, , productName, version, commit, executableName, ...remainingArgs] = process.argv;
main({ productName, version, commit, executableName }, remainingArgs);
11 changes: 11 additions & 0 deletions src/vs/workbench/api/node/extHostExtensionService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
* 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';
Expand Down Expand Up @@ -59,6 +62,14 @@ export class ExtHostExtensionService extends AbstractExtHostExtensionService {
if (this._initData.remote.isRemote && this._initData.remote.authority) {
const cliServer = this._instaService.createInstance(CLIServer);
process.env['VSCODE_IPC_HOOK_CLI'] = cliServer.ipcHandlePath;

/**
* Write this out so we can get the most recent path.
* @author coder
*/
fs.writeFile(path.join(os.tmpdir(), 'vscode-ipc'), cliServer.ipcHandlePath).catch((error) => {
this._logService.error(error);
});
}

// Module loading tricks
Expand Down