Skip to content

emacs lsp-mode client for Microsoft's python language server

License

Notifications You must be signed in to change notification settings

astenman/lsp-python-ms

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lsp-mode client leveraging Microsoft’s python-language-server.

Installation

Include lsp-python-ms in the configuration file:

(require 'lsp-python-ms)
(add-hook 'python-mode #'lsp) ; or lsp-deferred

A minimal use-package initialization might be:

(use-package lsp-python-ms
  :ensure t
  :hook (python-mode . (lambda ()
                          (require 'lsp-python-ms)
                          (lsp))))  ; or lsp-deferred

Normally the python-language-server will be downloaded automatically if it doesn’t exist while opening the python scripts.

If you have troubles to download the package, you can also build the server yourselves.

  1. Install dotnet-sdk
  2. Clone and build python-language-server:
    git clone https://github.com/Microsoft/python-language-server.git
    cd python-language-server/src/LanguageServer/Impl
    dotnet publish -c Release -r osx-x64   # mac
        

    Change the -r flag according to your architecture and operating system. See Microsoft’s Runtime ID Catalog for the right value for your system.

    Then make the binary executable.

    chmod a+x $(git rev-parse --show-toplevel)/output/bin/Release/osx-x64/publish/Microsoft.Python.LanguageServer
        

    NOTE: on some systems (for example, Fedora), the executable comes out as Microsoft.Python.LanguageServer.LanguageServer.

  3. Set executable to lsp-python-ms-executable.
    ;; for executable of language server, if it's not symlinked on your PATH
    (setq lsp-python-ms-executable
          "~/python-language-server/output/bin/Release/osx-x64/publish/Microsoft.Python.LanguageServer")
        

For development, you might find it useful to run cask install.

Credit

All credit to cpbotha on vxlabs! This just tidies and packages his work there

About

emacs lsp-mode client for Microsoft's python language server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Emacs Lisp 100.0%