[devtools] Detect current VS Code executable on macOS#93473
Open
tomdai wants to merge 1 commit intovercel:canaryfrom
Open
[devtools] Detect current VS Code executable on macOS#93473tomdai wants to merge 1 commit intovercel:canaryfrom
tomdai wants to merge 1 commit intovercel:canaryfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Adds the current macOS executable names for Visual Studio Code and Visual Studio Code Insiders to the dev overlay launch-editor detection table.
This keeps the existing
Electronentries for older VS Code builds, while also detecting:/Applications/Visual Studio Code.app/Contents/MacOS/Code/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Code - InsidersWhy?
VS Code renamed its macOS executable from
Electronto the product short name in microsoft/vscode#291948. That PR also added anElectronsymlink for backwards compatibility, butps xreports the real executable path asCodefor current VS Code builds.When Next.js only scans for
.../Contents/MacOS/Electron, it can miss a running VS Code process and fall back toVISUAL/EDITOR. If that fallback is a terminal editor such asvim, the dev overlay opens Terminal instead of VS Code.How?
COMMON_EDITORS_MACOS.Electronpaths so older VS Code builds continue to be detected.guessEditor().Tests
npx pnpm@10.33.0 install --frozen-lockfilenpx pnpm@10.33.0 testonly packages/next/src/next-devtools/server/launch-editor.test.tsnpx pnpm@10.33.0 --filter=@next/font buildnpx pnpm@10.33.0 --filter=next typesnpx prettier@3.6.2 --check packages/next/src/next-devtools/server/launch-editor.ts packages/next/src/next-devtools/server/launch-editor.test.tsgit diff --checknpx pnpm@10.33.0 --filter=next build