Commit graph

2139 commits

Author SHA1 Message Date
Sebastian Ullrich
316b453be4 chore: do not show term info for synthetic sorry 2021-01-20 16:48:50 +01:00
Sebastian Ullrich
67c78ef1b7 fix: exclude synthetic syntax from hover/definition 2021-01-20 16:48:50 +01:00
Sebastian Ullrich
a9f96ace3e chore: naming 2021-01-20 16:48:50 +01:00
Sebastian Ullrich
79107a2316 feat: copy & store whole ref range in SourceInfo 2021-01-20 16:48:50 +01:00
Sebastian Ullrich
5f392749f2 chore: remove dead code 2021-01-20 16:48:50 +01:00
Sebastian Ullrich
462e1d54a3 chore: replace uses of copyInfo with automatic position copying in syntax quotations
We could introduce a `copyPos` alternative, but turns out we don't need it right now
2021-01-20 16:48:50 +01:00
Leonardo de Moura
8c6a510e65 fix: use withReducible
`def17.lean` contains example where `isDefEq arg x` takes a very long
time with the default reducibility test.
2021-01-19 18:01:52 -08:00
Leonardo de Moura
c1bc0e44f6 fix: fixes #281
This issue exposed two bugs at `Structural.lean`

1- `getFixedPrefix` was using structural equality to detected fixed
arguments. We should use definitional equality.

2- The `replaceFVars` was broken. We should use `instantiateForall` instead.
2021-01-19 18:01:52 -08:00
Leonardo de Moura
1e7380a1f7 fix: fixes #282 2021-01-19 18:01:52 -08:00
Leonardo de Moura
8e39b82541 feat: skeleton for SizeOf instance generator 2021-01-19 18:01:52 -08:00
Wojciech Nawrocki
445420315e fix: normalise go-to-def paths 2021-01-19 13:22:13 -08:00
Wojciech Nawrocki
90075153b3 fix: UTF-16 strikes again
We need to report the jump target range in terms of a UTF-16 offset within the line, but to compute that we would have to load the target file, file-map it, and resolve that way each time the go-to-def handler runs. As an alternative, this stores the UTF-16 offsets in `DeclarationRange`.
2021-01-19 13:22:13 -08:00
Wojciech Nawrocki
e627ad308d feat: go-to-definition 2021-01-19 13:22:13 -08:00
Wojciech Nawrocki
40698ecc07 feat: LSP scaffolding for go-to-definition 2021-01-19 13:22:13 -08:00
Wojciech Nawrocki
f07cf2c4e4 feat: store source path in server worker 2021-01-19 13:22:13 -08:00
Wojciech Nawrocki
f252a47bbb feat: generalise SearchPath lookup 2021-01-19 13:22:13 -08:00
Sebastian Ullrich
bc0f43c4b9 chore: remove a few dbgTraceVals... 2021-01-19 19:31:44 +01:00
Sebastian Ullrich
38911d1be3 feat: Nix: support leanpkg print-paths setup 2021-01-19 19:06:01 +01:00
Sebastian Ullrich
8ad061e328 feat: leanpkg: change print-path to print-paths that also emit LEAN_SRC_PATH (unused as of yet) 2021-01-19 19:06:01 +01:00
Sebastian Ullrich
e5c485ff45 feat: incremental progress notification while compiling dependencies 2021-01-19 19:06:01 +01:00
Sebastian Ullrich
d7733ba662 feat: use leanpkg print-path for worker initialization 2021-01-19 19:06:01 +01:00
Sebastian Ullrich
35e4f7391a feat: publish fatal worker error as diagnostic 2021-01-19 19:06:01 +01:00
Sebastian Ullrich
2eb0f58bdd chore: restart worker only on didChange
will otherwise be constantly retriggered by documentSymbol in Emacs
2021-01-19 19:06:01 +01:00
Leonardo de Moura
f1ed13efff feat: improve elabMatchAux
We now (try to) postpone `match ... with` elaboration when pattern
variables and patterns still contain metavariables before invoking `mkMatcher`.

This improvement makes sure we can elaborate an example submitted by
Daniel Selsam.

