feat(swift): choose the Xcode a project uses and pass it to its tools as DEVELOPER_DIR (#6964)

Settings > Languages > Swift gets an Xcode field (empty = the xcode-select one). For a trusted project the chosen Xcode.app or Contents/Developer becomes DEVELOPER_DIR in the project environment, so sourcekit-lsp, xcodebuild, xcrun, simulators, debug adapters and terminals use it; it overrides a DEVELOPER_DIR from .envrc and is not applied to untrusted projects or LightEdit.

Closes #6963

Co-authored-by: wildcatDownstairs <[email protected]>
Цей коміт міститься в:
LU XIANGRUIтаwildcatDownstairs authored and GitHub committed 2026-11-30 20:43:48 +08:00
1 джерело 485d7bf99d
коміт 0cfabdbbbd
28 files changed
+403 -32

No files matched your search

+2
Переглянути файл
@@ -288,6 +288,8 @@ describe("catalogs", () => {
"fillfactor=70, autovacuum_enabled=false",
// The placeholder of an Xcode run configuration's project or workspace field.
"App.xcodeproj",
// The Swift settings field naming the Xcode a project uses.
"Xcode",
// GitHub's product name, the title of its tool window.
"GitHub Actions",
"Flutter DevTools",
+5
Переглянути файл
@@ -194,6 +194,8 @@ export interface LanguagesValid {
zig: { zig: string };
/** Flutter SDK root; empty = `flutter` / `dart` on PATH. */
flutter: { sdk: string };
/** `Xcode.app` (or its `Contents/Developer`) the project's Apple tools use; empty = `xcode-select`'s. */
swift: { xcode: string };
node: {
runTarget: string;
interpreter: string;
@@ -339,6 +341,7 @@ export const DEFAULT_LANGUAGES: LanguagesValid = {
ruby: { interpreter: "" },
zig: { zig: "" },
flutter: { sdk: "" },
swift: { xcode: "" },
node: { runTarget: "", interpreter: "", packageManager: "", runtime: "" },
php: { runTarget: "", interpreter: "", languageLevel: "", includePaths: [], stubs: [], phpstanConfig: "" },
rust: { toolchain: "", stdlib: "", checkOnSave: true, checkCommand: "check", rustfmtArgs: "" },
@@ -472,6 +475,7 @@ export function validateLanguages(raw: unknown): LanguagesValid {
const ruby = obj(l.ruby);
const zig = obj(l.zig);
const flutter = obj(l.flutter);
const swift = obj(l.swift);
const node = obj(l.node);
const php = obj(l.php);
const rust = obj(l.rust);
@@ -506,6 +510,7 @@ export function validateLanguages(raw: unknown): LanguagesValid {
ruby: { interpreter: text(ruby.interpreter, d.ruby.interpreter) },
zig: { zig: text(zig.zig, d.zig.zig) },
flutter: { sdk: text(flutter.sdk, d.flutter.sdk) },
swift: { xcode: text(swift.xcode, d.swift.xcode) },
node: {
runTarget: text(node.runTarget, ""),
interpreter: text(node.interpreter, d.node.interpreter),
+3
Переглянути файл
@@ -6535,6 +6535,9 @@
"Select Zig Directory": "Выбрать каталог Zig",
"Zig toolchain": "Инструментарий Zig",
"Zig whose standard library and build.zig.zon packages appear under External Libraries. ZLS must match this Zig version. PATH, Homebrew, zvm and mise / asdf installs are detected.": "Zig, стандартная библиотека и пакеты build.zig.zon которого отображаются в разделе «Внешние библиотеки». Версия ZLS должна соответствовать этой версии Zig. Обнаруживаются установки из PATH, Homebrew, zvm и mise / asdf.",
"Xcode": "Xcode",
"Select Xcode": "Выбрать Xcode",
"Xcode whose tools this project uses: sourcekit-lsp, xcodebuild, simctl, lldb-dap and terminals get it as DEVELOPER_DIR. Changing it restarts sourcekit-lsp.": "Xcode, инструменты которого использует проект: sourcekit-lsp, xcodebuild, simctl, lldb-dap и терминалы получают его как DEVELOPER_DIR. При изменении sourcekit-lsp перезапускается.",
"Monospaced": "Моноширинный",
"Proportional": "Пропорциональный",
"Loading system fonts…": "Загрузка системных шрифтов…",
+3
Переглянути файл
@@ -6054,6 +6054,9 @@
"Select Zig Directory": "選擇 Zig 目錄",
"Zig toolchain": "Zig 工具鏈",
"Zig whose standard library and build.zig.zon packages appear under External Libraries. ZLS must match this Zig version. PATH, Homebrew, zvm and mise / asdf installs are detected.": "用於在「外部庫」下列出 Zig 標準庫和 build.zig.zon 依賴的 Zig。ZLS 版本必須與該 Zig 版本符合。可檢測 PATH、Homebrew、zvm 以及 mise / asdf 的安裝。",
"Xcode": "Xcode",
"Select Xcode": "選擇 Xcode",
"Xcode whose tools this project uses: sourcekit-lsp, xcodebuild, simctl, lldb-dap and terminals get it as DEVELOPER_DIR. Changing it restarts sourcekit-lsp.": "此專案使用其工具的 Xcode:sourcekit-lsp、xcodebuild、simctl、lldb-dap 和終端機會以 DEVELOPER_DIR 取得它。修改後會重新啟動 sourcekit-lsp。",
"Monospaced": "等寬",
"Proportional": "非等寬",
"Loading system fonts…": "正在載入系統字型…",
+3
Переглянути файл
@@ -6898,6 +6898,9 @@
"Select Zig Directory": "选择 Zig 目录",
"Zig toolchain": "Zig 工具链",
"Zig whose standard library and build.zig.zon packages appear under External Libraries. ZLS must match this Zig version. PATH, Homebrew, zvm and mise / asdf installs are detected.": "用于在“外部库”下列出 Zig 标准库和 build.zig.zon 依赖的 Zig。ZLS 版本必须与该 Zig 版本匹配。可检测 PATH、Homebrew、zvm 以及 mise / asdf 的安装。",
"Xcode": "Xcode",
"Select Xcode": "选择 Xcode",
"Xcode whose tools this project uses: sourcekit-lsp, xcodebuild, simctl, lldb-dap and terminals get it as DEVELOPER_DIR. Changing it restarts sourcekit-lsp.": "此项目使用其工具的 Xcode:sourcekit-lsp、xcodebuild、simctl、lldb-dap 和终端会以 DEVELOPER_DIR 得到它。修改后会重启 sourcekit-lsp。",
"Monospaced": "等宽",
"Proportional": "非等宽",
"Loading system fonts…": "正在加载系统字体…",