Commit graph

26741 commits

Author SHA1 Message Date
Leonardo de Moura
e56bf66d8d chore: rename option hygienicIntro ==> tactic.hygienic
It is easier to find.
2021-04-10 16:09:04 -07:00
Leonardo de Moura
6dbf227cf2 fix: issues #387 part 2
see #387
2021-04-10 15:51:07 -07:00
Leonardo de Moura
a2522fd316 test: for issue #387
closes #387
2021-04-10 15:15:19 -07:00
Leonardo de Moura
314062e941 chore: update stage0
We need it because we have changed the `SimpLemma` representation and
they are stored in the .olean files.
2021-04-10 15:04:56 -07:00
Leonardo de Moura
91cb4aad2a refactor: simplify and document SimpLemma encoding 2021-04-10 15:03:04 -07:00
Leonardo de Moura
4f09390b8e feat: create SimpLemmas.Proof.abst at the simp tactic frontend 2021-04-10 14:17:43 -07:00
Leonardo de Moura
8be9a13679 feat: support for SimpLemma.Proof.abst 2021-04-10 12:46:48 -07:00
Leonardo de Moura
50292824c1 chore: update stage0 2021-04-10 11:39:27 -07:00
Leonardo de Moura
a1205afac2 feat: allow simp lemmas to be AbstractMvarsResult 2021-04-10 11:37:39 -07:00
Leonardo de Moura
3ba9872f33 feat: allow cdot notation at simp
closes #388
2021-04-09 19:50:42 -07:00
Leonardo de Moura
57f750ba84 chore: add helper method 2021-04-09 17:53:40 -07:00
Leonardo de Moura
642342d6c1 feat: add Expr.eta 2021-04-09 14:21:21 -07:00
Leonardo de Moura
3318c75bed fix: make sure borrow annotations do not affect auto-completion 2021-04-09 13:47:28 -07:00
Leonardo de Moura
bc8daee635 fix: index out of bounds 2021-04-09 10:09:12 -07:00
Sebastian Ullrich
af588078e0 fix: server: output import errors again 2021-04-09 12:40:38 +02:00
Leonardo de Moura
bfa874bc1a chore: update stage0 2021-04-08 19:26:25 -07:00
Leonardo de Moura
a1887df4ee feat: include parent structures and aliases in dot notation auto completion 2021-04-08 19:22:31 -07:00
Sebastian Ullrich
cc9577add2 refactor: server: remove SnapshotData 2021-04-08 22:10:27 +02:00
Sebastian Ullrich
dd15c8d5a7 feat: worker: don't abort on import error
to avoid the "crashed" message
2021-04-08 22:10:27 +02:00
Sebastian Ullrich
c3d6f781cf refactor: publishDiagnostics 2021-04-08 22:10:27 +02:00
Sebastian Ullrich
bba8184d3b feat: server: treat import errors as fatal 2021-04-08 22:10:27 +02:00
Sebastian Ullrich
a027b34d58 chore: remove dubious server-only option 2021-04-08 22:10:27 +02:00
Leonardo de Moura
a0a4b9faec fix: filter declarations that are not valid dot methods 2021-04-08 11:48:12 -07:00
Sebastian Ullrich
f75ce86f71 fix: server: go to type definition 2021-04-08 18:54:53 +02:00
Sebastian Ullrich
c7e6c9d89c chore: Nix: allow importing Leanpkg by default 2021-04-08 18:16:19 +02:00
Sebastian Ullrich
1b1ac393d8 fix: do not try to pretty-print unknown metavariables
Fixes #380
2021-04-08 18:16:05 +02:00
Sebastian Ullrich
d75d7aa0d5 fix: server: ignore unknown implementation-dependent notifications
Fixes #383
2021-04-08 09:54:36 +02:00
Sebastian Ullrich
898222686c chore: Nix: update vscode-lean4 2021-04-08 09:51:01 +02:00
Leonardo de Moura
2da8e5afa1 chore: add completion test for the group issue 2021-04-07 22:46:08 -07:00
Leonardo de Moura
95419cc194 chore: update stage0 2021-04-07 22:46:07 -07:00
Leonardo de Moura
7de9cfeac8 chore: fix StructInst and add mkGroupNode 2021-04-07 22:46:07 -07:00
Leonardo de Moura
0e21fb0937 chore: update stage0 2021-04-07 22:46:07 -07:00
Leonardo de Moura
578b3b822f fix: do not use nullKind for group combinator
We use `nullKind` for the `group` parser combinator.
When pattern matching `nullKind` nodes, we check their arities.
So, error recovery often fails for parsers that use the `group`
combinator.
For example, we have the parser
```
def whereDecls := leading_parser "where " >> many1Indent (group (letRecDecl >> optional ";"))
```
If there is syntax error at `letRecDecl`, the node corresponding to
```
group (letRecDecl >> optional ";")
```
will contain only one child, and the pattern matching at
```
def expandWhereDecls (whereDecls : Syntax) (body : Syntax) : MacroM Syntax :=
  match whereDecls with
  | `(whereDecls|where $[$decls:letRecDecl $[;]?]*) => `(let rec $decls:letRecDecl,*; $body)
  | _ => Macro.throwUnsupported
```
fails, and we can't elaborate the partial syntax tree for
`letRecDecl`, and auto-completion will not work there.

