-
Notifications
You must be signed in to change notification settings - Fork 37
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
Can't get mypy to start from LSP-pylsp
#9
Comments
There seems to be some ambiguity weather mypy_ls or mypy-ls works for the config (meaning try Can you confirm other plugins run? Can you confirm weather mypy-ls is started and misbehaving or if it is not even started? |
Changing to
Other plugins run excellent, such as:
I don't know how to check if it starts. I can't see any difference after |
@StabbarN What does your I initially tried defining the settings in // Settings in here override those in "LSP/LSP.sublime-settings"
{
"clients": {
"pylsp": {
"enabled": true,
"selector": "source.python",
"command": [
"path/to/.venv/bin/pylsp",
],
"settings": {
"pylsp.plugins.mypy_ls.enabled": true,
"pylsp.plugins.mypy-ls.live_mode": true
}
}
}
} I didn't really dig into the reasons why one would work but the other would not, just sharing in case this might help. |
I'm not sure what that If you want pylsp to use your virtual environment then follow https://github.com/sublimelsp/LSP-pylsp#virtual-environments To enable mypyls a settings like:
should work. With a code like: def test(a: str) -> None:
pass
test(1) (remember to save the file if you have |
Setup as
seems to work after a quick test. I've a lot of other stuffs going right now. I'll hopefully do more testing and verification in a few days. |
The only reason I can think of why this would work better for you is because you are running pylsp from your virtual environment. When using the |
It looks like you found a way, that works for you, and mypy-ls did not cause this issue. Is that correct? (Meaning can I close this now?) |
I haven't verified it yet but my problem is probably that I haven't installed Python LSP Server manually as described at https://yeray.dev/python/setting-up-sublime-text-4-for-python#manual-setup I was planning to install it manually and then close this issue. Yes, this issue can be closed. Thank you for all responses! |
There was a recent related change made that might have fixed the original issues. |
I want to enable mypy (preferably dmypy) with Sublime and LSP-pylsp but I can't get mypy to run.
Linting and formatting in Sublime works fine.
My sublime-project file:
My LSP-pylsp.sublime-settings:
I've tried setting live_mode to true or false:
"pylsp.plugins.mypy-ls.live_mode": true,
I've tried creating a mypy-ls.cfg file in my project's root with the following content but to no avail:
cat mypy-ls.cfg
Executing dmypy (and mypy) from terminal works fine.
When I have opened sublime dmypy isn't started
dmypy status
says "No status file found". So it seems that dmypy isn't started.In Sublime I've set
log_server": ["panel"]
and checked what's sent to pylsp but it seems fine.Please advice what more I can do to debug this.
The text was updated successfully, but these errors were encountered: