Closed LaurenceWarne closed 4 weeks ago
This is editor dependent, is it not?
I am not sure if we are responsible to provide documentation for that. In my opinion, the editor should do this.
If we do, we would need to cover a few relevant editors.
The preferred style (sadly badly documented here) is using pyproject.toml
.
Maybe I should expand on that a little more, but I am not too keen on encouraging the use of esoteric command line editors.
I am not sure if we are responsible to provide documentation for that.
Yes it will be editor depedendent, I guess I was mainly trying to address that AFAICS the README config section doesn't mention that configuration from LSP is supported at all.
Maybe I should expand on that a little more, but I am not too keen on encouraging the use of esoteric command line editors.
I'm happy to drop the example. How about doing something similar to https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md by sticking the configuration options in a table with the relevant configuration keys? e.g.:
pyproject.toml key |
LSP configuration key | Type | Description | Default |
---|---|---|---|---|
live_mode |
pylsp.plugins.pylsp_mypy |
boolean |
This writes to a tempfile every time a check is done. Turning off live_mode means you must save your changes for mypy diagnostics to update correctly. | True |
etc
@LaurenceWarne do you know how to handle overrides?
pylsp_mypy = {
enabled = true,
overrides = {"--python-executable", "python"},
}
This ends up with this:
But if I configure it through pyproject.toml
works as expected. :thinking:
Ok, just figured out on my own:
pylsp_mypy = {
enabled = true,
overrides = {"--python-executable", "python", true},
}
You have to add the true
at the end, but some reason this true
value isn't required when set from pyproject.toml
.
@Richardk2n is this expected behavior?
@LaurenceWarne This seems sensible to me.
@nramirezuy The true
is the placeholder for the default command line arguments, that we pass, so depending on what you insert into the overrides
it is required.
What exactly do you mean by set from pyprojectl.toml
?
This seems sensible to me.
:+1: I've made edits to the PR
I think I've addressed everything :+1:
Hi, this PR is in response to https://github.com/python-lsp/pylsp-mypy/issues/32, I've added a description for how the plugin can be configured (to the best of my understanding :slightly_smiling_face:) using lsp, and given an example similar to that given in https://github.com/python-lsp/python-lsp-ruff#configuration.
Thanks!