Skip to content

Commit

Permalink
feat: build lean project after initialization (#363)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhuisi authored Nov 26, 2023
1 parent 08d46f1 commit 2fd18c6
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions vscode-lean4/src/projectinit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,22 @@ export class ProjectInitializationProvider implements Disposable {
}

private async createStandaloneProject() {
const projectFolder: Uri | 'DidNotComplete' = await this.createProject()
const toolchain = 'leanprover/lean4:stable'
const projectFolder: Uri | 'DidNotComplete' = await this.createProject(undefined, toolchain)
if (projectFolder === 'DidNotComplete') {
return
}

if (projectFolder !== 'DidNotComplete') {
await ProjectInitializationProvider.openNewFolder(projectFolder)
const buildResult: ExecutionResult = await lake(this.channel, projectFolder, toolchain).build()
if (buildResult.exitCode === ExecutionExitCode.Cancelled) {
return
}
if (buildResult.exitCode !== ExecutionExitCode.Success) {
await displayError(buildResult, 'Cannot build Lean project.')
return
}

await ProjectInitializationProvider.openNewFolder(projectFolder)
}

private async createMathlibProject() {
Expand Down

0 comments on commit 2fd18c6

Please sign in to comment.