This PR adds per-package server options to resolve #2455. It is based on the previous work in #2456, but takes a different approach: options are loaded for the specific file in the file worker when `print-paths` is called, instead of loading them in the watchdog with a separate Lake command. This change addresses review comments made in #2456. In doing so, it introduces two new Lake config fields: - `leanOptions`: `-D` flag options that are passed to both the language server and `lean` when building. - `moreServerOptions`: `-D` flag options that are passed to the language server. Since `print-paths` must also accept a file path to compute the options for that file, this PR is changing the API for `print-paths`. As there have been numerous complaints about the name `print-paths`, I also decided to change it to `setup-file` in this PR, since it would break compatibility with the old Lake API anyways. This PR deprecates the Lakefile field `moreServerArgs` in favor of `moreGlobalServerArgs`, as suggested in the review for #2456. Fixes #2455 --------- Co-authored-by: digama0 <mcarneir@andrew.cmu.edu>
14 lines
732 B
Text
14 lines
732 B
Text
{"textDocument": {"uri": "file:///foldingRange.lean"},
|
|
"position": {"line": 0, "character": 2}}
|
|
[{"startLine": 1, "kind": "imports", "endLine": 4},
|
|
{"startLine": 8, "kind": "imports", "endLine": 9},
|
|
{"startLine": 13, "kind": "comment", "endLine": 15},
|
|
{"startLine": 17, "kind": "comment", "endLine": 19},
|
|
{"startLine": 21, "kind": "region", "endLine": 22},
|
|
{"startLine": 24, "kind": "region", "endLine": 30},
|
|
{"startLine": 32, "kind": "region", "endLine": 37},
|
|
{"startLine": 33, "kind": "region", "endLine": 34},
|
|
{"startLine": 35, "kind": "region", "endLine": 36},
|
|
{"startLine": 11, "kind": "region", "endLine": 39},
|
|
{"startLine": 6, "kind": "region", "endLine": 40},
|
|
{"startLine": 42, "kind": "region", "endLine": 46}]
|