We address this issue by using a new kind for the `group` combinator.
The idea is to pattern match `group` as we pattern match `node`s with
proper syntax node kinds. This change is consistent with the way we
use `group` where it mainly a convenience for saving us the trouble of
defining a new parser definition that is used only once.
2021-04-07 22:30:51 -07:00
Leonardo de Moura
2b9df7d8b9 chore: make it clear that implementation relies on the fact that both branches of the if-then-else generate a node with the same kind
Motivation: we want to change the kind used in the `group` combinator.
2021-04-07 22:02:17 -07:00
Leonardo de Moura
390a476caf fix: incorrect use of unreachable! 2021-04-07 18:11:10 -07:00
Leonardo de Moura
6d361b91b5 Feat: Add getAllParentStructures 2021-04-07 18:06:10 -07:00
Leonardo de Moura
6c0f3c277f fix: ignore syntactically incorrect commands that do not contain any symbol
This kind of broken command does not have a position information, and
was producing a panic message in the server because it makes the
reasonable assumption that every command returned by `parserCommand`
has a position.
2021-04-07 14:46:13 -07:00
Leonardo de Moura
ca0912c6e3 chore: update stage0 2021-04-07 11:17:23 -07:00
Leonardo de Moura
7c8e27b044 chore: minor 2021-04-07 11:14:46 -07:00
Leonardo de Moura
98c6fd1151 fix: another antipattern 2021-04-07 10:42:54 -07:00
Leonardo de Moura
132d6de78d fix: antipattern
We should never assume a `Syntax` node has a specific number of
children because the parser error recovery may produce partial
abstract syntax trees. We should use `stx[i]` instead because
`Syntax.getOp` returns `Syntax.missing` when `i` is out of bounds.
2021-04-07 10:26:05 -07:00
Leonardo de Moura
393adadf9a chore: leftovers 2021-04-07 10:26:05 -07:00
Sebastian Ullrich
0396168c2c test: make sure the interactive test would have actually failed without the fix 2021-04-07 18:05:48 +02:00
Sebastian Ullrich
5b5a882da6 fix: watchdog: do not reorder messages while delaying edits 2021-04-07 17:12:37 +02:00
Sebastian Ullrich
2de5b141eb test: interactive: support inserting text 2021-04-07 17:12:37 +02:00
Sebastian Ullrich
43fcf69485 fix: watchdog: mark request as pending even if worker crashed 2021-04-07 16:48:12 +02:00
Sebastian Ullrich
7de11d2aa3 doc: quickstart: beware the Windows 2021-04-07 14:51:26 +02:00
Sebastian Ullrich
4517c518c8 doc: fix max precedence 2021-04-07 09:20:08 +02:00
Leonardo de Moura
487bcaaf2b chore: remove dead coe 2021-04-06 19:11:59 -07:00
Leonardo de Moura
c1b39afacc chore: update stage0 2021-04-06 19:07:05 -07:00