)]}'
{
  "commit": "6f4f008689da0001e7e1fc8f5f9dcaba40c3bcd3",
  "tree": "dd77bb5f8df62cb0c29a8c4a10f84997a20dc2ac",
  "parents": [
    "5bf02b21f123b83264fa2cf2d4b7aab4759d2d3c"
  ],
  "author": {
    "name": "Muir Manders",
    "email": "muir@mnd.rs",
    "time": "Thu Aug 06 22:33:47 2020 -0700"
  },
  "committer": {
    "name": "Rebecca Stambler",
    "email": "rstambler@golang.org",
    "time": "Sun Aug 09 01:28:40 2020 +0000"
  },
  "message": "internal/lsp/source: improve completion in switch cases\n\nNow we downrank candidates that have already been used in other switch\ncases. For example:\n\n    switch time.Now().Weekday() {\n    case time.Monday:\n    case time.\u003c\u003e // downrank time.Monday\n    }\n\nIt wasn\u0027t quite as simple as tracking the seen types.Objects.\nConsider this example:\n\n    type foo struct {\n      i int\n    }\n\n    var a, b foo\n\n    switch 123 {\n    case a.i:\n    case \u003c\u003e\n    }\n\nAt \u003c\u003e we don\u0027t want to downrank \"b.i\" even though \"i\" is represented\nas the same types.Object for \"a.i\" and \"b.i\". To accommodate this, we\ntrack having seen [\"a\", \"i\"] together. We will downrank \"a.i\", but not\n\"b.i\".\n\nI applied only a minor 0.9 downranking when the candidate has already\nbeen used in another case clause. It is hard to know what the user is\nplanning. For instance, in the preceding example the user could intend\nto write \"a.i + 1\", so we mustn\u0027t downrank \"a.i\" too much.\n\nChange-Id: I62debc5be3d5d310deb69d11770cf5f8bd9add1d\nReviewed-on: https://go-review.googlesource.com/c/tools/+/247337\nRun-TryBot: Muir Manders \u003cmuir@mnd.rs\u003e\nTryBot-Result: Gobot Gobot \u003cgobot@golang.org\u003e\nReviewed-by: Rebecca Stambler \u003crstambler@golang.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "5010e18c8cb6620093a1a9fd8e933cc737c2a082",
      "old_mode": 33188,
      "old_path": "internal/lsp/source/completion.go",
      "new_id": "770bfafde67f1d4d06de857aff97f0cdd8347858",
      "new_mode": 33188,
      "new_path": "internal/lsp/source/completion.go"
    },
    {
      "type": "modify",
      "old_id": "9e23f6b52cde29450973dcfb032cdc3d47be369d",
      "old_mode": 33188,
      "old_path": "internal/lsp/testdata/lsp/primarymod/rank/switch_rank.go.in",
      "new_id": "b828528da80c1728786e745d7b450b0f0fee5005",
      "new_mode": 33188,
      "new_path": "internal/lsp/testdata/lsp/primarymod/rank/switch_rank.go.in"
    },
    {
      "type": "modify",
      "old_id": "493b5f0eb7e051a9d6cc49efa2c8a5ea35130656",
      "old_mode": 33188,
      "old_path": "internal/lsp/testdata/lsp/summary.txt.golden",
      "new_id": "35bed3d946c0cecf2f1d795c918983c07f47c390",
      "new_mode": 33188,
      "new_path": "internal/lsp/testdata/lsp/summary.txt.golden"
    }
  ]
}
