All Projects → palantir → Python Language Server

palantir / Python Language Server

Licence: mit
An implementation of the Language Server Protocol for Python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Python Language Server

giraffe
Gracefully Integrated Remote Access For Files and Execution
Stars: ✭ 50 (-97.93%)
Mutual labels:  octo-correct-managed
tracing-java
Java library providing zipkin-like tracing functionality
Stars: ✭ 13 (-99.46%)
Mutual labels:  octo-correct-managed
dropwizard-web-security
A Dropwizard bundle for applying default web security functionality
Stars: ✭ 37 (-98.47%)
Mutual labels:  octo-correct-managed
go-baseapp
A lightweight starting point for Go web servers
Stars: ✭ 61 (-97.47%)
Mutual labels:  octo-correct-managed
metric-schema
Schema for standard metric definitions
Stars: ✭ 13 (-99.46%)
Mutual labels:  octo-correct-managed
go-license
Go tool that applies and verifies that proper license headers are applied to Go files
Stars: ✭ 42 (-98.26%)
Mutual labels:  octo-correct-managed
phishcatch
A browser extension and API server for detecting corporate password use on external websites
Stars: ✭ 75 (-96.89%)
Mutual labels:  octo-correct-managed
Blueprint
A React-based UI toolkit for the web
Stars: ✭ 18,376 (+661.86%)
Mutual labels:  octo-correct-managed
dropwizard-web-logger
WebLoggerBundle is a Dropwizard bundle used to help log web activity to log files on a server’s backend
Stars: ✭ 14 (-99.42%)
Mutual labels:  octo-correct-managed
log4j-sniffer
A tool that scans archives to check for vulnerable log4j versions
Stars: ✭ 180 (-92.54%)
Mutual labels:  octo-correct-managed
hadoop-crypto
Library for per-file client-side encyption in Hadoop FileSystems such as HDFS or S3.
Stars: ✭ 38 (-98.42%)
Mutual labels:  octo-correct-managed
python-jsonrpc-server
A Python 2 and 3 asynchronous JSON RPC server
Stars: ✭ 73 (-96.97%)
Mutual labels:  octo-correct-managed
gradle-npm-run-plugin
No description or website provided.
Stars: ✭ 19 (-99.21%)
Mutual labels:  octo-correct-managed
witchcraft-go-server
A highly opinionated Go embedded application server for RESTy APIs
Stars: ✭ 47 (-98.05%)
Mutual labels:  octo-correct-managed
gradle-docker-test-runner
Gradle plugin for running tests in Docker environments
Stars: ✭ 20 (-99.17%)
Mutual labels:  octo-correct-managed
asana mailer
A script that uses Asana's RESTful API to generate plaintext and HTML emails.
Stars: ✭ 12 (-99.5%)
Mutual labels:  octo-correct-managed
bouncer
An application to cycle (bounce) all nodes in a coordinated fashion in an AWS ASG or set of related ASGs
Stars: ✭ 123 (-94.9%)
Mutual labels:  octo-correct-managed
Tslint
🚦 An extensible linter for the TypeScript language
Stars: ✭ 5,922 (+145.52%)
Mutual labels:  octo-correct-managed
Plottable
📊 A library of modular chart components built on D3
Stars: ✭ 2,834 (+17.5%)
Mutual labels:  octo-correct-managed
dialogue
A client-side RPC library for conjure-java
Stars: ✭ 12 (-99.5%)
Mutual labels:  octo-correct-managed

Python Language Server

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 python-language-server

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 'python-language-server[yapf]'

All optional providers can be installed using:

pip install 'python-language-server[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. Change the pyls.configurationSources setting to ['flake8'] in order to respect flake8 configuration instead.

Overall configuration is computed first from user configuration (in home directory), overridden by configuration passed in by the language client, and then overriden by configuration discovered in the workspace.

To enable pydocstyle for linting docstrings add the following setting in your LSP configuration: ` "pyls.plugins.pydocstyle.enabled": true `

See vscode-client/package.json for the full set of supported configuration options.

Language Server Features

Auto Completion:

https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/auto-complete.gif

Code Linting with pycodestyle and pyflakes:

https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/linting.gif

Signature Help:

https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/signature-help.gif

Go to definition:

https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/goto-definition.gif

Hover:

https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/hover.gif

Find References:

https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/references.gif

Document Symbols:

https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/document-symbols.gif

Document Formatting:

https://raw.githubusercontent.com/palantir/python-language-server/develop/resources/document-format.gif

Development

To run the test suite:

pip install .[test] && pytest

Develop against VS Code

The Python language server can be developed against a local instance of Visual Studio Code.

Install VSCode

# Setup a virtual env
virtualenv env
. env/bin/activate

# Install pyls
pip install .

# Install the vscode-client extension
cd vscode-client
yarn install

# Run VSCode which is configured to use pyls
# See the bottom of vscode-client/src/extension.ts for info
yarn run vscode -- $PWD/../

Then to debug, click View -> Output and in the dropdown will be pyls. To refresh VSCode, press Cmd + r

License

This project is made available under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].