Integrate mypy daemon in vim
bew opened this issue Β· comments
Ref: https://mypy.readthedocs.io/en/stable/mypy_daemon.html
Neomake doesn't seem to support the daemon variant (yet), it only support standard mypy.
π Maybe make a custom 'maker' ?
Need to see if the output of dmypy check
is exactely the same, and if I can use the existing mypy' neomake 'maker' and only have to manage the daemon lifetime (even that, the daemon is pretty much self-managed it seems!)
daemon timeout could be set to 24h ? Or don't use timeout and setup vim's autocmd to close the daemon with dmypy stop
?
There is some interesting discussion here: dense-analysis/ale#1557 (comment)
In addition, in my usage dmypy run -- is basically a drop in replacement for running mypy, except that it's faster and has the potential to create a .dmypy.json file if you ask it to start when one's not running.
With a timeout this could be the best solution? TO TRY!!!
Static inference of annotations
Once the daemon is working, try to integrate static inference of annotations?
ref: https://mypy.readthedocs.io/en/latest/mypy_daemon.html#static-inference-of-annotations
It can help find how a function is actually called (i.e: which types are used)
This could be used when overriding a function or doing the implementation of an abstract method, and where I want to 'paste' the arguments of that function.
===> Actually the feature doesn't seems used to do that.. We'll see..
In a running editor I might be editing / viewing files from multiple repositories.
π See how to handle that
Maybe the solution is to not have dmypy enabled by default (using mypy as fallback), and enabling it for a given repo.
Buffers of files in another repo would fallback to mypy instead of dmypy.