-
Notifications
You must be signed in to change notification settings - Fork 203
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
Add support for LSP formatting options
parameter
#134
Add support for LSP formatting options
parameter
#134
Conversation
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.
Hey @masad-frost, thanks for your contribution! Please read my comment below to understand how to reorient your work to fit the design of the other plugins in this project.
The tests are failing on CI:
|
8083a16
to
e0872b5
Compare
5c7fd79
to
8aa9ce8
Compare
Lint caught an issue where I wasn't passing |
Hey @masad-frost, I fixed the linting errors reported here in another PR of mine. Please let me know if you need help to fix the merge conflicts so we can merge this one. |
Done |
Hmm, not sure why lint passed locally. Hopefully this is the last of it |
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.
Hey @masad-frost, last review then this should be ready.
I've also seen that you have struggled a lot with our linting tests, so I'll give you a hand with them if you're unable to fix them after this review.
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.
Thanks for your contribution @masad-frost!
options
parameter
Hey @ccordoba12, when do you plan on tagging a new release? Wondering because we wanna upgrade, also maybe i can slip #136 before then. |
Perhaps in a month or so. |
Good time to bump to 1.5? |
Yep, I'll release it next week. |
This PR adds support for LSP formatting options https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#formattingOptions for the yapf
It adds explicit support for
tabSize
andinsertSpaces
, the rest of the options are not configurable in yapf. I did however add support for arbitrary configurations as specified in[key: string]: boolean | integer | string;
.I think this PR might break plugins as the API now passes
options
to formatter hooks, but not sure.Nits are welcome as I don't normally read/write python.