dotfiles icon indicating copy to clipboard operation
dotfiles copied to clipboard

Integrate mypy daemon in vim

Open bew opened this issue 4 years ago • 2 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: https://github.com/dense-analysis/ale/issues/1557#issuecomment-580546999

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!!!

bew avatar May 21 '21 19:05 bew

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..

bew avatar May 21 '21 19:05 bew

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.

bew avatar May 21 '21 19:05 bew