Skip to content

Fork of Palantir's implementation of the Language Server Protocol for Python with features needed by Spyder

License

Notifications You must be signed in to change notification settings

steff456/spyder-pyls

 
 

Repository files navigation

Python Language Server

Circle CI build status Appveyor build status license Join the chat at https://gitter.im/spyder-ide/public
OpenCollective Backers OpenCollective Sponsors

A Python 2.7 and 3.5+ implementation of the Language Server Protocol.

Installation

The base language server requires Jedi to provide Completions, Definitions, Hover, References, Signature Help, and Symbols:

pip install spyder-pyls

If the respective dependencies are found, the following optional providers will be enabled:

  • Rope for completions and renaming
  • Pyflakes linter to detect various errors
  • McCabe linter for complexity checking
  • pycodestyle linter for style checking
  • pydocstyle linter for docstring style checking (disabled by default)
  • autopep8 for code formatting
  • YAPF for code formatting (preferred over autopep8)

Optional providers can be installed using the extras syntax. To install YAPF formatting for example:

pip install 'spyder-pyls[yapf]'

All optional providers can be installed using:

pip install 'spyder-pyls[all]'

If you get an error similar to 'install_requires' must be a string or list of strings then please upgrade setuptools before trying again.

pip install -U setuptools

3rd Party Plugins

Installing these plugins will add extra functionality to the language server:

Please see the above repositories for examples on how to write plugins for the Python Language Server. Please file an issue if you require assistance writing a plugin.

Configuration

Configuration is loaded from zero or more configuration sources. Currently implemented are:

  • pycodestyle: discovered in ~/.config/pycodestyle, setup.cfg, tox.ini and pycodestyle.cfg
  • flake8: discovered in ~/.config/flake8, setup.cfg, tox.ini and flake8.cfg

The default configuration source is pycodestyle.

Language Server Features

  • Code completion

Screenshot of Spyder's code completion

  • Code linting (Warnings and errors)

Screenshot of Spyder's linting info

Development

To run the test suite:

pip install .[test] && tox

Develop against Spyder

The Python language server can be developed against a local instance of Spyder IDE.

  1. Install it with pip install -e .
  2. Start Spyder in debug mode (python bootstrap.py --debug)
  3. Check logs for both client and server in ~/.spyder-py3/lsp-logs

License

This project is made available under the MIT License.

Sponsors

Spyder is funded thanks to the generous support of

QuansightNumfocus

and the donations we have received from our users around the world through Open Collective:

Sponsors

About

Fork of Palantir's implementation of the Language Server Protocol for Python with features needed by Spyder

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 98.6%
  • TypeScript 1.4%