Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
Find a file
Marc Huisinga faa4d16dc1
fix: semantic tokens performance (#3932)
While implementing #3925, I noticed that the performance of the
`textDocument/semanticTokens/full` request is *extremely* bad due to a
quadratic implementation. Specifically, on my machine, computing the
full semantic tokens for `Lean/Elab/Do.lean` took a full 5s. In
practice, this means that while elaborating the file, one core is
entirely busy with computing the semantic tokens for the file.

This PR fixes this performance bug by re-implementing the semantic token
handling, reducing the latency for `Lean/Elab/Do.lean` from 5s to 60ms.
As a result, the overly cautious refresh latency of 5s in #3925 can
easily be reduced to 2s again.

Since the previous semantic tokens implementation used a very brittle
hack to identify projections, this PR also changes the projection
notation elaboration to augment the `InfoTree` syntax for the field of a
projection with a special syntax node of kind
`Lean.Parser.Term.identProjKind`. With this syntax kind, projection
fields can now easily be identified in the `InfoTree`.
2024-04-18 07:48:44 +00:00
.github fix: find nightly-with-mathlib SHA (#3923) 2024-04-16 11:18:51 +00:00
doc doc: update release checklist based on experience with 4.7.0 (#3833) 2024-04-17 04:33:45 +00:00
images
nix chore: test results as job summary (#3715) 2024-03-27 10:14:33 +00:00
script feat: trace.profiler export to Firefox Profiler (#3801) 2024-04-15 12:13:14 +00:00
src fix: semantic tokens performance (#3932) 2024-04-18 07:48:44 +00:00
stage0 chore: update stage0 2024-04-17 19:26:22 +00:00
tests feat: make linter options more explicitly discoverable (#3938) 2024-04-18 07:20:55 +00:00
.gitattributes chore: Do not hide stage0/src/stdlib_flags.h from diffs 2023-09-13 19:29:25 +02:00
.gitignore chore: update tests to account for .lake 2023-11-13 20:31:24 -05:00
.ignore chore: ignore stage0/ (for rg etc.) 2022-03-18 15:28:20 +01:00
CMakeLists.txt chore: update-stage0-commit cmake target (#3692) 2024-04-04 13:35:53 +00:00
CODEOWNERS chore: rename fields of Subarray to follow Lean conventions (#3851) 2024-04-13 07:52:45 +00:00
CONTRIBUTING.md doc: Adjust contributor's docs to squash merging (#2927) 2023-11-21 10:13:43 +00:00
flake.lock chore: test results as job summary (#3715) 2024-03-27 10:14:33 +00:00
flake.nix chore: replace shell.nix with a devShell in flake.nix (#3717) 2024-03-21 13:24:01 +00:00
lean-toolchain doc: VS Code dev setup (#2961) 2023-11-30 08:35:03 +00:00
lean.code-workspace chore: add the lean4 extension to the vscode workspace (#3059) 2023-12-14 08:58:21 +00:00
LICENSE chore: remove LICENSE header that confused GitHub 2021-11-18 09:42:35 +01:00
LICENSES chore: add GMP license for now 2021-11-18 09:42:35 +01:00
README.md doc: remove nightly and other outdated references (#3027) 2024-01-25 13:53:36 +00:00
RELEASES.md chore: rename Option.toMonad and remove argument (#3865) 2024-04-17 04:58:54 +00:00

This is the repository for Lean 4.

About

Installation

See Setting Up Lean.

Contributing

Please read our Contribution Guidelines first.

Building from Source

See Building Lean.