Commit graph

44 commits

Author SHA1 Message Date
Joachim Breitner
f40c999f68
feat: improve termination_by error messages (#3255)
as suggested in

<https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/termination_by.20regression/near/419786430>

Also refactored the code a bit and removed the code smell around
`GuessLex`-produced termination arguments (which may not be
surface-syntactically expressible) a bit by introducing an explicit flag
for those.
2024-02-05 13:13:53 +00:00
Joachim Breitner
b5122b6a7b feat: per-function termination hints
This change

 * moves `termination_by` and `decreasing_by` next to the function they
   apply to
 * simplify the syntax of `termination_by`
 * apply the `decreasing_by` goal to all goals at once, for better
   interactive use.

See the section in `RELEASES.md` for more details and migration advise.

This is a hard breaking change, requiring developers to touch every
`termination_by` in their code base. We decided to still do it as a
hard-breaking change, because supporting both old and new syntax at the
same time would be non-trivial, and not save that much. Moreover, this
requires changes to some metaprograms that developers might have
written, and supporting both syntaxes at the same time would make
_their_ migration harder.
2024-01-10 17:27:35 +01:00
Mario Carneiro
d1a15dea03
fix: hover info for cases h : ... (#3084)
This makes hover info, go to definition, etc work for the `h` in `cases
h : e`. The implementation is similar to that used for the `generalize h
: e = x` tactic.
2023-12-21 22:39:23 +00:00
Mario Carneiro
82196efe94 feat: hovers on open and export decls 2023-11-02 17:01:51 +01:00
Mario Carneiro
e6fe3bee71 fix: hover term/tactic confusion 2023-09-26 10:16:37 +02:00
Mario Carneiro
b4cf1dd943 feat: binder info for generalize 2023-06-09 14:41:00 -07:00
Sebastian Ullrich
b6bd2dea35 feat: signature pretty printer for hovers 2022-12-21 21:59:05 +01:00
Sebastian Ullrich
39f2322f35 fix: save correct environment in info tree for example 2022-11-24 13:11:14 -08:00
Mario Carneiro
4fefb2097f feat: hover/go-to-def/refs for options 2022-11-07 20:01:13 +01:00
Sebastian Ullrich
1893857f15 fix: expandCDot? should create canonical syntax 2022-10-25 12:23:13 +02:00
Sebastian Ullrich
f39281f6b4 fix: hoverableInfoAt? in presence of canonical syntax 2022-10-25 12:23:13 +02:00
Mario Carneiro
dd5948d641 chore: snake-case attributes (part 1) 2022-10-19 09:28:08 -07:00
Gabriel Ebner
fb4d90a58b feat: dynamic quotations for categories 2022-10-18 14:59:14 -07:00
Mario Carneiro
9aa57f9959 fix: .ident hover in patterns 2022-09-30 15:18:06 -07:00
Mario Carneiro
7a6f7cb0ac fix: induction info tree nesting 2022-09-29 19:07:18 +02:00
Mario Carneiro
73f44ccb7b feat: hover for cases/induction case names 2022-09-29 19:07:18 +02:00
Mario Carneiro
d843e2a418 chore: add docs and test 2022-09-27 22:09:54 +02:00
Sebastian Ullrich
a657a638f0 feat: sub-info tree level hover 2022-08-31 17:49:43 -07:00
Mario Carneiro
9bd886f37d fix: @[inheritDoc] on notation 2022-08-27 07:11:39 -07:00
Mario Carneiro
37a12b635b feat: add declId hover for syntax/notation/mixfix 2022-08-17 05:55:06 -07:00
Mario Carneiro
e0221db2e2 feat: add @[inheritDoc] attribute 2022-08-16 18:31:55 -07:00
Mario Carneiro
b201db4bf7 feat: add hover info for quot precheck 2022-08-13 17:31:57 -07:00
Mario Carneiro
7cc8f7c4c4 feat: go to definition for antiquot kinds 2022-08-11 17:46:36 +02:00
Mario Carneiro
59b32da2d9 feat: go to def on parser aliases 2022-08-06 12:44:14 +02:00
Sebastian Ullrich
2f0b65fad3 fix: do not show inaccessible variable in hover 2022-08-04 11:28:46 -07:00
Sebastian Ullrich
a44472962d fix: replace uses of token antiquotations in tactics with with_annotate_state 2022-08-02 04:54:48 -07:00
Sebastian Ullrich
759a7d771f fix: do not show inferred type on attribute application 2022-07-31 16:36:54 +02:00
Leonardo de Moura
b581c2fa17 fix: evalTactic
Another bug reported by Patrick.
2022-07-20 19:12:53 -04:00
Sebastian Ullrich
3a56db2812 chore: fix tests 2022-06-27 22:37:02 +02:00
Leonardo de Moura
3b259afaf0 chore: fix tests 2022-06-14 16:43:22 -07:00
Sebastian Ullrich
46df02877d fix: elab info for decreasing_by 2022-05-16 10:20:49 +02:00
Mario Carneiro
c29da66c5a
fix: annotate binders in intro for hover / go to def 2022-03-22 12:10:51 +00:00
Leonardo de Moura
e9d85f49e6 chore: remove tryPureCoe?
Based on the discussion at
https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/for.2C.20unexpected.20need.20for.20type.20ascription/near/269083574
The consensus seemed to be that "auto pure" is more confusing than its worth.
2022-02-03 16:25:24 -08:00
Sebastian Ullrich
312944e784 fix: hover etc. on complex declaration name 2022-01-19 12:27:03 +01:00
Sebastian Ullrich
5f96a9fc4d fix: do not show type of sort in hover
Fixes #896
2021-12-19 11:03:15 +01:00
Sebastian Ullrich
a329896e70 feat: refine declaration ranges at instance & example 2021-11-27 07:25:15 -08:00
Sebastian Ullrich
4f15805787 feat: annotate declarations with term infos 2021-11-27 07:25:15 -08:00
larsk21
9028405798 fix: handle _root_ in unresolveNameGlobal with pp.fullNames 2021-11-21 15:23:21 +01:00
Sebastian Ullrich
20accf5105 feat: revise macro parameter syntax 2021-08-12 07:48:42 -07:00
Sebastian Ullrich
4a4b4c1ef4 fix: mkAtomFrom: generate synthetic position like other *From functions
Also consistently use binders as reference position for an elided binder type.
Before, type errors were always given extent 1, the length of the
synthetic `_` token.
2021-07-19 13:24:59 -07:00
Sebastian Ullrich
cef3ade164 fix: info on non-atomic simp args 2021-06-23 00:08:07 -07:00
Sebastian Ullrich
736d32c026 fix: hover on synthetic sorry 2021-06-21 10:17:26 -07:00
Sebastian Ullrich
9170d1ff99 test: some syntax docstring tests 2021-06-21 10:17:26 -07:00
Sebastian Ullrich
6303c134a9 feat: add term info at resolveId? 2021-05-05 18:54:47 +02:00