This PR significantly improves the test coverage of the language server, providing at least a single basic test for every request that is used by the client. It also implements infrastructure for testing all of these requests, e.g. the ability to run interactive tests in a project context and refactors the interactive test runner to be more maintainable. Finally, it also fixes a small bug with the recently implemented unknown identifier code actions for auto-implicits (#10442) that was discovered in testing, where the "import all unambiguous unknown identifiers" code action didn't work correctly on auto-implicit identifiers.
266 lines
9.4 KiB
Text
266 lines
9.4 KiB
Text
{"textDocument": {"uri": "file:///interactiveTermGoals.lean"},
|
|
"position": {"line": 2, "character": 14}}
|
|
{"type":
|
|
{"tag":
|
|
[{"subexprPos": "/", "info": {"p": "0"}},
|
|
{"append":
|
|
[{"tag": [{"subexprPos": "/0/1", "info": {"p": "1"}}, {"text": "0"}]},
|
|
{"text": " < "},
|
|
{"tag": [{"subexprPos": "/1", "info": {"p": "2"}}, {"text": "2"}]}]}]},
|
|
"term": {"p": "4"},
|
|
"range":
|
|
{"start": {"line": 2, "character": 2}, "end": {"line": 2, "character": 51}},
|
|
"hyps": [],
|
|
"ctx": {"p": "3"}}
|
|
{"textDocument": {"uri": "file:///interactiveTermGoals.lean"},
|
|
"position": {"line": 2, "character": 15}}
|
|
{"type":
|
|
{"tag":
|
|
[{"subexprPos": "/", "info": {"p": "5"}},
|
|
{"append":
|
|
[{"tag": [{"subexprPos": "/0/1", "info": {"p": "6"}}, {"text": "0"}]},
|
|
{"text": " < "},
|
|
{"tag": [{"subexprPos": "/1", "info": {"p": "7"}}, {"text": "1"}]}]}]},
|
|
"term": {"p": "9"},
|
|
"range":
|
|
{"start": {"line": 2, "character": 15}, "end": {"line": 2, "character": 30}},
|
|
"hyps": [],
|
|
"ctx": {"p": "8"}}
|
|
{"textDocument": {"uri": "file:///interactiveTermGoals.lean"},
|
|
"position": {"line": 2, "character": 16}}
|
|
{"type":
|
|
{"tag":
|
|
[{"subexprPos": "/", "info": {"p": "10"}},
|
|
{"append":
|
|
[{"tag": [{"subexprPos": "/0/1", "info": {"p": "11"}}, {"text": "0"}]},
|
|
{"text": " < "},
|
|
{"tag": [{"subexprPos": "/1", "info": {"p": "12"}}, {"text": "1"}]}]}]},
|
|
"term": {"p": "14"},
|
|
"range":
|
|
{"start": {"line": 2, "character": 15}, "end": {"line": 2, "character": 30}},
|
|
"hyps": [],
|
|
"ctx": {"p": "13"}}
|
|
{"textDocument": {"uri": "file:///interactiveTermGoals.lean"},
|
|
"position": {"line": 2, "character": 31}}
|
|
{"type":
|
|
{"tag":
|
|
[{"subexprPos": "/", "info": {"p": "15"}},
|
|
{"append":
|
|
[{"tag": [{"subexprPos": "/0/1", "info": {"p": "16"}}, {"text": "1"}]},
|
|
{"text": " < "},
|
|
{"tag": [{"subexprPos": "/1", "info": {"p": "17"}}, {"text": "2"}]}]}]},
|
|
"term": {"p": "19"},
|
|
"range":
|
|
{"start": {"line": 2, "character": 31}, "end": {"line": 2, "character": 51}},
|
|
"hyps": [],
|
|
"ctx": {"p": "18"}}
|
|
{"textDocument": {"uri": "file:///interactiveTermGoals.lean"},
|
|
"position": {"line": 2, "character": 48}}
|
|
{"type":
|
|
{"tag":
|
|
[{"subexprPos": "/", "info": {"p": "20"}},
|
|
{"append":
|
|
[{"tag": [{"subexprPos": "/0/1", "info": {"p": "21"}}, {"text": "1"}]},
|
|
{"text": " < "},
|
|
{"tag": [{"subexprPos": "/1", "info": {"p": "22"}}, {"text": "2"}]}]}]},
|
|
"term": {"p": "24"},
|
|
"range":
|
|
{"start": {"line": 2, "character": 32}, "end": {"line": 2, "character": 50}},
|
|
"hyps": [],
|
|
"ctx": {"p": "23"}}
|
|
{"textDocument": {"uri": "file:///interactiveTermGoals.lean"},
|
|
"position": {"line": 11, "character": 10}}
|
|
{"type":
|
|
{"tag":
|
|
[{"subexprPos": "/", "info": {"p": "26"}},
|
|
{"append":
|
|
[{"text": "Option "},
|
|
{"tag": [{"subexprPos": "/1", "info": {"p": "27"}}, {"text": "Unit"}]}]}]},
|
|
"term": {"p": "29"},
|
|
"range":
|
|
{"start": {"line": 11, "character": 2}, "end": {"line": 11, "character": 19}},
|
|
"hyps":
|
|
[{"type": {"tag": [{"subexprPos": "/", "info": {"p": "25"}}, {"text": "Int"}]},
|
|
"names": ["y"],
|
|
"fvarIds": []}],
|
|
"ctx": {"p": "28"}}
|
|
{"textDocument": {"uri": "file:///interactiveTermGoals.lean"},
|
|
"position": {"line": 16, "character": 17}}
|
|
{"type":
|
|
{"tag":
|
|
[{"subexprPos": "/", "info": {"p": "31"}},
|
|
{"append":
|
|
[{"tag":
|
|
[{"subexprPos": "/0/1", "info": {"p": "32"}},
|
|
{"append":
|
|
[{"tag":
|
|
[{"subexprPos": "/0/1/0/0", "info": {"p": "33"}}, {"text": "?m"}]},
|
|
{"text": " "},
|
|
{"tag":
|
|
[{"subexprPos": "/0/1/0/1", "info": {"p": "34"}}, {"text": "m"}]},
|
|
{"text": " "},
|
|
{"tag":
|
|
[{"subexprPos": "/0/1/1", "info": {"p": "35"}}, {"text": "n"}]}]}]},
|
|
{"text": " < "},
|
|
{"tag": [{"subexprPos": "/1", "info": {"p": "36"}}, {"text": "n"}]}]}]},
|
|
"term": {"p": "38"},
|
|
"range":
|
|
{"start": {"line": 16, "character": 17}, "end": {"line": 16, "character": 18}},
|
|
"hyps":
|
|
[{"type": {"tag": [{"subexprPos": "/", "info": {"p": "30"}}, {"text": "Nat"}]},
|
|
"names": ["m", "n"],
|
|
"fvarIds": []}],
|
|
"ctx": {"p": "37"}}
|
|
{"textDocument": {"uri": "file:///interactiveTermGoals.lean"},
|
|
"position": {"line": 16, "character": 18}}
|
|
{"type":
|
|
{"tag":
|
|
[{"subexprPos": "/", "info": {"p": "40"}},
|
|
{"append":
|
|
[{"tag":
|
|
[{"subexprPos": "/0/1", "info": {"p": "41"}},
|
|
{"append":
|
|
[{"tag":
|
|
[{"subexprPos": "/0/1/0/0", "info": {"p": "42"}}, {"text": "?m"}]},
|
|
{"text": " "},
|
|
{"tag":
|
|
[{"subexprPos": "/0/1/0/1", "info": {"p": "43"}}, {"text": "m"}]},
|
|
{"text": " "},
|
|
{"tag":
|
|
[{"subexprPos": "/0/1/1", "info": {"p": "44"}}, {"text": "n"}]}]}]},
|
|
{"text": " < "},
|
|
{"tag": [{"subexprPos": "/1", "info": {"p": "45"}}, {"text": "n"}]}]}]},
|
|
"term": {"p": "47"},
|
|
"range":
|
|
{"start": {"line": 16, "character": 17}, "end": {"line": 16, "character": 18}},
|
|
"hyps":
|
|
[{"type": {"tag": [{"subexprPos": "/", "info": {"p": "39"}}, {"text": "Nat"}]},
|
|
"names": ["m", "n"],
|
|
"fvarIds": []}],
|
|
"ctx": {"p": "46"}}
|
|
{"textDocument": {"uri": "file:///interactiveTermGoals.lean"},
|
|
"position": {"line": 20, "character": 18}}
|
|
{"type": {"tag": [{"subexprPos": "/", "info": {"p": "48"}}, {"text": "True"}]},
|
|
"term": {"p": "50"},
|
|
"range":
|
|
{"start": {"line": 20, "character": 18}, "end": {"line": 20, "character": 23}},
|
|
"hyps": [],
|
|
"ctx": {"p": "49"}}
|
|
{"textDocument": {"uri": "file:///interactiveTermGoals.lean"},
|
|
"position": {"line": 24, "character": 2}}
|
|
{"type":
|
|
{"tag":
|
|
[{"subexprPos": "/", "info": {"p": "51"}},
|
|
{"append":
|
|
[{"text": "∀ ("},
|
|
{"tag": [{"subexprPos": "/", "info": {"p": "52"}}, {"text": "n"}]},
|
|
{"text": " : "},
|
|
{"tag": [{"subexprPos": "/0", "info": {"p": "53"}}, {"text": "Nat"}]},
|
|
{"text": "), "},
|
|
{"tag":
|
|
[{"subexprPos": "/1", "info": {"p": "54"}},
|
|
{"append":
|
|
[{"tag":
|
|
[{"subexprPos": "/1/0/1", "info": {"p": "55"}}, {"text": "n"}]},
|
|
{"text": " < "},
|
|
{"tag":
|
|
[{"subexprPos": "/1/1", "info": {"p": "56"}},
|
|
{"append":
|
|
[{"tag":
|
|
[{"subexprPos": "/1/1/0/1", "info": {"p": "57"}}, {"text": "n"}]},
|
|
{"text": " + "},
|
|
{"tag":
|
|
[{"subexprPos": "/1/1/1", "info": {"p": "58"}},
|
|
{"text": "42"}]}]}]}]}]}]}]},
|
|
"term": {"p": "60"},
|
|
"range":
|
|
{"start": {"line": 24, "character": 2}, "end": {"line": 24, "character": 74}},
|
|
"hyps": [],
|
|
"ctx": {"p": "59"}}
|
|
{"textDocument": {"uri": "file:///interactiveTermGoals.lean"},
|
|
"position": {"line": 24, "character": 6}}
|
|
{"type": {"tag": [{"subexprPos": "/", "info": {"p": "61"}}, {"text": "Nat"}]},
|
|
"term": {"p": "63"},
|
|
"range":
|
|
{"start": {"line": 24, "character": 6}, "end": {"line": 24, "character": 7}},
|
|
"hyps": [],
|
|
"ctx": {"p": "62"}}
|
|
{"textDocument": {"uri": "file:///interactiveTermGoals.lean"},
|
|
"position": {"line": 30, "character": 6}}
|
|
{"type":
|
|
{"tag":
|
|
[{"subexprPos": "/", "info": {"p": "65"}},
|
|
{"append":
|
|
[{"text": "∀ ("},
|
|
{"tag": [{"subexprPos": "/", "info": {"p": "66"}}, {"text": "n "}]},
|
|
{"tag": [{"subexprPos": "/", "info": {"p": "67"}}, {"text": "m"}]},
|
|
{"text": " : "},
|
|
{"tag": [{"subexprPos": "/1/0", "info": {"p": "68"}}, {"text": "Nat"}]},
|
|
{"text": "), "},
|
|
{"tag":
|
|
[{"subexprPos": "/1/1", "info": {"p": "69"}},
|
|
{"append":
|
|
[{"tag":
|
|
[{"subexprPos": "/1/1/0/1", "info": {"p": "70"}},
|
|
{"append":
|
|
[{"tag":
|
|
[{"subexprPos": "/1/1/0/1/0/1", "info": {"p": "71"}},
|
|
{"text": "n"}]},
|
|
{"text": " + "},
|
|
{"tag":
|
|
[{"subexprPos": "/1/1/0/1/1", "info": {"p": "72"}},
|
|
{"text": "m"}]}]}]},
|
|
{"text": " = "},
|
|
{"tag":
|
|
[{"subexprPos": "/1/1/1", "info": {"p": "73"}},
|
|
{"append":
|
|
[{"tag":
|
|
[{"subexprPos": "/1/1/1/0/1", "info": {"p": "74"}},
|
|
{"text": "m"}]},
|
|
{"text": " + "},
|
|
{"tag":
|
|
[{"subexprPos": "/1/1/1/1", "info": {"p": "75"}},
|
|
{"text": "n"}]}]}]}]}]}]}]},
|
|
"term": {"p": "77"},
|
|
"range":
|
|
{"start": {"line": 30, "character": 6}, "end": {"line": 30, "character": 18}},
|
|
"hyps":
|
|
[{"type": {"tag": [{"subexprPos": "/", "info": {"p": "64"}}, {"text": "Nat"}]},
|
|
"names": ["n"],
|
|
"fvarIds": []}],
|
|
"ctx": {"p": "76"}}
|
|
{"textDocument": {"uri": "file:///interactiveTermGoals.lean"},
|
|
"position": {"line": 32, "character": 8}}
|
|
{"type":
|
|
{"tag":
|
|
[{"subexprPos": "/", "info": {"p": "79"}},
|
|
{"append":
|
|
[{"tag": [{"subexprPos": "/0/1", "info": {"p": "80"}}, {"text": "n"}]},
|
|
{"text": " < "},
|
|
{"tag":
|
|
[{"subexprPos": "/1", "info": {"p": "81"}},
|
|
{"append":
|
|
[{"tag":
|
|
[{"subexprPos": "/1/0/1", "info": {"p": "82"}}, {"text": "n"}]},
|
|
{"text": " + "},
|
|
{"tag":
|
|
[{"subexprPos": "/1/1", "info": {"p": "83"}}, {"text": "1"}]}]}]}]}]},
|
|
"term": {"p": "85"},
|
|
"range":
|
|
{"start": {"line": 32, "character": 8}, "end": {"line": 32, "character": 26}},
|
|
"hyps":
|
|
[{"type": {"tag": [{"subexprPos": "/", "info": {"p": "78"}}, {"text": "Nat"}]},
|
|
"names": ["n"],
|
|
"fvarIds": []}],
|
|
"ctx": {"p": "84"}}
|
|
{"textDocument": {"uri": "file:///interactiveTermGoals.lean"},
|
|
"position": {"line": 35, "character": 14}}
|
|
{"type": {"tag": [{"subexprPos": "/", "info": {"p": "87"}}, {"text": "Nat"}]},
|
|
"term": {"p": "89"},
|
|
"range":
|
|
{"start": {"line": 35, "character": 14}, "end": {"line": 35, "character": 15}},
|
|
"hyps":
|
|
[{"type": {"tag": [{"subexprPos": "/", "info": {"p": "86"}}, {"text": "Nat"}]},
|
|
"names": ["n"],
|
|
"fvarIds": []}],
|
|
"ctx": {"p": "88"}}
|