lean4-htt/tests/lean/interactive
David Thrane Christiansen eb58f46ce7
feat: language reference links and examples in docstrings (#7240)
This PR adds a canonical syntax for linking to sections in the language
reference along with formatting of examples in docstrings according to
the docstring style guide.


Docstrings are now pre-processed as follows:

* Output included as part of examples is shown with leading line comment
indicators in hovers

* URLs of the form `lean-manual://section/section-id` are rewritten to
links that point at the corresponding section in the Lean reference
manual. The reference manual's base URL is configured when Lean is built
and can be overridden with the `LEAN_MANUAL_ROOT` environment variable.
This way, releases can point documentation links to the correct
snapshot, and users can use their own, e.g. for offline reading.

Manual URLs in docstrings are validated when the docstring is added. The
presence of a URL starting with `lean-manual://` that is not a
syntactically valid section link causes the docstring to be rejected.
This allows for future extensibility to the set of allowed links. There
is no validation that the linked-to section actually exists. To provide
the best possible error messages in case of validation failures,
`Lean.addDocString` now takes a `TSyntax ``docComment` instead of a
string; clients should adapt by removing the step that extracts the
string, or by calling the lower-level `addDocStringCore` in cases where
the docstring in question is obtained from the environment and has thus
already had its links validated.

A stage0 update is required to make the documentation site configurable
at build time and for releases. A local commit on top of a stage0 update
that will be sent in a followup PR includes the configurable reference
manual root and updates to the release checklist.

---------

Co-authored-by: Marc Huisinga <mhuisi@protonmail.com>
2025-03-12 09:17:27 +00:00
..
533.lean test: make completion tests less dependent on core 2023-07-28 07:50:09 -07:00
533.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
863.lean test: make completion tests less dependent on core 2023-07-28 07:50:09 -07:00
863.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
1031.lean
1031.lean.expected.out
1265.lean
1265.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
1403.lean
1403.lean.expected.out feat: update omega/solve_by_elim to use new tactic syntax, use new tactic syntax (#5932) 2024-11-03 16:23:37 +00:00
1525.lean fix: missing info tree on elab failure 2023-01-26 13:05:57 +01:00
1525.lean.expected.out fix: missing info tree on elab failure 2023-01-26 13:05:57 +01:00
1659.lean feat: auto-complete declaration names in arbitrary namespaces 2023-07-28 07:50:09 -07:00
1659.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
2058.lean feat: localize universe metavariable errors at let bindings and fun binders (#5402) 2024-09-24 05:30:42 +00:00
2058.lean.expected.out feat: localize universe metavariable errors at let bindings and fun binders (#5402) 2024-09-24 05:30:42 +00:00
2881.lean fix: some goal state issues (#5677) 2024-10-17 12:09:54 +00:00
2881.lean.expected.out fix: some goal state issues (#5677) 2024-10-17 12:09:54 +00:00
4078.lean fix: hovers on binders with metavariables (#4192) 2024-05-21 10:34:58 +00:00
4078.lean.expected.out fix: hovers on binders with metavariables (#4192) 2024-05-21 10:34:58 +00:00
4880.lean fix: ensure autoparam errors have correct positions (#4926) 2024-08-06 22:27:51 +00:00
4880.lean.expected.out feat: 'unsolved goals' & 'goals accomplished' diagnostics (#7366) 2025-03-07 13:50:56 +00:00
5659.lean fix: proper "excess binders" error locations for rintro and intro (#6565) 2025-01-08 08:36:45 +00:00
5659.lean.expected.out fix: proper "excess binders" error locations for rintro and intro (#6565) 2025-01-08 08:36:45 +00:00
6594.lean fix: incremental goal state requests select incomplete snapshot (#6887) 2025-02-14 11:53:24 +00:00
6594.lean.expected.out fix: incremental goal state requests select incomplete snapshot (#6887) 2025-02-14 11:53:24 +00:00
amb.lean
amb.lean.expected.out feat: per-package server options (#2858) 2023-11-26 13:42:38 +00:00
anonHyp.lean
anonHyp.lean.expected.out feat: custom eliminators for induction and cases tactics, and beautiful eliminators for Nat (#3629) 2024-03-09 15:31:51 +00:00
autoBoundIssue.lean feat: upstream definition of Vector from Batteries (#6197) 2024-11-24 23:01:32 +00:00
autoBoundIssue.lean.expected.out feat: upstream definition of Vector from Batteries (#6197) 2024-11-24 23:01:32 +00:00
builtinCodeactions.lean fix: line break in simp? output (#6048) 2024-11-13 15:49:11 +00:00
builtinCodeactions.lean.expected.out fix: line break in simp? output (#6048) 2024-11-13 15:49:11 +00:00
cancellation.lean fix: cancel computations within command elaboration as soon as reuse is ruled out (#7241) 2025-03-03 10:37:10 +00:00
cancellation.lean.expected.out fix: cancel computations within command elaboration as soon as reuse is ruled out (#7241) 2025-03-03 10:37:10 +00:00
catHover.lean chore: fix spelling mistakes in tests (#5439) 2024-09-24 03:22:53 +00:00
catHover.lean.expected.out chore: fix spelling mistakes in tests (#5439) 2024-09-24 03:22:53 +00:00
codeaction.lean fix: version numbers in code actions (#2721) 2023-10-24 22:55:47 +11:00
codeaction.lean.expected.out feat: per-package server options (#2858) 2023-11-26 13:42:38 +00:00
compHeader.lean
compHeader.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
completion.lean
completion.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
completion2.lean
completion2.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
completion3.lean
completion3.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
completion4.lean
completion4.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
completion5.lean
completion5.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
completion6.lean
completion6.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
completion7.lean test: make completion tests less dependent on core 2023-07-28 07:50:09 -07:00
completion7.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
completionAtPrint.lean feat: Environment.addConstAsync (#6691) 2025-01-19 02:00:16 +00:00
completionAtPrint.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
completionBracketedDot.lean fix: travelling auto-completion (#5257) 2024-09-10 07:26:44 +00:00
completionBracketedDot.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
completionCheck.lean fix: auto-completion bugs and performance (#3460) 2024-02-26 09:43:19 +00:00
completionCheck.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
completionDanglingDot.lean fix: don't issue atomic id completions when there is a dangling dot (#5837) 2024-11-19 12:23:41 +00:00
completionDanglingDot.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
completionDeprecation.lean feat: denote deprecations in completion items (#5707) 2024-10-14 13:05:16 +00:00
completionDeprecation.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
completionEOF.lean
completionEOF.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
completionFallback.lean feat: completion fallback (#5299) 2024-09-12 16:09:20 +00:00
completionFallback.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
completionFromExpectedType.lean fix: auto-completion bugs and performance (#3460) 2024-02-26 09:43:19 +00:00
completionFromExpectedType.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
completionIStr.lean
completionIStr.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
completionOpenNamespaces.lean fix: auto-completion bugs and performance (#3460) 2024-02-26 09:43:19 +00:00
completionOpenNamespaces.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
completionOption.lean
completionOption.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
completionPrefixIssue.lean
completionPrefixIssue.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
completionPrivateTypes.lean fix: auto-completion bugs and performance (#3460) 2024-02-26 09:43:19 +00:00
completionPrivateTypes.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
completionPrv.lean feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
completionPrv.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
completionStructureInstance.lean fix: use sensible notion of indentation in structure instance field completion (#6279) 2024-12-02 09:37:12 +00:00
completionStructureInstance.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
completionTactics.lean fix: use sensible notion of indentation in structure instance field completion (#6279) 2024-12-02 09:37:12 +00:00
completionTactics.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
compNamespace.lean
compNamespace.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
definition.lean
definition.lean.expected.out feat: per-package server options (#2858) 2023-11-26 13:42:38 +00:00
Diff.lean
Diff.lean.expected.out
discrsIssue.lean
discrsIssue.lean.expected.out feat: per-package server options (#2858) 2023-11-26 13:42:38 +00:00
docstringLinksExamples.lean feat: language reference links and examples in docstrings (#7240) 2025-03-12 09:17:27 +00:00
docstringLinksExamples.lean.expected.out feat: language reference links and examples in docstrings (#7240) 2025-03-12 09:17:27 +00:00
dotIdCompletion.lean
dotIdCompletion.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
editAfterError.lean feat: incremental elaboration of definition headers, bodies, and tactics (#3940) 2024-05-22 13:23:30 +00:00
editAfterError.lean.expected.out feat: incremental elaboration of definition headers, bodies, and tactics (#3940) 2024-05-22 13:23:30 +00:00
editCompletion.lean feat: incremental elaboration of definition headers, bodies, and tactics (#3940) 2024-05-22 13:23:30 +00:00
editCompletion.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
expectedTypeAsGoal.lean
expectedTypeAsGoal.lean.expected.out feat: per-package server options (#2858) 2023-11-26 13:42:38 +00:00
explicitAppInstHole.lean fix: refine how named arguments suppress explicit arguments (#5283) 2024-09-27 20:14:29 +00:00
explicitAppInstHole.lean.expected.out feat: add option pp.mvars.delayed (#5643) 2024-10-08 17:48:52 +00:00
foldingRange.lean
foldingRange.lean.expected.out feat: per-package server options (#2858) 2023-11-26 13:42:38 +00:00
ghostGoals.lean fix: ghost goals in autoparam tactic block (#6408) 2024-12-17 20:57:39 +00:00
ghostGoals.lean.expected.out fix: ghost goals in autoparam tactic block (#6408) 2024-12-17 20:57:39 +00:00
goalEOF.lean
goalEOF.lean.expected.out feat: per-package server options (#2858) 2023-11-26 13:42:38 +00:00
goalIssue.lean
goalIssue.lean.expected.out feat: custom eliminators for induction and cases tactics, and beautiful eliminators for Nat (#3629) 2024-03-09 15:31:51 +00:00
goTo.lean feat: make go-to-definition on a typeclass projection application go to the instance(s) (#1767) 2023-01-19 09:10:01 +00:00
goTo.lean.expected.out fix: include references in attributes in call hierarchy (#5650) 2024-10-18 15:38:32 +00:00
goTo2.lean feat: make go-to-definition on a typeclass projection application go to the instance(s) (#1767) 2023-01-19 09:10:01 +00:00
goTo2.lean.expected.out feat: per-package server options (#2858) 2023-11-26 13:42:38 +00:00
haveInfo.lean feat: incremental have (#4308) 2024-06-04 09:12:27 +00:00
haveInfo.lean.expected.out feat: 'unsolved goals' & 'goals accomplished' diagnostics (#7366) 2025-03-07 13:50:56 +00:00
highlight.lean fix: do not cancel async elaboration tasks (#7175) 2025-02-21 17:24:36 +00:00
highlight.lean.expected.out fix: avoid new term info around def bodies (#6031) 2024-11-11 14:54:59 +00:00
hover.lean feat: hover / go-to-def for attribute cmd (#3896) 2024-04-13 07:13:25 +00:00
hover.lean.expected.out doc: add recommended spellings for many term notations (#6886) 2025-02-03 13:46:39 +00:00
hoverAt.lean
hoverAt.lean.expected.out feat: per-package server options (#2858) 2023-11-26 13:42:38 +00:00
hoverBinderUndescore.lean
hoverBinderUndescore.lean.expected.out feat: add option pp.mvars.delayed (#5643) 2024-10-08 17:48:52 +00:00
hoverDot.lean
hoverDot.lean.expected.out feat: add missing theorems for + 1 and - 1 normal form (#4242) 2024-06-17 05:35:32 +00:00
hoverException.lean
hoverException.lean.expected.out feat: @[builtin_doc] attribute (part 2) (#3918) 2024-09-13 08:05:10 +00:00
hoverTacticExt.lean feat: more infrastructure for tactic documentation (#4490) 2024-06-21 12:49:30 +00:00
hoverTacticExt.lean.expected.out feat: more infrastructure for tactic documentation (#4490) 2024-06-21 12:49:30 +00:00
incrementalCombinator.lean fix: disable incrementality in case .. | .. (#5090) 2024-08-19 09:17:03 +00:00
incrementalCombinator.lean.expected.out feat: 'unsolved goals' & 'goals accomplished' diagnostics (#7366) 2025-03-07 13:50:56 +00:00
incrementalCommand.lean fix: do not cancel async elaboration tasks (#7175) 2025-02-21 17:24:36 +00:00
incrementalCommand.lean.expected.out fix: reparsing may need to backtrack two commands (#6236) 2024-11-27 13:06:57 +00:00
incrementalInduction.lean feat: incremental elaboration of definition headers, bodies, and tactics (#3940) 2024-05-22 13:23:30 +00:00
incrementalInduction.lean.expected.out feat: incremental elaboration of definition headers, bodies, and tactics (#3940) 2024-05-22 13:23:30 +00:00
incrementalMutual.lean fix: calculate error suppression per snapshot (#4657) 2024-07-08 09:54:43 +00:00
incrementalMutual.lean.expected.out fix: calculate error suppression per snapshot (#4657) 2024-07-08 09:54:43 +00:00
incrementalTactic.lean fix: calculate error suppression per snapshot (#4657) 2024-07-08 09:54:43 +00:00
incrementalTactic.lean.expected.out feat: 'unsolved goals' & 'goals accomplished' diagnostics (#7366) 2025-03-07 13:50:56 +00:00
infoIssues.lean
infoIssues.lean.expected.out feat: custom eliminators for induction and cases tactics, and beautiful eliminators for Nat (#3629) 2024-03-09 15:31:51 +00:00
internalNamesIssue.lean
internalNamesIssue.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
inWordCompletion.lean feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
inWordCompletion.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
issue4527.lean fix: cdot parser error message range (#4528) 2024-06-21 15:06:07 +00:00
issue4527.lean.expected.out feat: 'unsolved goals' & 'goals accomplished' diagnostics (#7366) 2025-03-07 13:50:56 +00:00
issue5021.lean fix: hover text over _ in ?_ (#5118) 2024-08-21 20:47:19 +00:00
issue5021.lean.expected.out feat: add option pp.mvars.delayed (#5643) 2024-10-08 17:48:52 +00:00
issue5597.lean fix: declareSimpLikeTactic macro to use mkSynthetic (#5838) 2024-10-30 14:27:56 +00:00
issue5597.lean.expected.out fix: declareSimpLikeTactic macro to use mkSynthetic (#5838) 2024-10-30 14:27:56 +00:00
jumpMutual.lean
jumpMutual.lean.expected.out feat: per-package server options (#2858) 2023-11-26 13:42:38 +00:00
keywordCompletion.lean test: make completion tests less dependent on core 2023-07-28 07:50:09 -07:00
keywordCompletion.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
lean3HoverIssue.lean
lean3HoverIssue.lean.expected.out feat: per-package server options (#2858) 2023-11-26 13:42:38 +00:00
macroGoalIssue.lean
macroGoalIssue.lean.expected.out feat: per-package server options (#2858) 2023-11-26 13:42:38 +00:00
match.lean
match.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
matchPatternHover.lean
matchPatternHover.lean.expected.out feat: per-package server options (#2858) 2023-11-26 13:42:38 +00:00
matchStxCompletion.lean
matchStxCompletion.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
partialNamespace.lean
partialNamespace.lean.expected.out feat: per-package server options (#2858) 2023-11-26 13:42:38 +00:00
plainGoal.lean fix: report goals in induction with parse error 2023-11-20 09:15:27 +01:00
plainGoal.lean.expected.out fix: discrepancy theorem vs example (#4493) 2024-06-24 01:18:41 +00:00
plainTermGoal.lean
plainTermGoal.lean.expected.out feat: per-package server options (#2858) 2023-11-26 13:42:38 +00:00
rename.lean feat: rename request handler (#2462) 2023-11-21 13:10:52 +01:00
rename.lean.expected.out feat: per-package server options (#2858) 2023-11-26 13:42:38 +00:00
run.lean test: avoid re-elaboration of interactive runner (#7177) 2025-02-22 10:36:25 +00:00
stdOutput.lean
stdOutput.lean.expected.out
structNameParentProj.lean feat: make structure parent projections nameable (#7100) 2025-02-18 07:38:13 +00:00
structNameParentProj.lean.expected.out feat: make structure parent projections nameable (#7100) 2025-02-18 07:38:13 +00:00
terminationBySuggestion.lean feat: termination_by structural (#4542) 2024-07-01 16:51:30 +00:00
terminationBySuggestion.lean.expected.out feat: termination_by structural (#4542) 2024-07-01 16:51:30 +00:00
test_single.sh
travellingCompletions.lean feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
travellingCompletions.lean.expected.out feat: faster auto-completion (#7134) 2025-02-19 10:05:18 +00:00
unterminatedDocComment.lean feat: incremental elaboration of definition headers, bodies, and tactics (#3940) 2024-05-22 13:23:30 +00:00
unterminatedDocComment.lean.expected.out feat: incremental elaboration of definition headers, bodies, and tactics (#3940) 2024-05-22 13:23:30 +00:00
userWidget.lean feat: bundle of widget improvements (#2964) 2023-12-21 06:24:33 +00:00
userWidget.lean.expected.out feat: bundle of widget improvements (#2964) 2023-12-21 06:24:33 +00:00