When using pyls-mypy live mode, currently only the source code of the file gets passed to mypy. This doesn't play well with trying to check files with relative imports as mypy does not know the path of the code. This patch fixes the issue by
writing the changed buffer to a temporary file
telling mypy to --shadow-file SOURCEFILE TEMPFILE , making mypy check the TEMPFILE when it would check SOURCEFILE
When using pyls-mypy live mode, currently only the source code of the file gets passed to mypy. This doesn't play well with trying to check files with relative imports as mypy does not know the path of the code. This patch fixes the issue by