From f67e9c55efc82c35441280a9a7acefd701761c70 Mon Sep 17 00:00:00 2001 From: Ian Obermiller Date: Fri, 6 Oct 2023 14:24:26 -0700 Subject: [PATCH] Make the Relay Compiler Terminal Transient (#4455) Summary: If you enable `relay.autoStartCompiler`, the extension will open a compiler in a new Terminal on every VS Code reload (e.g. Developer: Reload Window). This can easily lead to many copies of the compiler running. Instead, we can mark the terminal with `isTransient`, and it won't survive reloads. While this means reloads must restart the compiler, it is very fast and this avoid many "Relay Compiler" terminals. Pull Request resolved: https://github.com/facebook/relay/pull/4455 Test Plan: - Debug on a project with `"relay.autoStartCompiler": true` - Reload the window - Note there is only one "Relay Compiler" terminal Reviewed By: alunyov Differential Revision: D50021664 Pulled By: captbaritone fbshipit-source-id: 8f725eff1d5e76d98e689641ee64c6a81b587a06 --- vscode-extension/src/compiler.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/vscode-extension/src/compiler.ts b/vscode-extension/src/compiler.ts index a8bc7b4fa14f3..5e5a9c8ef389d 100644 --- a/vscode-extension/src/compiler.ts +++ b/vscode-extension/src/compiler.ts @@ -25,6 +25,7 @@ export function createAndStartCompiler(context: RelayExtensionContext) { const terminal = window.createTerminal({ name: 'Relay Compiler', cwd: context.relayBinaryExecutionOptions.rootPath, + isTransient: true, }); terminal.sendText(