-
Notifications
You must be signed in to change notification settings - Fork 465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: per-package server options #2858
feat: per-package server options #2858
Conversation
(cc @Kha to adjust the Nix stuff) |
The tests are red because of a bug in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
It's worse: The tests used an incorrect URI format and it never caused problems before! |
|
I missed something! Since you renamed Also, for temporary backwards compatibility, it might be worth it for one version to leave the |
Note that the Mathlib bot reporting that PR didn't complete normally is actually a failure:
If you're able to make changes to the |
aa07744
to
9dac96d
Compare
72d28d1
to
f33dbc9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor suggestions that help the code of the new options fit the style of other package configuration options. Otherwise, LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mhuisi I think you lost the library's leanOptions
when addressing my suggestions.
181ab9e
to
bad3e43
Compare
…ge-server-options
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 andlean
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 forprint-paths
. As there have been numerous complaints about the nameprint-paths
, I also decided to change it tosetup-file
in this PR, since it would break compatibility with the old Lake API anyways.This PR deprecates the Lakefile field
moreServerArgs
in favor ofmoreGlobalServerArgs
, as suggested in the review for #2456.Updating your Lakefile
A Lakefile with the following package declaration:
... can be updated to the following package declaration to use per-package options:
package SomePackage where leanOptions := ⟨`pp.unicode.fun, true⟩
A package configuration that does not set
moreLeanArgs
can usemoreServerOptions
instead ofleanOptions
:package SomePackage where moreServerOptions := ⟨`pp.unicode.fun, true⟩
Fixes #2455