Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to pylsp #37

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

[![PyPI](https://img.shields.io/pypi/v/pyls-black.svg)](https://pypi.org/project/pyls-black/) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)

> [Black](https://github.com/ambv/black) plugin for the [Python Language Server](https://github.com/palantir/python-language-server).
> [Black](https://github.com/ambv/black) plugin for the [Python LSP Server](https://github.com/python-lsp/python-lsp-server).

In the same `virtualenv` as `python-language-server`:
In the same `virtualenv` as `python-lsp-server`:

```shell
pip3 install pyls-black
Expand Down
6 changes: 3 additions & 3 deletions pyls_black/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

import black
import toml
from pyls import hookimpl
from pylsp import hookimpl


@hookimpl(tryfirst=True)
def pyls_format_document(document):
def pylsp_format_document(document):
return format_document(document)


@hookimpl(tryfirst=True)
def pyls_format_range(document, range):
def pylsp_format_range(document, range):
range["start"]["character"] = 0
range["end"]["line"] += 1
range["end"]["character"] = 0
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ classifiers =

[options]
packages = find:
install_requires = python-language-server; black>=19.3b0; toml
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is missing the entry_points update

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why... It's pushed to the patch-1 branch.

install_requires = python-lsp-server; black>=19.3b0; toml
python_requires = >= 3.6

[options.entry_points]
Expand Down
4 changes: 2 additions & 2 deletions tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import black
import pkg_resources
import pytest
from pyls import uris
from pyls.workspace import Document, Workspace
from pylsp import uris
from pylsp.workspace import Document, Workspace

from pyls_black.plugin import load_config, pyls_format_document, pyls_format_range

Expand Down