Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions LeanCopilot/Frontend.lean
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@ def suggestion (tac : String) (msgs : MessageLog := {}) : TacticM Suggestion :=
let e ← g.withContext do (PrettyPrinter.ppExpr goalType)
str := str ++ Format.pretty ("\n⊢ " ++ e)
pure (some str)
let style? := if goals.isEmpty then some .success else none
let msg? ← msgs.toList.findM? fun m => do pure <|
m.severity == MessageSeverity.information && (← m.data.toString).startsWith "Try this: "
let suggestion ← match msg? with
| some m => pure <| SuggestionText.string (((← m.data.toString).drop 10).takeWhile (· != '\n'))
| none => pure <| SuggestionText.string tac
return { suggestion, postInfo?, style? }
return { suggestion, postInfo? }


/-- Run a tactic, returning any new messages rather than adding them to the message log. -/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ moreLinkArgs = ["-L./.lake/packages/LeanCopilot/.lake/build/lib", "-lctranslate2
require LeanCopilot from git "https://github.com/lean-dojo/LeanCopilot.git" @ "LEAN_COPILOT_VERSION"
```

For stable Lean versions (e.g., `v4.24.0`), set `LEAN_COPILOT_VERSION` to be that version. For the latest unstable Lean versions (e.g., `v4.25.0-rc1`), set `LEAN_COPILOT_VERSION` to `main`. In either case, make sure the version is compatible with other dependencies such as mathlib. If your project uses lakefile.toml instead of lakefile.lean, it should include:
For stable Lean versions (e.g., `v4.25.0`), set `LEAN_COPILOT_VERSION` to be that version. For the latest unstable Lean versions (e.g., `v4.26.0-rc1`), set `LEAN_COPILOT_VERSION` to `main`. In either case, make sure the version is compatible with other dependencies such as mathlib. If your project uses lakefile.toml instead of lakefile.lean, it should include:

```toml
[[require]]
Expand Down
8 changes: 4 additions & 4 deletions lake-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
"type": "git",
"subDir": null,
"scope": "",
"rev": "725ac8cd67acd70a7beaf47c3725e23484c1ef50",
"rev": "26e4c7c0e63eb3e6cce3cf7faba27b8526ea8349",
"name": "aesop",
"manifestFile": "lake-manifest.json",
"inputRev": "master",
"inputRev": "26e4c7c0e63eb3e6cce3cf7faba27b8526ea8349",
"inherited": false,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover-community/batteries.git",
"type": "git",
"subDir": null,
"scope": "",
"rev": "8da40b72fece29b7d3fe3d768bac4c8910ce9bee",
"rev": "39260e31b7b3f7f05643da95242463b462dc05f1",
"name": "batteries",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
"inputRev": "39260e31b7b3f7f05643da95242463b462dc05f1",
"inherited": false,
"configFile": "lakefile.toml"}],
"name": "LeanCopilot",
Expand Down
4 changes: 2 additions & 2 deletions lakefile.lean
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,8 @@ extern_lib libleanffi pkg := do
buildStaticLib (pkg.sharedLibDir / name) #[ct2O]


require batteries from git "https://github.com/leanprover-community/batteries.git" @ "main"
require aesop from git "https://github.com/leanprover-community/aesop" @ "master"
require batteries from git "https://github.com/leanprover-community/batteries.git" @ "39260e31b7b3f7f05643da95242463b462dc05f1"
require aesop from git "https://github.com/leanprover-community/aesop" @ "26e4c7c0e63eb3e6cce3cf7faba27b8526ea8349"

meta if get_config? env = some "dev" then -- dev is so not everyone has to build it
require «doc-gen4» from git "https://github.com/leanprover/doc-gen4" @ "main"
2 changes: 1 addition & 1 deletion lean-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
leanprover/lean4:v4.24.0
leanprover/lean4:v4.25.0