)]}'
{
  "commit": "e227a53e73a48e01ef35342a18a1d7db44bb26ef",
  "tree": "bc328d9eda8287a722d3869e642092f4800ce34e",
  "parents": [
    "6cbeeacfcd0b3bed4bb186e13df86bb3fbc720c0"
  ],
  "author": {
    "name": "Madeline Kalil",
    "email": "mkalil@google.com",
    "time": "Tue Jun 16 17:50:18 2026 -0400"
  },
  "committer": {
    "name": "Gopher Robot",
    "email": "gobot@golang.org",
    "time": "Mon Jul 13 07:34:58 2026 -0700"
  },
  "message": "gopls/internal/golang: fix crash in ExtractToNewFile\n\nThe crash in ExtractToFile is caused by a known\nbug in the parser (#57490): when a declaration at EOF\nis not correctly terminated, the parser error recovery\nwill add the missing closing token, which makes the end\nposition of that node one more than EOF.\n\nExample:\nfunc foo() { var x // FuncDecl.End() \u003d EOF + 1\n\nThen in ExtractToFile, end - fileStart is out of bounds.\n\nIn CL 559436, we added a workaround so that methods\nthat depend on offsets/positions will adjust the values\nif needed to avoid this out of bounds issue.\n\nIf we use safetoken.Offsets to calculate the bounds\ninstead of directly using\npgf.Src[start-fileStart : end-fileStart]\nthen the offsets are adjusted for us. Instead of\nreporting a bug for the out of bounds error,\nExtractToFile will fail to format the extracted\nsource and return a more relevant error to the user.\n\nFixes golang/go#70553\n\nChange-Id: I2ef7f2d5e880e3e73e04da3f68c689887571d973\nReviewed-on: https://go-review.googlesource.com/c/tools/+/798422\nReviewed-by: Alan Donovan \u003cadonovan@google.com\u003e\nLUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com \u003cgolang-scoped@luci-project-accounts.iam.gserviceaccount.com\u003e\nAuto-Submit: Madeline Kalil \u003cmkalil@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "9bd3d5bc6e78e7f07eb296adb7eeb99116eb699f",
      "old_mode": 33188,
      "old_path": "gopls/internal/golang/extracttofile.go",
      "new_id": "054220f0aee5681aa45ac30a17a0a8479d5caecb",
      "new_mode": 33188,
      "new_path": "gopls/internal/golang/extracttofile.go"
    },
    {
      "type": "modify",
      "old_id": "5577b5e9e26fb608264cd0bd77630f9c47ad4cec",
      "old_mode": 33188,
      "old_path": "gopls/internal/test/marker/testdata/codeaction/extracttofile.txt",
      "new_id": "950bde1586317bc46d962e20c5be3f446bb4a2d5",
      "new_mode": 33188,
      "new_path": "gopls/internal/test/marker/testdata/codeaction/extracttofile.txt"
    }
  ]
}
