This PR fixes a significant auto-completion performance regression that was introduced in #5666, i.e. v4.14.0. #5666 introduced tactic docstrings, which were attempted to be collected for every single completion item. This is slow for hundreds of thousands of completion items. To fix this, this PR moves the docstring computation into the completion item resolution, which is only called when users select a specific completion item in the UI. A downside of this approach is that we currently can't test completion item resolution, so we lose a few tests that cover docstrings in completions in this PR.
142 lines
4.3 KiB
Text
142 lines
4.3 KiB
Text
{"textDocument": {"uri": "file:///completionPrv.lean"},
|
|
"position": {"line": 2, "character": 11}}
|
|
{"items":
|
|
[{"sortText": "0",
|
|
"label": "blaBlaBoo",
|
|
"kind": 21,
|
|
"data":
|
|
{"params":
|
|
{"textDocument": {"uri": "file:///completionPrv.lean"},
|
|
"position": {"line": 2, "character": 11}},
|
|
"id": {"const": {"declName": "_private.0.blaBlaBoo"}},
|
|
"cPos": 0}}],
|
|
"isIncomplete": true}
|
|
{"textDocument": {"uri": "file:///completionPrv.lean"},
|
|
"position": {"line": 9, "character": 11}}
|
|
{"items":
|
|
[{"sortText": "0",
|
|
"label": "booBoo",
|
|
"kind": 21,
|
|
"data":
|
|
{"params":
|
|
{"textDocument": {"uri": "file:///completionPrv.lean"},
|
|
"position": {"line": 9, "character": 11}},
|
|
"id": {"const": {"declName": "_private.0.Foo.booBoo"}},
|
|
"cPos": 0}},
|
|
{"sortText": "1",
|
|
"label": "instToBoolBool",
|
|
"kind": 21,
|
|
"data":
|
|
{"params":
|
|
{"textDocument": {"uri": "file:///completionPrv.lean"},
|
|
"position": {"line": 9, "character": 11}},
|
|
"id": {"const": {"declName": "instToBoolBool"}},
|
|
"cPos": 0}},
|
|
{"sortText": "2",
|
|
"label": "BitVec.getElem_ofBoolListBE",
|
|
"kind": 23,
|
|
"data":
|
|
{"params":
|
|
{"textDocument": {"uri": "file:///completionPrv.lean"},
|
|
"position": {"line": 9, "character": 11}},
|
|
"id": {"const": {"declName": "BitVec.getElem_ofBoolListBE"}},
|
|
"cPos": 0}},
|
|
{"sortText": "3",
|
|
"label": "BitVec.getLsbD_ofBoolListBE",
|
|
"kind": 23,
|
|
"data":
|
|
{"params":
|
|
{"textDocument": {"uri": "file:///completionPrv.lean"},
|
|
"position": {"line": 9, "character": 11}},
|
|
"id": {"const": {"declName": "BitVec.getLsbD_ofBoolListBE"}},
|
|
"cPos": 0}},
|
|
{"sortText": "4",
|
|
"label": "BitVec.getMsbD_ofBoolListBE",
|
|
"kind": 23,
|
|
"data":
|
|
{"params":
|
|
{"textDocument": {"uri": "file:///completionPrv.lean"},
|
|
"position": {"line": 9, "character": 11}},
|
|
"id": {"const": {"declName": "BitVec.getMsbD_ofBoolListBE"}},
|
|
"cPos": 0}},
|
|
{"sortText": "5",
|
|
"label": "BitVec.ofBool_and_ofBool",
|
|
"kind": 23,
|
|
"data":
|
|
{"params":
|
|
{"textDocument": {"uri": "file:///completionPrv.lean"},
|
|
"position": {"line": 9, "character": 11}},
|
|
"id": {"const": {"declName": "BitVec.ofBool_and_ofBool"}},
|
|
"cPos": 0}},
|
|
{"sortText": "6",
|
|
"label": "BitVec.ofBool_or_ofBool",
|
|
"kind": 23,
|
|
"data":
|
|
{"params":
|
|
{"textDocument": {"uri": "file:///completionPrv.lean"},
|
|
"position": {"line": 9, "character": 11}},
|
|
"id": {"const": {"declName": "BitVec.ofBool_or_ofBool"}},
|
|
"cPos": 0}},
|
|
{"sortText": "7",
|
|
"label": "BitVec.ofBool_xor_ofBool",
|
|
"kind": 23,
|
|
"data":
|
|
{"params":
|
|
{"textDocument": {"uri": "file:///completionPrv.lean"},
|
|
"position": {"line": 9, "character": 11}},
|
|
"id": {"const": {"declName": "BitVec.ofBool_xor_ofBool"}},
|
|
"cPos": 0}},
|
|
{"sortText": "8",
|
|
"label": "BitVec.ofBoolListBE",
|
|
"kind": 3,
|
|
"data":
|
|
{"params":
|
|
{"textDocument": {"uri": "file:///completionPrv.lean"},
|
|
"position": {"line": 9, "character": 11}},
|
|
"id": {"const": {"declName": "BitVec.ofBoolListBE"}},
|
|
"cPos": 0}}],
|
|
"isIncomplete": true}
|
|
{"textDocument": {"uri": "file:///completionPrv.lean"},
|
|
"position": {"line": 21, "character": 5}}
|
|
{"items":
|
|
[{"sortText": "0",
|
|
"label": "field1",
|
|
"kind": 5,
|
|
"data":
|
|
{"params":
|
|
{"textDocument": {"uri": "file:///completionPrv.lean"},
|
|
"position": {"line": 21, "character": 5}},
|
|
"id": {"const": {"declName": "S.field1"}},
|
|
"cPos": 1}},
|
|
{"sortText": "1",
|
|
"label": "getInc",
|
|
"kind": 3,
|
|
"data":
|
|
{"params":
|
|
{"textDocument": {"uri": "file:///completionPrv.lean"},
|
|
"position": {"line": 21, "character": 5}},
|
|
"id": {"const": {"declName": "_private.0.S.getInc"}},
|
|
"cPos": 1}}],
|
|
"isIncomplete": true}
|
|
{"textDocument": {"uri": "file:///completionPrv.lean"},
|
|
"position": {"line": 25, "character": 4}}
|
|
{"items":
|
|
[{"sortText": "0",
|
|
"label": "field1",
|
|
"kind": 5,
|
|
"data":
|
|
{"params":
|
|
{"textDocument": {"uri": "file:///completionPrv.lean"},
|
|
"position": {"line": 25, "character": 4}},
|
|
"id": {"const": {"declName": "S.field1"}},
|
|
"cPos": 1}},
|
|
{"sortText": "1",
|
|
"label": "getInc",
|
|
"kind": 3,
|
|
"data":
|
|
{"params":
|
|
{"textDocument": {"uri": "file:///completionPrv.lean"},
|
|
"position": {"line": 25, "character": 4}},
|
|
"id": {"const": {"declName": "_private.0.S.getInc"}},
|
|
"cPos": 1}}],
|
|
"isIncomplete": true}
|