Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create the named pipe server on the extension host #143891

Closed
wants to merge 1 commit into from

Conversation

alexdima
Copy link
Member

@alexdima alexdima commented Feb 24, 2022

This PR tries to work around a problem found in #142786 by creating the named pipe server on the extension host process and connecting to it from the renderer process.

This always fails to launch for me on a slow Windows VM. But after applying the following change things appear to work 馃く :

diff --git a/src/vs/workbench/services/extensions/electron-browser/localProcessExtensionHost.ts b/src/vs/workbench/services/extensions/electron-browser/localProcessExtensionHost.ts
index 465993a2740..3ec9e5a9b8b 100644
--- a/src/vs/workbench/services/extensions/electron-browser/localProcessExtensionHost.ts
+++ b/src/vs/workbench/services/extensions/electron-browser/localProcessExtensionHost.ts
@@ -394,12 +394,11 @@ export class LocalProcessExtensionHost implements IExtensionHost {
 		return new Promise((resolve, reject) => {
 			const socket = createConnection(pipeName, () => {
 				socket.off('error', reject);
-
-				// !!! We need to add a 'data' listener immediately to the
-				// socket to avoid missing any events.
-				resolve(new PersistentProtocol(new NodeSocket(socket, 'renderer-exthost')));
 			});
 			socket.on('error', reject);
+			// !!! We need to add a 'data' listener immediately to the
+			// socket to avoid missing any events.
+			resolve(new PersistentProtocol(new NodeSocket(socket, 'renderer-exthost')));
 		});
 	}
 

@alexdima alexdima self-assigned this Feb 24, 2022
@alexdima alexdima closed this Mar 17, 2022
@github-actions github-actions bot locked and limited conversation to collaborators May 1, 2022
@alexdima alexdima deleted the alex/ext-host-named-pipe-server branch December 6, 2022 08:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant