Giter Club home page Giter Club logo

Comments (4)

tomv564 avatar tomv564 commented on August 16, 2024

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.

nilehmann avatar nilehmann commented on August 16, 2024

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.

tomv564 avatar tomv564 commented on August 16, 2024

I don't have any time to work on this. But feel free to open a PR with a workaround!

from pyls-mypy.

gdiv avatar gdiv commented on August 16, 2024

@nilehmann

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.