Commit graph

92 commits

Author SHA1 Message Date
Joachim Breitner
f65e3ae985
feat: simp to still work even if one simp arg does not work (#4177)
this fixes a usability paper cut that just annoyed me. When editing a
larger simp proof, I usually want to see the goal state after the simp,
and this is what I see while the `simp` command is complete. But then,
when I start typing, and necessarily type incomplete lemma names, that
error makes `simp` do nothing again and I see the original goal state.
In fact, if a prefix of the simp theorem name I am typing is a valid
identifier, it jumps even more around.

With this PR, using `logException`, I still get the red squiggly lines
for the unknown identifer, but `simp` just ignores that argument and
still shows me the final goal. Much nicer.

I also demoted the message for `[-foo]` when `foo` isn’t `simp` to a
warning and gave it the correct `ref`.

See it in action here: (in the middle, when you suddenly see the
terminal,
I am switching lean versions.)


https://github.com/leanprover/lean4/assets/148037/8cb3c563-1354-4c2d-bcee-26dfa1005ae0
2024-06-03 14:21:31 +00:00
Sebastian Ullrich
f97a7d4234
feat: incremental elaboration of definition headers, bodies, and tactics (#3940)
Extends Lean's incremental reporting and reuse between commands into
various steps inside declarations:
* headers and bodies of each (mutual) definition/theorem
* `theorem ... := by` for each contained tactic step, including
recursively inside supported combinators currently consisting of
  * `·` (cdot), `case`, `next`
  * `induction`, `cases`
  * macros such as `next` unfolding to the above

![Recording 2024-05-10 at 11 07
32](https://github.com/leanprover/lean4/assets/109126/c9d67b6f-c131-4bc3-a0de-7d63eaf1bfc9)

*Incremental reuse* means not recomputing any such steps if they are not
affected by a document change. *Incremental reporting* includes the
parts seen in the recording above: the progress bar and messages. Other
language server features such as hover etc. are *not yet* supported
incrementally, i.e. they are shown only when the declaration has been
fully processed as before.

---------

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
2024-05-22 13:23:30 +00:00
Mario Carneiro
3c36020d13
feat: @[builtin_doc] attribute (part 1) (#3953)
First part of #3918.
2024-04-19 12:21:10 +00:00
Leonardo de Moura
9f305fb31f
fix: rename_i in macro (#3581)
closes #3553

Co-authored-by: Sebastian Ullrich <sebasti@nullri.ch>
2024-03-03 19:05:37 +00:00
Henrik Böving
23e49eb519 perf: add prelude to all Lean modules 2024-02-18 14:55:17 -08:00
Eric Wieser
6f2eb3f6b4 doc: fix typo 2023-11-15 12:19:42 +11:00
Mario Carneiro
118d1027d2 feat: go to definition for KeyedDeclsAttributes 2022-11-16 11:16:24 +01:00
Mario Carneiro
583e023314 chore: snake-case attributes (part 2) 2022-10-19 09:28:08 -07:00
Mario Carneiro
dd5948d641 chore: snake-case attributes (part 1) 2022-10-19 09:28:08 -07:00
Leonardo de Moura
518123b191 feat: more conservative SpecParamInfo inference 2022-10-13 08:20:55 -07:00
Leonardo de Moura
870de844dc chore: annotate relevant monadic code with [alwaysInline]
TODO: after we delete old code generator, we should replace
`@[alwaysInline, inline]` with `@[alwaysInline]`.

Remainder: we want the old code generator to ignore `@[alwaysInline]`
annotations, in particular, the new ones on `instance` commands that
are actually annotations for the instance methods.
2022-10-12 19:48:02 -07:00
Mario Carneiro
391aef5cd7 feat: automatic extension names 2022-10-06 17:19:30 -07:00
Mario Carneiro
6392c5b456 chore: import reductions 2022-09-15 14:02:38 -07:00
Sebastian Ullrich
fb408c024b fix: deleting built-in docstrings 2022-08-27 17:19:25 +02:00
Gabriel Ebner
f89f6cb56c chore: improve elab traces 2022-08-15 08:55:25 -07:00
Gabriel Ebner
ef223c02b8 feat: make trace class inheritance opt-in 2022-08-15 08:55:25 -07:00
Gabriel Ebner
96034d15b6 chore: remove obsolete trace functions 2022-08-15 08:55:25 -07:00
Mario Carneiro
311d376bde doc: typos and indentation 2022-08-12 08:14:20 -07:00
Sebastian Ullrich
1ea2f51552 fix: handle warningAsError at logAt 2022-08-06 09:25:09 -07:00
Leonardo de Moura
635752dd2c feat: add info node from attributes to their parsers
see #1374
2022-07-27 06:12:43 -07:00
Leonardo de Moura
c042e7ba58 feat: add support for "jump-to-definition" at [tactic ...], [commandElab ...] and [termElab ...] attributes
see #1350
2022-07-25 12:21:51 -07:00
Mario Carneiro
f6211b1a74
chore: convert doc/mod comments from /- to /--//-! (#1354) 2022-07-22 12:05:31 -07:00
Gabriel Ebner
ff3c67d1ad feat: recover from errors in attributes 2022-07-16 06:19:54 -07:00
Gabriel Ebner
eba400543d refactor: use computed fields for Name 2022-07-11 14:19:41 -07:00
Leonardo de Moura
d5476fb3b3 refactor: move toMessageList, add throwErrorWithNestedErrors 2022-06-16 18:00:09 -07:00
Leonardo de Moura
d56163bd0e refactor: resolveNamespace now return a List 2022-06-16 17:16:36 -07:00
Leonardo de Moura
02c4e548df feat: replace constant with opaque 2022-06-14 17:02:59 -07:00
Leonardo de Moura
caa79ca04f refactor: move MonadLog 2022-05-31 16:50:48 -07:00
Sebastian Ullrich
ef9976ccda fix: do not discard macro exceptions in expandMacro? 2022-05-30 13:28:42 +02:00
Leonardo de Moura
12e2a79170 chore: fix codebase after removing auto pure 2022-02-03 18:08:14 -08:00
Leonardo de Moura
868e95df1b feat: add Exception.isMaxRecDepth 2022-01-26 07:38:38 -08:00
Sebastian Ullrich
2a1aee2b7a feat: record declaration ranges of builtin parsers & elaborators 2021-11-26 17:13:19 +01:00
Sebastian Ullrich
e9f7c88299 feat: record doc strings of builtin parsers & elaborators 2021-11-26 17:13:19 +01:00
Sebastian Ullrich
6e4fcaaea9 fix: produce info tree even on macro or elab failure 2021-11-11 08:39:31 +01:00
Leonardo de Moura
1e44902243 fix: add withFreshMacroScope at expandMacroImpl? 2021-10-02 16:57:25 -07:00
Leonardo de Moura
5a7badd69a feat: add support for erasing keyed attributes
This commit addresses any issue described at https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/Eq.2Endrec.20vs.20Eq.2Erec
2021-09-09 14:28:41 -07:00
Wojciech Nawrocki
f51b80060d feat: generic tagged Format 2021-08-01 09:58:44 +02:00
Sebastian Ullrich
30a0954424 refactor: revert MonadRef changes 2021-06-21 10:17:26 -07:00
Sebastian Ullrich
65f2874d86 chore: address reviews 2021-06-21 10:17:26 -07:00
Sebastian Ullrich
eb1e285e26 chore: style 2021-06-21 10:17:26 -07:00
Sebastian Ullrich
91e3100e30 fix: properly resolve syntax kinds in macro/elab_rules 2021-06-21 10:17:26 -07:00
Sebastian Ullrich
9101c9d5da feat: support docstrings on syntax/macro/... 2021-06-21 10:17:26 -07:00
Sebastian Ullrich
da4c46370d feat: store elaborator declaration name in info tree 2021-06-21 10:17:26 -07:00
Sebastian Ullrich
062cc5d567 chore: remove inline 2021-06-19 15:01:43 +02:00
Sebastian Ullrich
b82b90a687 feat: KeyedDeclAttribute: expose declaration names 2021-06-06 15:32:58 +02:00
Sebastian Ullrich
d15e2b3756 refactor: make notation and macro macros again 2021-04-24 11:25:08 +02:00
Leonardo de Moura
b2190da468 feat: add Macro.resolveGlobalName and Macro.resolveNamespace? 2021-04-23 19:38:56 -07:00
Leonardo de Moura
d70f9c232c feat: trace support for MacroM
closes #184
2021-04-23 19:15:14 -07:00
Leonardo de Moura
c6e00aba63 chore: finalize Macro.Methods refactoring
We can now add new methods without using `update-stage0` multiple times.
2021-04-23 18:08:44 -07:00
Leonardo de Moura
d1dcf0b067 chore: cleanup
We still need another update stage0
2021-04-23 18:02:50 -07:00