Remark: this update may create performance problems since we
backtrack `elabMatchTypeAndDiscrs` and `elabMatchAltView`.
We hope this is not a problem in practice since we use the "quick-check"
`waitExpectedTypeAndDiscrs`. Recall that we could compile Lean
without this commit. So, it suggests cases where we need to postpone
after `elabMatchAltView` are rare.
2021-01-18 15:33:48 -08:00
Leonardo de Moura
6df66bf0ac feat: generalize observing
We can now "observe" any `TermElabM α` action.
2021-01-18 15:10:42 -08:00
Leonardo de Moura
711d1754a6 chore: improve error message
closes #276
2021-01-17 07:51:08 -08:00
Christian Pehle
066baeccc0 fix: pass (some) cmdline arguments to watchdog and workers
Capture some of the command line arguments in an argument
vector, that then gets passed to the watchdog and
subsequently the worker processes. Currently flags like
"-T" and "-j2" are not passed on to the watchdog and
worker processes.

Addresses #246
2021-01-17 15:06:11 +01:00
zygi
65c0c787ef fix: make Meta.transform use matching aux functions
visitForall should probably be used in forallE case, same for lambda
2021-01-17 10:04:33 +01:00
Sebastian Ullrich
fcb1616c20 chore: reduce dependencies 2021-01-16 19:45:45 +01:00
Leonardo de Moura
eb25b97501 fix: pattern variables cannot shadow each other 2021-01-16 08:23:45 -08:00
Leonardo de Moura
7e0d76aff0 fix: losing local instances at assertAfter
closes #270
2021-01-15 19:30:03 -08:00
Leonardo de Moura
f73eb1246a feat: add pp.safe_shadowing
When `pp.safe_shadowing` is set to true, we still use the
suggested name if the "body" does not contain a free variable with the
suggested name. This is the approach used in Lean 3, and I think it
improved the result in all affected tests.
The implementation was simple. The only nasty case was `delabAppMatch`.

The main motivation for this feature was hovering information such as
```lean
f : {α_1 : Type} → α_1 → α_1
```
when hovering over the `f` at
```lean
def g (α : Type) (a : α) :=
  f a
```
With `safe_shadowing`, we get the nicer
```lean
f : {α : Type} → α → α
```

cc @Kha
2021-01-15 18:53:25 -08:00
Leonardo de Moura
dcc2283426 fix: refineCore
closes #269
2021-01-15 17:03:40 -08:00
Leonardo de Moura
58d51bc764 feat: add FieldInfo 2021-01-15 15:01:45 -08:00
Leonardo de Moura
0672247ce8 chore: make comments VS Code friendly 2021-01-15 13:53:37 -08:00
Wojciech Nawrocki
d7c201a2d4 chore: minor hover code cleanup 2021-01-15 13:29:22 -08:00
Wojciech Nawrocki
46e9d2533d fix: resolving French-quoted field names 2021-01-15 13:29:22 -08:00
Sebastian Ullrich
fa7e679c73 feat: hover: use syntax highlighting 2021-01-15 13:29:22 -08:00
Wojciech Nawrocki
310a2ab6a3 feat: minimal hovers MVP 2021-01-15 13:29:22 -08:00
Wojciech Nawrocki
a711ccc0fd chore: tail-recursive JSON printing 2021-01-15 13:29:22 -08:00
Wojciech Nawrocki
cba3d69e78 feat: enable info trees in server 2021-01-15 13:29:22 -08:00
Wojciech Nawrocki
5a46f43b56 fix: elab cancellation on server exit 2021-01-15 13:29:22 -08:00
Leonardo de Moura
223a5d5ded fix: bug at isDefEqOffset
closes #268
2021-01-15 13:08:37 -08:00
Leonardo de Moura
ae60360d7a feat: add resolveName' which produces Syntax with position information for each field 2021-01-15 11:19:01 -08:00
Sebastian Ullrich
021a823f49 feat: add option printMessageEndPos 2021-01-15 16:27:59 +01:00
Sebastian Ullrich
d1ff0991f4 fix: copy position for identifiers in quotations, not just for atoms 2021-01-15 16:27:59 +01:00
Sebastian Ullrich
dc77c45787 fix: mvar check trace message 2021-01-15 14:34:06 +01:00
Sebastian Ullrich
720f06d251 fix: interpreted bracketedBinder.quot 2021-01-15 14:34:06 +01:00
Leonardo de Moura
6a39c65bd2 feat: improve match error message 2021-01-14 14:58:34 -08:00
Leonardo de Moura
4752c56fe8 feat: improve range of missing cases: ... error message
@Kha I added the helper combinator `withHeadRefOnly x`. I executes `x`
using the head token of the current `ref` as the new `ref`.
2021-01-14 14:48:53 -08:00