feat: run setup-file on lakefiles (#7153)

This PR changes the server to run `lake setup-file` on Lake
configuration files (e.g., `lakefile.lean`).

This is needed to support Lake passing the server its own Lake plugin to
load when elaborating the configuration file.
This commit is contained in:
Mac Malone 2025-02-20 23:04:10 -05:00 committed by GitHub
parent 36c798964e
commit aea58113cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -110,11 +110,6 @@ partial def setupFile (m : DocumentMeta) (imports : Array Import) (handleStderr
let some filePath := System.Uri.fileUriToPath? m.uri
| return ← FileSetupResult.ofNoLakefile -- untitled files have no lakefile
-- NOTE: we assume for now that `lakefile.lean` does not have any non-core-Lean deps
-- NOTE: lake does not exist in stage 0 (yet?)
if filePath.fileName == "lakefile.lean" then
return ← FileSetupResult.ofNoLakefile -- the lakefile itself has no lakefile
let lakePath ← determineLakePath
if !(← System.FilePath.pathExists lakePath) then
return ← FileSetupResult.ofNoLakefile