Comments (4)
Thanks for reporting, great to hear this plugin working for Emacs users!
Although workspace
is passed into pyls-mypy (exposing a root_path
member), I am a bit unsure how it should improve your situation.
We use mypy as a library, so there is no mypy
process to set a working directory on.
try to find the configuration file and pass it as an argument to mypy.
This is probably doable, but reading python/mypy#3377 I get the impression mypy expects to be run from the project root.
Taking mypy_ini_path
as a config option from lsp-mode through pyls feels safer in that case, at least the user will be aware of the problem when they have to manually specify the config file.
Is there some design limitation preventing lsp-mode from changing to rootPath itself before starting pyls?
from pyls-mypy.
By using rootUri I meant doing a os.chdir
before calling mypy, but that doesn't feel right. The configurable path seems like a better option. Yet another solution could be calling mypy in a different process.
Anyway, it feels strange fixing the problem here the way the plugin is implemented, that's why I reported the issue in lsp-mode in the first place. I don't know if this can be fixed in lsp-mode or not.
from pyls-mypy.
I don't have any time to work on this. But feel free to open a PR with a workaround!
from pyls-mypy.
lsp-mode for emacs runs pyls in the directory of the first file visited in a project
This can be fixed by
(lsp-define-stdio-client lsp-python "python"
#'projectile-project-root
'("pyls"))
(add-hook 'python-mode-hook
(lambda ()
(let ((root (projectile-project-root)))
(if root
(progn
(cd root)
(lsp-python-enable))))))
from pyls-mypy.
Related Issues (20)
- Is it possible to set --custom-typeshed option?
- Error: Header must provide a Content-Length property. HOT 6
- mypy and workspace HOT 1
- error in process filter: Wrong type argument: hash-table-p, nil HOT 3
- Overloads signatures HOT 3
- Use is_saved flag in lint hook HOT 1
- Prove a hover using mypy's reveal_type?
- Run the mypy daemon? HOT 1
- An overloaded function outside a stub file must have an implementation HOT 4
- Handle multi-line output for same typing issue
- Cannot perform relative import HOT 3
- Using with emacs HOT 5
- Should we replace versioner with setuptools_scm and setuptools_scm_git_archive? HOT 2
- Missing error?
- Skipping analyzing error HOT 6
- Publish new release to PyPI HOT 4
- Position of error marker shifted one position right on some versions
- Configuration to point out a .mypy.ini HOT 4
- Doesn't seem to work HOT 7
- Update plugin to use python-lsp-server instead of python-language-server HOT 17
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyls-mypy.