)]}'
{
  "commit": "b322c111ab15d127dc447af44caab97f2a3ea72d",
  "tree": "98c1ef29f1d6a28cd35330439401876850d73379",
  "parents": [
    "165a6a29ed4c19c03caa2302a3561c973666ef98"
  ],
  "author": {
    "name": "Chris Bracken",
    "email": "chris@bracken.jp",
    "time": "Wed Jul 22 22:05:03 2026 +0000"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Jul 22 22:05:03 2026 +0000"
  },
  "message": "[ios,macos] Add Swift Sourcekit LSP support (#189761)\n\nThis adds a post-processing pass to `complie_commands.json` that\nsynthesizes the Swift entries that can be understood by SourceKit LSP\nand wires up the editor config needed to pick them up.\n\nGN\u0027s `--export-compile-commands` only understands the built-in\n`cc`/`cxx`/`objc`/`objcxx` tool types, and doesn\u0027t yet have built-in\nsupport for injecting `swiftc` lines, so our custom `swift` tool (which\ninvokes `swiftc.py`) never gets an entry there, meaning Swift code in\nthe iOS and macOS embedders isn\u0027t indexed by SourceKit LSP and other\ntooling that reads that file.\n\nSince GN\u0027s own compdb export omits the swift targets, `_postGn()` now\nshells out (once) to `ninja -t compdb` for the full compilation database\n(and falls back to the existing `compile_commands.json` on disk if that\nfails), then runs it through `expandSwiftcCommands`, which turns each\n`swiftc.py`-wrapped entry into one or more native `swiftc` invocations,\none per compiled Swift file, with relative paths resolved to absolute\nagainst the entry\u0027s `directory`.\n\nWe drop `-isystem` and `-Dkey\u003dvalue` flags since that\u0027s what `swiftc.py`\ndoes; swiftc only accepts boolean -D defines not key\u003dvalue flags.\n\nThis scans the raw ninja output directly rather than decoding all of\n`compile_commands.json`, which can run past 20MB and is too slow to\nparse wholesale in Dart; only the small handful of matched `swiftc.py`\nentries get `jsonDecode`d -- fewer than 10 lines.\n\nThis also wires up `.sourcekit-lsp/config.json` and the\n`swift.sourcekit-lsp.supported-languages` setting in\n`engine.code-workspace`/`engine-workspace.yaml` so that VS Code\u0027s Swift\nextension correctly picks up the generated compdb.\n\nFixes https://github.com/flutter/flutter/issues/185741\n\n## Pre-launch Checklist\n\n- [X] I read the [Contributor Guide] and followed the process outlined\nthere for submitting PRs.\n- [X] I read the [AI contribution guidelines] and understand my\nresponsibilities, or I am not using AI tools.\n- [X] I read the [Tree Hygiene] wiki page, which explains my\nresponsibilities.\n- [X] I read and followed the [Flutter Style Guide], including [Features\nwe expect every widget to implement].\n- [X] I signed the [CLA].\n- [X] I listed at least one issue that this PR fixes in the description\nabove.\n- [X] I updated/added relevant documentation (doc comments with `///`).\n- [X] I added new tests to check the change I am making, or this PR is\n[test-exempt].\n- [X] I followed the [breaking change policy] and added [Data Driven\nFixes] where supported.\n- [X] All existing and new tests are passing.\n\nIf you need help, consider asking for advice on the #hackers-new channel\non [Discord].\n\nIf this change needs to override an active code freeze, provide a\ncomment explaining why. The code freeze workflow can be overridden by\ncode reviewers. See pinned issues for any active code freezes with\nguidance.\n\n**Note**: The Flutter team is currently trialing the use of [Gemini Code\nAssist for\nGitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).\nComments from the `gemini-code-assist` bot should not be taken as\nauthoritative feedback from the Flutter team. If you find its comments\nuseful you can update your code accordingly, but if you are unsure or\ndisagree with the feedback, please feel free to wait for a Flutter team\nmember\u0027s review for guidance on which automated comments should be\naddressed.\n\n\u003c!-- Links --\u003e\n[Contributor Guide]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview\n[AI contribution guidelines]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines\n[Tree Hygiene]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md\n[test-exempt]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests\n[Flutter Style Guide]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md\n[Features we expect every widget to implement]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement\n[CLA]: https://cla.developers.google.com/\n[flutter/tests]: https://github.com/flutter/tests\n[breaking change policy]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes\n[Discord]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md\n[Data Driven Fixes]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md",
  "tree_diff": [
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "e7d11af0287e1079764a927d6169de0d920607bb",
      "new_mode": 33188,
      "new_path": "engine/src/flutter/.sourcekit-lsp/config.json"
    },
    {
      "type": "modify",
      "old_id": "b3c6a99ff0fafeffcdf35fa63e885e979c85780e",
      "old_mode": 33188,
      "old_path": "engine/src/flutter/engine.code-workspace",
      "new_id": "f26720113c4b2151f6f68effeb700c188b20334b",
      "new_mode": 33188,
      "new_path": "engine/src/flutter/engine.code-workspace"
    },
    {
      "type": "modify",
      "old_id": "0d97ec4e82ca6103308f8a262aece080ddc908b8",
      "old_mode": 33188,
      "old_path": "engine/src/flutter/tools/clang_tidy/test/header_filter_regex_test.dart",
      "new_id": "3abde0f901e486aff6f91886d92657874b2ef3f8",
      "new_mode": 33188,
      "new_path": "engine/src/flutter/tools/clang_tidy/test/header_filter_regex_test.dart"
    },
    {
      "type": "modify",
      "old_id": "99d15ef38ca7c9774f78246e32ed27a03b9b3591",
      "old_mode": 33188,
      "old_path": "engine/src/flutter/tools/engine_tool/test/commands/build_command_test.dart",
      "new_id": "bba1b8900e0e73d26a2a48356a889a6bc5555880",
      "new_mode": 33188,
      "new_path": "engine/src/flutter/tools/engine_tool/test/commands/build_command_test.dart"
    },
    {
      "type": "modify",
      "old_id": "2d3c6c4aef1b407edf125bc76d83f3de62774ee3",
      "old_mode": 33188,
      "old_path": "engine/src/flutter/tools/engine_tool/test/commands/run_command_test.dart",
      "new_id": "d1ca5bcce7a903bd859100bb8c60c10a602555ce",
      "new_mode": 33188,
      "new_path": "engine/src/flutter/tools/engine_tool/test/commands/run_command_test.dart"
    },
    {
      "type": "modify",
      "old_id": "b472509a234d55b9807b06af6d52febc8207a85d",
      "old_mode": 33188,
      "old_path": "engine/src/flutter/tools/pkg/engine_build_configs/lib/src/build_config_runner.dart",
      "new_id": "d7aecb21e425f276500e2ba252983beef21c1199",
      "new_mode": 33188,
      "new_path": "engine/src/flutter/tools/pkg/engine_build_configs/lib/src/build_config_runner.dart"
    },
    {
      "type": "modify",
      "old_id": "0397eddd7fc2cba462f94e67f05847b4e8465ee0",
      "old_mode": 33188,
      "old_path": "engine/src/flutter/tools/pkg/engine_build_configs/lib/src/update_compdb.dart",
      "new_id": "7d79ebdc210e13fa014692cc5e8102315cd52bc2",
      "new_mode": 33188,
      "new_path": "engine/src/flutter/tools/pkg/engine_build_configs/lib/src/update_compdb.dart"
    },
    {
      "type": "modify",
      "old_id": "81678fcce6e1aa4150a09c47c7045b9508563d89",
      "old_mode": 33188,
      "old_path": "engine/src/flutter/tools/pkg/engine_build_configs/test/update_compdb_test.dart",
      "new_id": "96df159482a199ba34ebe1419170a0be6b976b5d",
      "new_mode": 33188,
      "new_path": "engine/src/flutter/tools/pkg/engine_build_configs/test/update_compdb_test.dart"
    },
    {
      "type": "modify",
      "old_id": "e70e3504e0d57d989fade0ce1e89093ae00c4f3f",
      "old_mode": 33188,
      "old_path": "engine/src/flutter/tools/vscode_workspace/engine-workspace.yaml",
      "new_id": "9e794046ac1ca3ec2416fa34b00ace30401e0489",
      "new_mode": 33188,
      "new_path": "engine/src/flutter/tools/vscode_workspace/engine-workspace.yaml"
    }
  ]
}
