This PR adds support to the server for the new module setup process by changing how `lake setup-file` is used. In the new server setup, `lake setup-file` is invoked with the file name of the edited module passed as a CLI argument and with the parsed header passed to standard input in JSON form. Standard input is used to avoid potentially exceeding the CLI length limits on Windows. Lake will build the module's imports along with any other dependencies and then return the module's workspace configuration via JSON (now in the form of `ModuleSetup`). The server then post-processes this configuration a bit and returns it back to the Lean language processor. The server's header is currently only fully respected by Lake for external modules (files that are not part of any workspace library). For workspace modules, the saved module header is currently used to build imports (as has been done since #7909). A follow-up Lake PR will align both cases to follow the server's header. Lean search paths (e.g., `LEAN_PATH`, `LEAN_SRC_PATH`) are no longer negotiated between the server and Lake. These environment variables are already configured during sever setup by `lake serve` and do not change on a per-file basis. Lake can also pre-resolve the `.olean` files of imports via the `importArts` field of `ModuleSetup`, limiting the potential utility of communicating `LEAN_PATH`.
18 lines
269 B
JSON
18 lines
269 B
JSON
{
|
|
"name": "Dep",
|
|
"isModule": false,
|
|
"imports": [
|
|
{
|
|
"module": "Dep",
|
|
"importAll": false,
|
|
"isExported": true,
|
|
"isMeta": false
|
|
}
|
|
],
|
|
"importArts": {
|
|
"Dep": ["Dep.olean"]
|
|
},
|
|
"dynlibs": [],
|
|
"plugins": [],
|
|
"options": {}
|
|
}
|